Hi!
I'm trying to write a script that check if an CABLE/DSL user has more than 2 slots. But I just can't get it to work.
Here it is, I hope that someone can assist me.
-----------------------------------------------------------------------
Bot = "Slot-Check"
Connection = {"CABLE","DSL"}
maxslots = 2
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(curUser)
for key, value in Connection do
if (strfind(strlower(curUser.sMyInfoString), strlower(value),1,1)) then
_,b, slots = strfind(curUser.sMyInfoString,"S:(%d+)",b)
if(tonumber(slots) > 2) then
SendToNick(curUser.sName,"You have too many slots!")
curUser:Disconnect()
end
end
end
end
-----------------------------------------------------------------------
I get this error:
Syntax Error: bad argument #3 to `strfind' (number expected, got nil)
Syntax Error: bad argument #3 to `strfind' (number expected, got nil)
_,b, slots = strfind(curUser.sMyInfoString,"S:(%d+)",b )