Hello! I have a script for a trigger bot, this is the code:
-- TrickerBot.lua, created by Ptaczek Dec-24,2002
-- Just see how to implement the NMDC TriggerBot in LUA :)
-- Converted to Lua5.1 By Toobster??
-- As requested By Aragorn
botname = frmHub:GetHubBotName()
trigs = {
hallo=" Hallo [USER]. ",
bye= "GoodBye [USER]. ",
}
function Main()
frmHub:RegBot(botname)
end
function ChatArrival(user, data)
if( string.sub(data, 1, 1) == "<" ) then
-- get the msg only using regular expression
s,e,msg = string.find(data, "%b<> ([%w ]*)")
-- look in the table
for key, value in pairs(trigs) do
if( string.find( string.lower(msg), key) ) then
answer, x = string.gsub(value, "%b[]", user.sName)
SendToAll( data)
SendToAll(botname, answer)
return 1
end
end
end
end
Could someone please modify it so when a user types " lol " the bot triggers something different ? 5 different sentences ... when I type " lol " my first time the bot triggers "Yeah, [USER] that was funny, Hahahaha." and when I type " lol " my second time the bot triggers "Hmm, ok that was funny, I think :)" and so on ... I want these messages
Quote"Yeah, [USER] that was funny, Hahahaha.",
"Hmm, ok that was funny, I think :)",
"[USER] is laughing like a JACK-ASS !!!",
"what! [USER] why are you laughing?",
"You shake when you laugh, like a bowl full of jelly",
"hilarious!",
"hehehehe",
"hohohohoh",
"Glad you can see the funny side"
Thank you