can some one convert this to lua 5..?
botname = "Bot"
trigall=1
trigs = {
tra lja lja={"topolja"}
}
function Main()
frmHub:RegBot(botname)
end
function DataArrival(curUser, data)
status=strsub(data,1,strlen(data)-1)
-- parse the command
s,e,cmd = strfind( status, "%b<>%s+(%S+)" )
if (cmd=="!molchi") then
trigall=0
SendToAll(botname, " Hmf, Okidoki I will be quiet :(( ")
return 1
elseif (cmd=="!nemolchi") then
trigall=1
SendToAll(botname, " Okay, I will talk to you again :-)")
return 1
end
if( strsub(data, 1, 1) == "<" ) then
-- get the msg only using regular expression
s,e,msg = strfind(data, "%b<>([%a ]+)")
-- look in the table
if trigall==1 then
for key, value in trigs do
for key2, value2 in value do
if( strfind( strlower(msg), key) ) then
else break
end
if( strfind( strlower(msg), "!me") ) then
t="**"..curUser.sName
data=gsub (msg, "!me", t, 1 )
end
SendToAll( data ) -- send the original data
SetTimer(8000)
StartTimer()
answer, x = gsub(value[random(1,getn(value))], "%b[]", curUser.sName)
return 1; -- tell the hub we have processed the data
end
end
end
end
function OnTimer()
SendToAll( botname, answer ) -- send bot's answer
StopTimer()
end
end
ths..)
it has already been done, search the forum
yes, i found 2 bots but it's others then thet...
http://board.univ-angers.fr/thread.php?threadid=4628&boardid=12&sid=e7541ef6d0649d6b625c76b7a1e6ab22
This one then....
thanks)
thet bot wery fast write answers..
there are many versions of that, try sensi, or some other bot