Not Working... why ???
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Not Working... why ???

Started by nErBoS, 23 February, 2004, 00:18:08

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nErBoS

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
--## nErBoS Spot ##--

dvxjunkie

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

kepp

local _,b, llim = strfind(user.sMyInfoString,"B:(%x+)")

To start with, After b you are suppose to catch a number am i right?

%d+
Guarding    

nErBoS

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
--## nErBoS Spot ##--

kepp

i hvae no idea, probably somethign wrong somewhere else in the code!
Guarding    

NightLitch

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
//NL

nErBoS

Hi,

I founded the problem was something that i shouldn't be doing :)

Thanks to all.

Best regards, nErBoS
--## nErBoS Spot ##--

WooshMan

Tell us what you had done then... out of interest :-)
WooshMan

Creator of
originaltimebot.lua
www hubstats

Thanks to Plop, Kepp and NightLitch

nErBoS

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
--## nErBoS Spot ##--

NightLitch

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
//NL

nErBoS

#10
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
--## nErBoS Spot ##--

SMF spam blocked by CleanTalk