Policy Of Truth
 

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

Policy Of Truth

Started by bastya_elvtars, 15 September, 2004, 02:18:58

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bastya_elvtars

Just a little fun script to stuff up mainchat lines - it is real fun
-- PolicyOfTruth by Herodes and bastya_elvtars (the rock n' roll doctor)
-- puts some addition after mainchat lines
-- questions are omitted, also commands starting with !


chance=6 -- the bigger the number is, the less the chance is that users text will be changed

mergetext={ -- up2u to add anything u like, it comes after users text and a space
"- just kidding! :P",
"- i am a fool and telling lies...",
"- dont u believe what i say!",
" or not,...",
" i am being a dork",
" i dont really mean this ..",
}

function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then 
		data=strsub(data,1,strlen(data)-1)
		if not strfind(data,"%b<>%s+!.*") and not strfind(data,"%?$") then
		--strsub(data,strlen(data),strlen(data)~="?") then
			local a=random(chance)
			if a==1 then
				SendToAll(data.." "..mergetext[random(getn(mergetext))]) return 1
			else
				SendToAll(data) return 1
			end
		end
	end
end
Everything could have been anything else and it would have just as much meaning.

Herodes

"Take my word for it ... , or not .."  lol

bastya_elvtars

Quote[21:17] <[Telia]Styx> +rules  i am being a dork

:D :D :D
Everything could have been anything else and it would have just as much meaning.

Herodes

#3
Lol bast
I like this script as nothing in the world :D

An update so that  +rules i am a dork doesnt happen ;)

-- PolicyOfTruth by Herodes and bastya_elvtars (the rock n' roll doctor)
-- puts some addition after mainchat lines
-- questions are omitted, also commands starting with the prefixes in tPref ;)
tPrefs = { "!", ".", "?", "+", "@", "#"}

chance=6 -- the bigger the number is, the less the chance is that users text will be changed

mergetext={ -- up2u to add anything u like, it comes after users text and a space
" just kidding! :P",
" i am a fool and telling lies...",
" dont u believe what i say!",
" or not,...",
" i am being a dork",
" i dont really mean this ..",
}

function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then 
		data=strsub(data,1,strlen(data)-1)
		for i,v in tPrefs do
			if not strfind(data,"%b<>%s+"..v..".*") and not strfind(data,"%?$") then
				local a=random(chance)
				if a==1 then
					SendToAll(data.." "..mergetext[random(getn(mergetext))]) return 1
				else
					SendToAll(data) return 1
				end
			end
		end
	end
end

bastya_elvtars

OK, Herodes, I win...
-- PolicyOfTruth by Herodes and bastya_elvtars (the rock n' roll doctor)
-- puts some addition after mainchat lines
-- questions are omitted, also commands starting with the prefixes in tPref ;)
----------- v 0.2
-- added prefixed command protection by Herodes
-- added question teasing by bastya_elvtars
tPrefs = { "!", ".", "?", "+", "@", "#"}


chance=6 -- the bigger the number is, the less the chance is that users text will be changed


mergetext={ -- up2u to add anything u like, it comes after users text and a space
"- just kidding! :P",
"- i am a fool and telling lies...",
"- dont u believe what i say!",
" or not,...",
" i am being a dork",
" i dont really mean this ..",
}

mergeq={ -- text after questions
"i know im a n00b, but what2do...",
"lol, i ask such a simple thing.",
"damn, i am bothering you again",
"i know the answer, but mainchat looked so empty.",
"hehe i think ppl in here are holding encyclopaedias in their hands",
}

function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then 
		data=strsub(data,1,strlen(data)-1)
		for i,v in tPrefs do
			if not strfind(data,"%b<>%s+"..i..".*") and not strfind(data,"%?$") then
				local a=random(chance)
				if a==1 then
					SendToAll(data.." "..mergetext[random(getn(mergetext))]) return 1
				else
					SendToAll(data) return 1
				end
			elseif not strfind(data,"%b<>%s+"..i..".*") and strfind(data,"%?$") then
				local a=random(chance)
				if a==1 then
					SendToAll(data.." "..mergeq[random(getn(mergeq))]) return 1
				else
					SendToAll(data) return 1
				end
			end
		end
	end
end
Everything could have been anything else and it would have just as much meaning.

TiMeTrAVelleR

#5
This last version  block  commands  i use  in hub  

 8)

lol  they  both  do  

BottledHate

QuoteOriginally posted by T?M??r?V?ll?R
This last version  block  commands  i use  in hub  

 8)

lol  they  both  do  


looks like it is because it processes all data regardless
of weather it uses it or not... not positive, but removing
 the two:
else
					SendToAll(data) return 1

should stop it from processing ALL chat therefore
making other commands not get to the other bots'
dataarrival. (i mean.. if it isn't going to use the data, let
it pass on its way.)
^^^^
don't quote me on this, i just came up with that looking at the thing...

another option.. add a "_" (underscore) to the begging of the script
 name, so it loads last in pto, making its' dataarrival get
 stuff after all the others have had their way with it.
^^^^
don't quote me on that either, it's REALLY late, and i've
 been partying :D

-BH
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

TiMeTrAVelleR

#7
else
               SendToAll(data) return 1

removed  that  seems  to work   thanks

have a good sleep  :D

TiMeTrAVelleR

seemed  to work   but not animore  shame   quite funny  ;(

SMF spam blocked by CleanTalk