JokeBot : Edited
 

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

JokeBot : Edited

Started by pHaTTy, 12 October, 2003, 16:25:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pHaTTy

Here we go

-- JokeBot .lua by Cloud 
-- Some more content by [ANCIENT]Klismo :P 
-- Edited by Phatty for -mr-bill-
-- Double timer by klownietklowniet [30-09-2003]
-- ReAdded on command by phatty
-- On/Off switch by phatty

botname = "JokeBot" 

Botstatus=0

sec = 1000 
min = 60 * sec 
hour = 60 * min 

TimeSpanInMinutes = 1
QuestionTimeInSec = 5



Command = "+Joke" 
Command2 = "+shush"
Command3 = "+tell"
which = "q"  -- start with a question

jokes = { 
"How can you tell if a blonde has been using the computer?", 
"Why is it okay for blondes to catch cold?", 
"Did you hear about the blonde who tried to blow up her husband's car?", 
} 

answers = {
"The joystick is wet.",
"They don't have to worry about blowing their brains out.",
"She burned her lips on the tailpipe.",
}



function Main() 
   frmHub:RegBot(botname) 
   SetTimer(TimeSpanInMinutes*min) 
   StartTimer() 
end 



function OnTimer()
if Botstatus==1 then return 1 else
	if which == "q" then
		local number = random(1,getn(jokes))
		local Joke = jokes[number] 
		SendToAll(botname, Joke) 
		which = tostring(number)
		SetTimer(QuestionTimeInSec*sec)
	else
		local Answer = answers[tonumber(which)]
		SendToAll(botname, Answer) 
		which = "q"
		SetTimer(TimeSpanInMinutes*min)
		end
	end
end

function DataArrival(user, data) 
	if (strsub(data, 1, 1) == "<") or ( strsub(data, 1, 4) == "$To:" ) then 
		data = strsub(data,1,strlen(data)-1) 
		if (strfind(strlower(data), strlower(Command))) then 
		OnTimer()
		elseif (strfind(strlower(data), strlower(Command2))) then 
		SendToAll(botname, "Joke bot is switched off")
		Botstatus=1
		return 1
		elseif (strfind(strlower(data), strlower(Command3))) then 
		SendToAll(botname, "Joke bot is switched on")
		Botstatus=0
		return 1
		end 
	end
end

l8rr,,

-phatty
Resistance is futile!

Millsy

Anyone got this script with more jokes in it.

 :P Thanks  :P
      Millsy
MoviePirates.no-ip.com    -   Part Of The BBI Network

Sudds

Hey grate script. Can i just add jokes and answers to it as long as i add them like this
jokes = {
"the joke.",
}

answers = {
"the answers.",

IS this ok?
Sudds

SMF spam blocked by CleanTalk