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
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.
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
Thanks man...
The first one code work good...
second not work... thank you
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
VidFamne - ye man your script work good !
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*
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 ...