Random nickparty bot convert to lua5 please
 

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

Random nickparty bot convert to lua5 please

Started by stageline, 14 March, 2005, 03:25:43

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stageline

Hello everybody!

Please convert random nickparty bot to LUA5.Thx

----------------------------------------------------------------------
Code
----------------------------------------------------------------------

--Crazy Animals 2.0 Script Powered by Demone.Astaroth

--Script temporarily gives to users a strange nick :)
--2 options (fixed and random nicks, always for the current session); stopping command clean the memory

--Commands:
--  !anim fix -- Let's start the fixed animals' nick party!
--  !anim on -- Let's start the random animals' nick party!
--  !anim off -- Stop the parties

bot="[HUB]Security"

anim=0

cnames = { 
"[HUN]Ervin",
"[HUN]Ern?",
"[HUN]Krisztina",
"[HUN]Rezs?ke",
"[HUN]Attis",
"[HUN]Scareface",
"[HUN]Drexion",
"[HUN]Csiri-Biri-Zabszalma",
"[HUN]Edina",
"[HUN]Tomi",
"[HUN]Elmegyogy?",
"[HUN]Nem?nfingottam",
"[HUN]Gerg?",
"[HUN]Romal?ny",
"[HUN]sexi-girl",
"[HUN]Peti",
"[HUN]Laci",
"[HUN]Lajos",
"[HUN]Viccmaster",
"[HUN]Ildik?",
"[HUN]Cseri",
"[HUN]?gica",
"[HUN]Gizella",
"[HUN]Signal",
} 			

unique = {}

function Main()
frmHub:RegBot(BotName)
end

function DataArrival(curUser, message) 

s,e,cmd= strfind(message,"%b<>%s+(%S+)")
if anim==1 then
	if unique[curUser.sName]==nil then
		unique[curUser.sName]=cnames[random(1, getn(cnames))]
	end
end

if curUser.bOperator ~= nil then
	s,e,cmd,status= strfind(message,"%b<>%s(.+)%s(.+)")
	if (cmd == "!anim") then
		if strfind(status, "fix") then
			SendToAll(bot, "Duplex natura vigilat super omnia.")
			anim=1
		elseif strfind(status, "off") then
			SendToAll(bot, "Nickpatry kikapcsolva")
			unique[curUser.sName]=nil
			anim=0
		elseif strfind(status, "on") then
			SendToAll(bot, "Nickparty enged?lyezve")
			anim=2
		end
	return 1
	end
end

if anim==1 then
if not strfind(message, "$.+") then
	s,e,mes = strfind(message, "%b<> (.*)")
	if unique[curUser.sName]~=nil then
		SendToAll(unique[curUser.sName], mes)
return 1; end; end

elseif anim==2 then
if not strfind(message, "$.+") then
	s,e,mes = strfind(message, "%b<> (.*)")
	nome=cnames[random(1, getn(cnames))]
	SendToAll(nome, mes)
return 1; end;
end

end

Jelf

Here yo go..
--Converted to lua5 By Jelf 14/03/05
--Crazy Animals 2.0 Script Powered by Demone.Astaroth

--Script temporarily gives to users a strange nick :)
--2 options (fixed and random nicks, always for the current session); stopping command clean the memory

--Commands:
--  !anim fix -- Let's start the fixed animals' nick party!
--  !anim on -- Let's start the random animals' nick party!
--  !anim off -- Stop the parties

bot="[HUB]Security"

anim=0

cnames = { 
"[HUN]Ervin",
"[HUN]Ern?",
"[HUN]Krisztina",
"[HUN]Rezs?ke",
"[HUN]Attis",
"[HUN]Scareface",
"[HUN]Drexion",
"[HUN]Csiri-Biri-Zabszalma",
"[HUN]Edina",
"[HUN]Tomi",
"[HUN]Elmegyogy?",
"[HUN]Nem?nfingottam",
"[HUN]Gerg?",
"[HUN]Romal?ny",
"[HUN]sexi-girl",
"[HUN]Peti",
"[HUN]Laci",
"[HUN]Lajos",
"[HUN]Viccmaster",
"[HUN]Ildik?",
"[HUN]Cseri",
"[HUN]?gica",
"[HUN]Gizella",
"[HUN]Signal",
} 			

unique = {}

function Main()
	frmHub:RegBot(BotName)
end

function ChatArrival(curUser, message) 

	s,e,cmd= string.find(message,"%b<>%s+(%S+)")
	if anim==1 then
		if unique[curUser.sName]==nil then
			unique[curUser.sName]=cnames[math.random(1, table.getn(cnames))]
		end
	end

	if curUser.bOperator ~= nil then
		s,e,cmd,status= string.find(message,"%b<>%s(.+)%s(.+)")
		if (cmd == "!anim") then
			if string.find(status, "fix") then
				SendToAll(bot, "Duplex natura vigilat super omnia.")
				anim=1
			elseif string.find(status, "off") then
				SendToAll(bot, "Nickpatry kikapcsolva")
				unique[curUser.sName]=nil
				anim=0
			elseif string.find(status, "on") then
				SendToAll(bot, "Nickparty enged?lyezve")
				anim=2
			end
		return 1
		end
	end

	if anim==1 then
	if not string.find(message, "$.+") then
		s,e,mes = string.find(message, "%b<> (.*)")
		if unique[curUser.sName]~=nil then
			SendToAll(unique[curUser.sName], mes)
		return 1; end; end

	elseif anim==2 then
		if not string.find(message, "$.+") then
			s,e,mes = string.find(message, "%b<> (.*)")
			nome=cnames[math.random(1, table.getn(cnames))]
			SendToAll(nome, mes)
		return 1; end;
	end
end

stageline

very    thanks!! :)

??????Hawk??????

simply searching or browsing through the finished scripts section would saved you time and someones efforts in converting....

HERE  and HERE

Jelf

AArrrghhhh!!

Oh well, there go's another, hehe

stageline

#5
QuoteOriginally posted by ??????Hawk??????
simply searching or browsing through the finished scripts section would saved you time and someones efforts in converting....


OK!I understand.
The simpsons bot no RANDOM nickparty bot. :(
It's not working for me.. pardon me! :)

PPK

QuoteOriginally posted by stageline
The simpsons bot no RANDOM nickparty bot. :(
It is same, you only change nicks in cnames  :]
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

SMF spam blocked by CleanTalk