Sorry but I must be dumb =)
prefix = "!","+","?","?"
if cmd==""..prefix.."myip" then
user:SendData("Power?","Your IP is: "..user.sIP.."")
return 1
end
How do I make this thing working??
Wanna have multiple prefixes for the whole script...So its not just this little part...Just so ANYONE can help me with this =)
Also tried with
prefix = {"!","+","?","?"}
if cmd==prefix.."myip" then
user:SendData("Power?","Your IP is: "..user.sIP.."")
return 1
end
But that didnt work either...As I said...I must be dumb =)
Plz help me
Hi,
It should be the second one, but you need to run all array and find the prefix used by the user for eg...
prefix = { "!", "+", "?", "?" }
for i = 1, getn(prefix) do
if cmd==prefix[i].."myip" then
user:SendData("Power?", "Your IP is: "..user.sIP)
return 1
end
end
Best regards, nErBoS
this one does the same ..
cheers to plop for the help a while back with this
just ripped from my script but you'll get the idea ..
Tprefix = { ["+"]=1 , ["!"]=1 , ["-"]=1 } --- you know ;)
-- command part now !
local s,e,prefix = strfind(data, "%b<>%s*(%S)")
if Tprefix[prefix] then
local s,e,cmd=strfind(data, "%b<>%s*%S(%S+)")
if cmd == "myip" then
user:SendData(BotName, "Your IP is *** "..user.sIP)
end
end
-Typhoon?