Hi all,
This is messing my head for example in the NewUserConnected i have this..
if (strfind(user.sMyInfoString, "O:")) then
user:SendData(Bot, "Settings do DC->Sharing , Open extra slot tem de estar em zero.")
user:SendData(Bot, "Desconectado...")
user:Disconnect()
end
But does'nt work.
The same happens to this..
if (strfind(user.sMyInfoString,"B:")) then
local _,b, llim = strfind(user.sMyInfoString,"B:(%x+)")
if (llim ~= nil) then
llim = tonumber(llim)
if (llim < limitador) then
user:SendData(Bot, "Est?s a usar limitador, deve estar no minimo em "..limitador.." KB/s.")
user:SendData(Bot, "Desconectado...")
user:Disconnect()
end
end
end
In the first case i want to disconnect the user which has the option OpenExtraSlot active, and i the other i want to disconect users which use upload limiter (in code limitador = 15)
Can anyone help me out where ??
Best regards, nErBoS
I thin you gotta use quotes around the commas within the messege...
like this
f (strfind(user.sMyInfoString, "O:")) then
user:SendData(Bot, "Settings do DC->Sharing " ," Open extra slot tem de estar em zero.")
user:SendData(Bot, "Desconectado...")
user:Disconnect()
end
local _,b, llim = strfind(user.sMyInfoString,"B:(%x+)")
To start with, After b you are suppose to catch a number am i right?
%d+
Hi,
dvxjunkie..
When i do this..
user:SendData(Bot, "Settings do DC->Sharing , Open extra slot tem de estar em zero.")
does'nt matter what i write in "" the bot will send everything.
keep..
You are right, always missing on that :P
But the problem stills hapen, this is a problem on The Connect function isn't checking the MyInfoString, because if i change to the DataArrival it will work when ever a user do something.
But i would like to know why doesn't check the MyInfoString :)
Best regards, nErBoS
i hvae no idea, probably somethign wrong somewhere else in the code!
Well my guess is that you get this problem:
you get a NIL value!!! on it some times RIGHT?
by step the nil the it will work...
if value==nil or value=="" then
--code
user:Disconnect()
end
and as Kepp say, use %d+ NOT %x+, it is number you are after not hex's.
/NL
Hi,
I founded the problem was something that i shouldn't be doing :)
Thanks to all.
Best regards, nErBoS
Tell us what you had done then... out of interest :-)
Hi,
The problem was...
eg.
if (X == "Active") then
--do code--
end
if (X == "Deactive") then
return <-- I have removed this return and started to work ok :)
end
Best regrads, nErBoS
QuotenErBoS
Hi,
The problem was...
eg.
if (X == "Active") then
--do code--
end
if (X == "Deactive") then
return <-- I have removed this return and started to work ok :)
end
Best regrads, nErBoS
about this, why not doing it much simpler:
if (X=="Active") then
-- do code here
return 1
elseif (X=="Deactive") then
-- do that code here
return 1
else
-- if none found this code here
return 1
end
/NL
hehehe
if you see my bot you will get lost, i am a lit deorganized :))
i did this..
if (X=="Active") then
-- do code here
elseif (X=="Deactive") then
--do nothing
end
When i make a multi translator i will put on the forum, for now is only portuguese :P
Thanks to all one more time
Best regards, nErBoS