Hi,
I wanted a script for:
Example:
somebody writes !userinfo (or !whois) Botname
he will not get userinfo (botinfo), he will get an answer in main
[22:56:18] you can't do this ;)
or
[22:56:18] don't do this ;)
or etc.
I wanted this bot working like trickerbot.
It must answer to user in random mode if user wants to get bot's info on !userinfo . It must be nearly 6 bot answers (or more) in the script (I can change and edit them).
Do you understand me? =))
Hi,
Hope it helps...
--## Bot Revange
--## Requested by NemeziS
--## Will respond random to a comand used for Bot
--## Made by nErBoS
sBot = "R-Bot"
arrCMD = {
["!userinfo"] = {
"MSG1",
"MSG2",
},
["!whois"] = {
"MSG1",
"MSG2",
},
}
function Main()
frmHub:RegBot(sBot)
end
function DataArrival(user, data)
if (strsub(data,1,1) == "<" or strsub(data,1,strlen(data)-1) == "$To: "..sBot) then
data = strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if (arrCMD[cmd] ~= nil) then
local s,e,nick = strfind(data, "%b<>%s+%S+%s+(%S+)")
if (strlower(nick) == strlower(sBot)) then
user:SendData(sBot, arrCMD[cmd][random(1,getn(arrCMD[cmd]))])
return 1
end
end
end
end
Best regards, nErBoS
Thanx! It works! 10x! :))