Clever Janinha
 

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

Clever Janinha

Started by Penguin, 04 June, 2005, 10:14:38

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Penguin

Hi guys,

Can you somebody help me with this?

I want make 2 thing:
1. the command to add phrase into script (for ex. +addphrase hello="Hi [USER]"?

2. and give all Janinha's phrases from script to individual .txt files,  so you can add phrases with command

Here is the script:
---------------------------------------------------- 
-- Clever Janinha v1.0 (more Lua4 alike)

-- modded to LUA 5 by jiten and dessamator (some killing :P)

-- Ideas taken from:
-- Thks to Ptaczek for his TrickerBot.lua 
-- Thks to Skrollster, for the math.random synthax ([URL]http://lua.bcs-solutions.de/thread.php?t...2a4078fa73ba6be[/URL]) 
-- Thks to MatrixX for some help, too... ([URL]http://lua.bcs-solutions.de/thread.php?t...f4cc&page=2[/URL]) 
-- And thks to the others, for their help... ;o) 
-- seNsi: the 'clever' Bot :p 
--------------------------------------------------------------- 


Bot = "Janinha" 
botname = "?bot?" 

trigs = { 
   filme="Filmes? oohh [USER], chega de filmes dramaticos, assiste la algo com accao :D!", 
   cinema="Oba oba, cinema, vamos assistir o RAMBO, mas [USER], tu pagas! ", 
   jantar="oooh [USER], eu ja jantei mas n?o te preocupes deixei os restos pra ti, :D" ,
   raiva="Tas com raiva, vai para guerra precisam d gajos como tu la", 
   slots="hmm, queres slots, quanto pagas por cada?", 
   sono="Sono, ? isso que da, passas toda noite a roubar carros, e depois reclamas", 
   fome="Fome?, tenho 1 dica para ti, pc n?o alimenta , vai la COMER! ", 
   porca="Hey [USER], leva a tua porca e vao la banhar, t?o a fazer o hub cheirar mal,:P", 
      xau="arriverdeci [USER]", 
      asta="asta la vista [USER]",
      cya="We told him to go away, and away he goes Precious, goone... goone... goone..., Janinha is FREEEEE", 
      foda="[USER], so pensas nisso, tas frustado ou o que?", 
      janinha="Eu sei que sou irresistivel, mas n?o te quero, tenta outra!", 
      adeus="adi?s [USER]!", 
      virus="virus?, queres infectar-me, tsk, tou a ser protegida pelo (K.V.A) Kanimambo Virus Annihilator v.10000!",     
      ["cala te"]="cala-te, cala-te, cala-te. Grande parvoide, depois vais reclamar que n?o se fala nada",
      ["alguem tem"]="hmm, talvez sim , talvez n?o, procure e descobre sozinho(a)", 
      ["algum op"]="Ops, sao aqueles com chaves nos nicks, tenta hablar(falar) com eles no pvt!", 
      ["firewall"]="hmm, voces ainda usam isso, evoluem la, usem o LAZERWALL, e melhor!",
      ["bug"]="damn, Insectos aki deixa la ir buscar minha bazooka!",  
      ["quem tem"]="ooh [USER],Tente usar o Search (lupa que ta la em cima)! ", 
      ["Ol?"]= "hola [USER]!", 
      ["hola"]="?hola usuario, es usted un var?n o una hembra?",
      ["sup"]= "Aloha [USER]!",
      ["bon jour"]= "bonjour [USER], tout bien?",
      ["good morning"] = "Gooood Morning [USER]!!",
      ["wazzup"] ="WAZZZZZZZZZZZZZZZZZZUHHHH :P ",
      ["kanimambo"] = "hmm, o que queres com meu marido?",
      killer="O que queres com o ze grand BIG CHEESE? hein? j? agora, onde est? ele? hum.... vendo scrubs?", 
} 

idlequestions = { 
	"This place looks like a grave,did the Grim Reaper pass by ?",
	"Ta mesmo morto isto, hmm, restou algum 'zombie'?",
	"Hmm, parece que o Bin Laden fez bem o seu trabalho, espantou todo mundo do main chat", 
	"Ai ai ai, ta mau isto, houve 1 attake nuclear por aqui e ninguem me contou?!", 
	"Hmm, anybody there?...(doesnt seem so). At last the main is mine all mine!,hehe :D ", 
	"Onde ta o ppl?, morreram todos e foram parar na casa mortuaria?",
	"Iih, isto ta t?o silencioso, sera que ate fantasmas tem medo de passar por aqui?",
	"Sera que todos fofokeiros t?o nos pvts?",
	"Damn, a minha beleza espantou o ppl?",
	"Bonjour mes ami, tout bien?",
	"?Hola los usuarios queridos, c?mo son usted?",
	"Ziss place is Cursed!!",
	"Quem mandou 1 peido e espantou os users??",
	"Quem ? o Fedorento que espantou os Hubbers(users)",
	"Come out, come out, Wherever u are !",
} 

idleanswers = { 
	"Ate que enfim [USER], conseguiste parar de bater 1 ..., pra bater 1 papo!", 
	"Hmm, [USER]!, o sobrevivente do attake do Bin laden, ", 
	"Wow, [USER],attakes nucleares n?o devem afectar-te(deves ser 1 barata) ", 
	"Damn, there goes the neighbourhood, the main is no longer mine!, :|", 
	"Ate que enfim, tua casa de banho ja deve tar a cheirar mal!",
	"Hmm, [USER], vejo que escapaste da casa mortuaria",
	"[USER], Ja acabou a Fofoca?",
	"[USER], Vieste confirmar se sou 1 beleza ou n?o? claro q sou!! , :P",
	"Bonjour [USER]",
	"hola [USER]",
	"Do not attempt to adjust the monitor, I CONTROL the transmission, mwuhahaha",
	"Pikaboooo, I C U!",
} 

idlemorninganswers = { 
	"Welcome back to the land of the living, [USER]!", 
	"Iiiih, tens mau halito va la escovar os dentes, :P" ,
	"Hmm, acordaste e ja tas aqui?, ? obvio que sonhaste comigo, :P",
	"Iiih, ainda nem lavaste a cara e ja tas aqui?"
} 

idlemorning = { 
	"Good Morning ,Buenos dias, bom dia, e bon jour, mes amis!", 
	"Ent?o quem ta aqui pra parlar comigo?",
	"Arise puny Mortals and Greet your Goddess Janinha" ,
	"Are All creatures in the Underworld?"
} 

idleevening = { 
	"Bonne nuit !!",
	"Ta cheio de medrosos neste hub, fugiram todos do ''boogie man''",
	"It Seems the sandman came early today", 
	"Hmm, isto ta t?o silencioso que ate da pra ouvir os grilos",
} 

idleeveninganswers = { 
	"Buonas noches,[USER] ",
	"Hmm, ent?o [USER], que fazes nesta bela noite , bater 1 ... batuke? " ,
	"It seems the Sandman didnt visit you, [USER]",
} 

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

index = nil 

function Main() 
	frmHub:RegBot(botname)
	quiet = "false" 
	talk = "allow" 
	WaitingForAnswerAfterQuiet = "false" 
	WaitingForAnswerMorning = "false" 
	WaitingForAnswerEvening = "false" 
	SetTimer(30*min) 
	StartTimer() 
end 

function ToArrival(user, data) 
	data=string.sub(data,1,string.len(data)-1) 
	s,e,whoTo = string.find(data,"$To:%s+(%S+)") 
	if (whoTo == botname) then 
		s,e,whoTo,from,cmd = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)") 
		if (user.bOperator) then 
			if (cmd=="!bico") then 
				quiet = "true" 
				talk = "notallow" 
				StopTimer() 
				SendToAll(Bot, "Remember my words,"..user.sName..", ill be BACK!  ")
			end 
			if (cmd=="!fala") then 
				talk = "allow" 
				quiet = "false" 
				WaitingForAnswerAfterQuiet = "false" 
				WaitingForAnswerMorning = "false" 
				WaitingForAnswerEvening = "false" 
				StartTimer() 
				SendToAll(Bot, "Guess whos back, back again, no its not slim, its Janinha !!!!... :o)") 
			end 
		end 
	end 
end 

function ChatArrival(user, data) 
	data=string.sub(data,1,string.len(data)-1) 
	s,e,cmd = string.find( data, "%b<>%s+(%S+)" ) 
	s,e,mess = string.find(data, "%b<> ([%w ]*)") 

	-- Trigs Answers -- 
	for key, value in trigs do 
		-- Answer to mess command if bot is allowed to speak -- 
		if mess or cmd and talk == "allow" then 
			-- Answer to the trig, with 1 trig response, if bot wasn't quiet since a while -- 
			if WaitingForAnswerAfterQuiet == "false" then 
				if( string.find( string.lower(mess), key) ) or ( string.find( string.lower(cmd), key) ) then 
					SendToAll(user.sName, mess) 
					answer, x = string.gsub(value, "%b[]", user.sName) 
					SendToAll(Bot, answer ) 
					return 1
				end 
			end 
		end 

	end 

	-- Restart the timer each time someone is talking on the main chat, if bot is allowed to talk -- 
	if mess or cmd then 
		if talk == "allow" then 
			if iscommand(cmd) or iscommand(mess) then 
			else 
				StopTimer() 
				StartTimer() 
			end 
		end 
	end 

	-- Quiet the bot (ops command) -- 
	if (cmd=="!bico") then 
		if user.bOperator then 
			quiet = "true" 
			talk = "notallow" 
			SendToAll(Bot, "Remember my words,"..user.sName..", ill be BACK!  ") 
			StopTimer() 
		else 
		-- Answer if a user try to use the command !quiet and if it is allowed to talk - then, check if the bot was quiet or not before -- 
			if talk == "allow" and WaitingForAnswerAfterQuiet == "false" then 
				SendToAll(Bot,"hahaha, You dont have the cojones to shut me up!!!!") 
			end 
		end 
		return 1
	end 

	-- Allow the bot to talk (ops command) -- 
	if (cmd=="!fala") then 
		if user.bOperator then 
			talk = "allow" 
			quiet = "false" 
			WaitingForAnswerAfterQuiet = "false" 
			WaitingForAnswerMorning = "false" 
			WaitingForAnswerEvening = "false" 
			StartTimer() 
			SendToAll(Bot, "Yiiiiiisa, Voltei!!") 
		else 
			-- Answer if a user try to use the command !talk and if it is allowed to talk - then, check if the bot was quiet or not before -- 
			if talk == "allow" and WaitingForAnswerAfterQuiet == "false" then 
				SendToAll(Bot, "Ohh user tu n?o podes mandar me falar(no cojones)") 
			end 
		end 
		return 1
	end 

	-- Receiving entries on the main chat -- 
	if cmd or mess then 
		if talk == "allow" then 
			-- Morning Answer -- 
			if WaitingForAnswerMorning == "true" then 
				-- Ignore the line commands begining with '+'/'!'/'#'/'?'. Bot won't replye - nicest, i think... :o) -- 
					if iscommand(cmd) or iscommand(mess) then 
					else 
						-- Answer to chat entries -- 
						SendToAll(user.sName, mess)
						index = math.random(1,table.getn(idlemorninganswers)) 
						answer, x = string.gsub(idlemorninganswers[index], "%b[]", user.sName) 
						SendToAll(Bot, answer) 
						WaitingForAnswerAfterQuiet = "false" 
						WaitingForAnswerMorning = "false" 
						WaitingForAnswerEvening = "false" 
						return 1
					end 
			end 

			-- Evening Answer -- 
			if WaitingForAnswerEvening == "true" then 
				-- Ignore the line commands begining with '+'/'!'/'#'/'?'. Bot won't replye - nicest, i think... :o) -- 
				if iscommand(cmd) or iscommand(mess) then 
				else 
					-- Answer to chat entries -- 
					SendToAll(user.sName, mess)
					index = math.random(1,table.getn(idleeveninganswers)) 
					answer, x = string.gsub(idleeveninganswers[index], "%b[]", user.sName) 
					SendToAll(Bot, answer) 
					WaitingForAnswerAfterQuiet = "false" 
					WaitingForAnswerMorning = "false" 
					WaitingForAnswerEvening = "false" 
					return 1
				end 
			end 

			-- Answer after the bot was too quiet -- 
			if WaitingForAnswerAfterQuiet == "true" then 
				-- Ignore the line commands begining with '+'/'!'/'#'/'?'. Bot won't replye - nicest, i think... :o) -- 
				if iscommand(cmd) or iscommand(mess) then 
				else 
					-- Answer to chat entries -- 
					SendToAll(user.sName, mess)
					index = math.random(1,table.getn(idleanswers)) 
					answer, x = string.gsub(idleanswers[index], "%b[]", user.sName) 
					SendToAll(Bot, answer) 
					WaitingForAnswerAfterQuiet = "false" 
					WaitingForAnswerMorning = "false" 
					WaitingForAnswerEvening = "false" 
					return 1
				end 
			end 
		end 
	end 
end 

function OnTimer() 
	time() 
	trig = "notdone" 

	-- Idle trigs, for the morning, and the evening :o) -- 
	if H=="09" then 
		SendToAll(user.sName, mess)
		index = math.random(1,table.getn(idlemorning)) 
		SendToAll(Bot, idlemorning[index]) 
		WaitingForAnswerAfterQuiet = "false" 
		WaitingForAnswerMorning = "true" 
		WaitingForAnswerEvening = "false" 
		StartTimer() 
		trig = "done" 
		return 1
	end 

	if H=="19" then 
		SendToAll(user.sName, mess)
		index = math.random(1,table.getn(idleevening)) 
		SendToAll(Bot, idleevening[index]) 
		WaitingForAnswerAfterQuiet = "false" 
		WaitingForAnswerMorning = "false" 
		WaitingForAnswerEvening = "true" 
		StartTimer() 
		trig = "done" 
		return 1
	end 

	-- Others idle trigs -- 
	if trig == "notdone" then 
		SendToAll(Bot, mess)
		index = math.random(1,table.getn(idlequestions)) 
		SendToAll(Bot, idlequestions[index]) 
		WaitingForAnswerAfterQuiet = "true" 
		return 1
	end 
end 

-- Get Time -- 

function time() 
	S = os.date("%S") 
	H = os.date("%H") 
	M = os.date("%M") 
	D = os.date("%d") 
	MM = os.date("%m") 
	Y = os.date("%y") 
	return H 
end 

function iscommand(str) 
	return string.sub(str, 1, 1) == "!" or string.sub(str, 1, 1) == "?" or string.sub(str, 1, 1) == "+" or string.sub(str, 1, 1) == "#" 
end

Thanks in advance for help me with this script!
                                            Penguin

Ubikk

Is it possible to make more answers for the same trigger?

Dessamator

yep its possible, there are other bots which already have that feature !
Ignorance is Bliss.

SMF spam blocked by CleanTalk