trigger
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

trigger

Started by BoyKind, 31 July, 2006, 16:15:55

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BoyKind

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
With all the respect

BoyKind

With all the respect

speedX

hey can any one tel me wat a trigger bot does???
Thanking You,

speedX

Psycho_Chihuahua

a triggerbot replies to certain words with a predefined answer or routine

using the above example...

a User types:  hallo
the bot replies:   Hallo <User> (ex. Hallo Psycho_Chihuahua)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

SMF spam blocked by CleanTalk