Need simple bot - IP BoT
 

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

Need simple bot - IP BoT

Started by juda, 02 February, 2005, 19:01:35

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

juda

Hay !!!
 I run PtokaX hub and use inbuild commands,but I miss command:
 ---  !myip   to show IP only to user who use command
-----------------------------------------------------------
 YOUR IP IS:  193.xxx.xxx.xxx
-----------------------------------------------------------
     
Can someone help me and write script for me or give me some tips...
I search,but it is all big bots....

         Thanks for help
juda

bastya_elvtars

function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then 
		data=strsub(data,1,strlen(data)-1)
		local _,_,cmd = strfind(data,"%b<>%s+[%!%+%#](%S+)")
		if cmd=="myip" then
			user:SendData("IP-Bot","Your IP address is "..user.sIP)
			return 1
		end
	end
end


Didn't test, hope it works.
Everything could have been anything else and it would have just as much meaning.

Herodes

#2
try this one.. .
function DataArrival(user, data)
	if strsub(data, 1,1) == "<" then
		local s,e,cmd = strfind(data, "%b<>%s[!%-%+%?](%S+)")
		if cmd == "myip" then
			user:SendData( "YourIP", "is "..user.sIP)
		end
	end
end

[*edit*] Hahahahahah we almost came up with the same script baster  :D

juda

Thanks man...

  The first one code work good...
   second not work... thank you
juda

VidFamne

#4
function DataArrival(user, data)
	if strsub(data, -6,-2) == "!myip" then
			user:SendData( "IP-Bot", "Your current IP is;  "..user.sIP)
	end
end
Does this work, perhaps? ;D

juda

VidFamne - ye man   your script work good !
juda

bastya_elvtars

QuoteOriginally posted by Herodes
try this one.. .
function DataArrival(user, data)
	if strsub(data, 1,1) == "<" then
-- sumthin is missing from here // BE
		local s,e,cmd = strfind(data, "%b<>%s[!%-%+%?](%S+)")
		if cmd == "myip" then
			user:SendData( "YourIP", "is "..user.sIP)
		end
	end
end

[*edit*] Hahahahahah we almost came up with the same script baster  :D

Yea, you just missed the line that makes it work! :D

data=strsub(data,1,strlen(data)-1)

Damn man, we are getting rusty! ;) Seems 1.5 months without DC kill me...

*logs off and goes to commit suicide*
Everything could have been anything else and it would have just as much meaning.

Herodes

QuoteOriginally posted by bastya_elvtars
QuoteOriginally posted by Herodes
try this one.. .
function DataArrival(user, data)
	if strsub(data, 1,1) == "<" then
-- sumthin is missing from here // BE
		local s,e,cmd = strfind(data, "%b<>%s[!%-%+%?](%S+)")
		if cmd == "myip" then
			user:SendData( "YourIP", "is "..user.sIP)
		end
	end
end

[*edit*] Hahahahahah we almost came up with the same script baster  :D

Yea, you just missed the line that makes it work! :D

data=strsub(data,1,strlen(data)-1)

Damn man, we are getting rusty! ;) Seems 1.5 months without DC kill me...

*logs off and goes to commit suicide*
Sure thing man .. havent scripted for a long time too ...

SMF spam blocked by CleanTalk