NaughtyASs by Phatty (gsub bot)
 

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

NaughtyASs by Phatty (gsub bot)

Started by pHaTTy, 02 March, 2004, 01:27:17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pHaTTy

ok this is ripped stright out of Gekko was gonna make a howto but not got time, and this pretty crap atm anyways :p

just little bot showing off gsub for now......

--//NaughtyASs Cook Bot by Phatty
--//Does things with words lol :p

checkbadword = 2

--checkadword nr's as follows:
--1 = blocks bad word
--2 = use word trader
--3 = censor bad words
--4 = space bad words

Bot = "!crazy"

 
badtable = {

["twat"]="bread",
["cunt"]="dish washer",
["bastard"]="cook-book",
["fucker"]="chief",
["fucking"]="cooking",
["fuck"]="cook",
["arsehole"]="microwave",
["arse"]="microchip",
["clit"]="tomato",
["cock"]="banana",
["tosser"]="baker",
["bitch"]="teaspoon",
["shit"]="mcdonald's manager",
["crap"]="chocolate",
["pissed"]="diluted",
["piss"]="orange juice",
["shagging"]="boiling",
["shag"]="sauce",
["cum"]="water",
["spunk"]="juice",
["asshole"]="fridge-freezer",
["ass"]="oven",
["slut"]="grape-fruit",
["dick"]="sausage",
["fanny"]="pie",
["whore"]="hotdog",
["wanker"]="i'm a wanker",
["slag"]="i'm a slag",

}


function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then
		--data=strsub(data,1,strlen(data)-1)--not needed
		--s,e,cmd = strfind(data,"%b<>%s+(%S+)")--not needed

		----------------------------------
		--## BadWord Check by Phatty ## --
		----------------------------------
		if checkbadword == 1 then
			for i,v in badtable do
				if strfind(data, i) then
				return 1
				end
			end
		elseif checkbadword == 2 then
			for i,v in badtable do
			    	data=gsub(data, i, v)
				--data, x,y = gsub(data, "%b"..i, v)
				silence = 1
			end
		elseif checkbadword == 3 then
			for i,v in badtable do
			    	data=gsub(data, i, "*censored*")
				silence = 1
			end
		elseif checkbadword == 4 then
			for i,v in badtable do
			    	data=gsub(data, i, "")
				silence = 1
			end
		end
	end
end
Resistance is futile!

WickeD

I am gona try it and see!  
Thx a lot m8!!


//WickeD

WickeD

Nice script!  =)  But I do not get it to work m8!

It get regged in hub-soft but do not show in user list!

and do not work!


Can you take a look at it! and see if you can get it to work?

//WickeD



--//NaughtyASs Cook Bot by Phatty
--//Does things with words lol :p

checkbadword = 2

--checkadword nr's as follows:
--1 = blocks bad word
--2 = use word trader
--3 = censor bad words
--4 = space bad words

Bot = "[Bot]??Crazy-Dog??"

 
badtable = {

["satan"]="banan",
["fan"]="?pple",
["kuk"]="kof?ngare",
["fucker"]="barn",
["fucking"]="hundar",
["fuck"]="sn?",
["arsehole"]="kaniner",
["arse"]="f?glar",
["fitta"]="tomater",
["j?vla"]="telefon",
["b?g"]="kaka",
["helvete"]="kaffe",
["shit"]="bilar",
["pissed"]="fanta",
["piss"]="mj?lk",
["asshole"]="motor",
["ass"]="d?rr",
["dick"]="vatten",
}


function DataArrival(user,data)
   if strsub(data, 1, 1) == "<" then
      --data=strsub(data,1,strlen(data)-1)--not needed
      --s,e,cmd = strfind(data,"%b<>%s+(%S+)")--not needed

      ----------------------------------
      --## BadWord Check by Phatty ## --
      ----------------------------------
      if checkbadword == 1 then
         for i,v in badtable do
            if strfind(data, i) then
            return 1
            end
         end
      elseif checkbadword == 2 then
         for i,v in badtable do
                data=gsub(data, i, v)
            --data, x,y = gsub(data, "%b"..i, v)
            silence = 1
         end
      elseif checkbadword == 3 then
         for i,v in badtable do
                data=gsub(data, i, "*censored*")
            silence = 1
         end
      elseif checkbadword == 4 then
         for i,v in badtable do
                data=gsub(data, i, "")
            silence = 1
         end
      end
   end
end

yepyepyep4711

Hi guys, got an idea for this one:

how 'bout different categories with different arrays?

i.e. one array for badwords that get traded, one for the ones that get spaced out, etc... to allow different behaviours, like say insults get xxxed, and brandnames get traded....

What do you say?

WickeD

If wee just can get the script to work!  =)

//WickeD

pHaTTy

QuoteOriginally posted by WickeD
If wee just can get the script to work!  =)

//WickeD

lmao i will have a look it shud work tho.

and yep i been gonn add that soon

many tables so if someone says

fuck its replaced with cook

if someone says
i fuck then it will be 'im a cook'

as for not reged in userlist add

function Main()
          frmHub:RegBot(Bot)
end
Resistance is futile!

pHaTTy

sorry my stupid as mistake lmao i apoligdenot been in luafor a while at c++ atm

--//NaughtyASs Cook Bot by Phatty
--//Does things with words lol :p

checkbadword = 2

--checkadword nr's as follows:
--1 = blocks bad word
--2 = use word trader
--3 = censor bad words
--4 = space bad words

Bot = "!crazy"

 
badtable = {

["twat"]="bread",
["cunt"]="dish washer",
["bastard"]="cook-book",
["fucker"]="chief",
["fucking"]="cooking",
["fuck"]="cook",
["arsehole"]="microwave",
["arse"]="microchip",
["clit"]="tomato",
["cock"]="banana",
["tosser"]="baker",
["bitch"]="teaspoon",
["shit"]="mcdonald's manager",
["crap"]="chocolate",
["pissed"]="diluted",
["piss"]="orange juice",
["shagging"]="boiling",
["shag"]="sauce",
["cum"]="water",
["spunk"]="juice",
["asshole"]="fridge-freezer",
["ass"]="oven",
["slut"]="grape-fruit",
["dick"]="sausage",
["fanny"]="pie",
["whore"]="hotdog",
["wanker"]="i'm a wanker",
["slag"]="i'm a slag",

}


function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then
		--data=strsub(data,1,strlen(data)-1)--not needed
		--s,e,cmd = strfind(data,"%b<>%s+(%S+)")--not needed

		----------------------------------
		--## BadWord Check by Phatty ## --
		----------------------------------
		if checkbadword == 1 then
			for i,v in badtable do
				if strfind(data, i) then
				return 1
				end
			end
		elseif checkbadword == 2 then
			for i,v in badtable do
			    	data=gsub(data, i, v)
				--data, x,y = gsub(data, "%b"..i, v)
			end
		elseif checkbadword == 3 then
			for i,v in badtable do
			    	data=gsub(data, i, "*censored*")
			end
		elseif checkbadword == 4 then
			for i,v in badtable do
			    	data=gsub(data, i, "")
			end
		end
		SendToAll(data)
		return 1
	end
end
Resistance is futile!

WickeD

I can not get the script to work! It is regged in user list now!  But it do not work!

Why?

//WickeD

Guibs

Hi there,

Nice one, Phatty,, ;)
Maybe also posible,... to add the answer: ' you're ' (same idea as ' i'm ')
like, if user says:
> f***
then, script may answer:
> you're f***

lol

[Edit]
Erf,.... but then, maybe don't show the answer to all,...
It was just an idea.... let's see if you like it,, ;)
-- Please,... don\'t ask help in Pm,...Forums are made for that, to help everyone & my Inbox pm will be safe,... Thks,,  :))  --
CB forum     /     CB Home page

pHaTTy

ok nice one Guibs :))

--//NaughtyASs Cook Bot v1.05 by Phatty
--//Does things with words lol :p

checkbadword = 2

--checkadword nr's as follows:
--1 = blocks bad word
--2 = use word trader
--3 = censor bad words
--4 = space bad words
--5 = badboy setting

Bot = "!crazy"

 
badtable = {

["twat"]="bread",
["cunt"]="dish washer",
["bastard"]="cook-book",
["fucker"]="chief",
["fucking"]="cooking",
["fuck"]="cook",
["arsehole"]="microwave",
["arse"]="microchip",
["clit"]="tomato",
["cock"]="banana",
["tosser"]="baker",
["bitch"]="teaspoon",
["shit"]="mcdonald's manager",
["crap"]="chocolate",
["pissed"]="diluted",
["piss"]="orange juice",
["shagging"]="boiling",
["shag"]="sauce",
["cum"]="water",
["spunk"]="juice",
["asshole"]="fridge-freezer",
["ass"]="oven",
["slut"]="grape-fruit",
["dick"]="sausage",
["fanny"]="pie",
["whore"]="hotdog",
["wanker"]="i'm a wanker",
["slag"]="i'm a slag",

}


function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then
		--data=strsub(data,1,strlen(data)-1)--not needed
		--s,e,cmd = strfind(data,"%b<>%s+(%S+)")--not needed

		----------------------------------
		--## BadWord Check by Phatty ## --
		----------------------------------
		if checkbadword == 1 then
			for i,v in badtable do
				if strfind(data, i) then
				return 1
				end
			end
		elseif checkbadword == 2 then
			for i,v in badtable do
			    	data=gsub(data, i, v)
				--data, x,y = gsub(data, "%b"..i, v)
			end
		elseif checkbadword == 3 then
			for i,v in badtable do
			    	data=gsub(data, i, "*censored*")
			end
		elseif checkbadword == 4 then
			for i,v in badtable do
			    	data=gsub(data, i, "")
			end
		elseif checkbadword == 5 then
			for i,v in badtable do
			    	if strfind(data,i) then
					reply = Random(user)
					user:SendData(Bot,reply..i)
					return 1
				end 
			end
		end	
		SendToAll(data)
		return 1
	end
end

function Random(user)
	test = random(5)
		x1 = user.sName.." your a "
		x2 = user.sName.." you "
		x3 = user.sName.." haha you "
		x4 = user.sName.." is a "
		x5 = user.sName.." muhahahah you stupid, "
		dostring("ret=x"..test)
	return ret
end

enjoy ;)
Resistance is futile!

WickeD

Nice script and it works now!  =)

But all commands stop working in my hub when i added this script!

It checks all writing to mainchat!   Can you add in this script so when a user enter a word whit a  ! ore / ore +  infront of the word it is not checked by your script??

//WickeD

pHaTTy

well im not good with strsub but here an attemp

--//NaughtyASs Cook Bot v1.06 by Phatty
--//Does things with words lol :p

checkbadword = 2

--checkadword nr's as follows:
--1 = blocks bad word
--2 = use word trader
--3 = censor bad words
--4 = space bad words
--5 = badboy setting

Bot = "!crazy"

 
badtable = {

["twat"]="bread",
["cunt"]="dish washer",
["bastard"]="cook-book",
["fucker"]="chief",
["fucking"]="cooking",
["fuck"]="cook",
["arsehole"]="microwave",
["arse"]="microchip",
["clit"]="tomato",
["cock"]="banana",
["tosser"]="baker",
["bitch"]="teaspoon",
["shit"]="mcdonald's manager",
["crap"]="chocolate",
["pissed"]="diluted",
["piss"]="orange juice",
["shagging"]="boiling",
["shag"]="sauce",
["cum"]="water",
["spunk"]="juice",
["asshole"]="fridge-freezer",
["ass"]="oven",
["slut"]="grape-fruit",
["dick"]="sausage",
["fanny"]="pie",
["whore"]="hotdog",
["wanker"]="i'm a wanker",
["slag"]="i'm a slag",

}


function DataArrival(user,data)
	if not strsub(data,1,3) == "> !" then
		if strsub(data, 1, 1) == "<" then
			--data=strsub(data,1,strlen(data)-1)--not needed
			--s,e,cmd = strfind(data,"%b<>%s+(%S+)")--not needed
	
			----------------------------------
			--## BadWord Check by Phatty ## --
			----------------------------------
			if checkbadword == 1 then
				for i,v in badtable do
					if strfind(data, i) then
					return 1
					end
				end
			elseif checkbadword == 2 then
				for i,v in badtable do
				    	data=gsub(data, i, v)
					--data, x,y = gsub(data, "%b"..i, v)
				end
			elseif checkbadword == 3 then
				for i,v in badtable do
				    	data=gsub(data, i, "*censored*")
				end
			elseif checkbadword == 4 then
				for i,v in badtable do
				    	data=gsub(data, i, "")
				end
			elseif checkbadword == 5 then
				for i,v in badtable do
				    	if strfind(data,i) then
						reply = Random(user)
						user:SendData(Bot,reply..i)
						return 1
					end 
				end
			end	
			SendToAll(data)
			return 1
		end
	end
end
function Random(user)
	test = random(5)
		x1 = user.sName.." your a "
		x2 = user.sName.." you "
		x3 = user.sName.." haha you "
		x4 = user.sName.." is a "
		x5 = user.sName.." muhahahah you stupid, "
		dostring("ret=x"..test)
	return ret
end
Resistance is futile!

WickeD

Now your script don?t work at all!

Why?

//WickeD

pHaTTy

QuoteOriginally posted by WickeD
Now your script don?t work at all!

Why?

//WickeD

sorry im not goow ith strsub lmao
Resistance is futile!

Typhoon

love your work as usual Phatz, but weird part is that you script dies when i build it into my bot .. ? any ideas of how that can be fixed? or maybe what is causing it ?



kepp

Gsub is very cool indeed!!

function DataArrival(user, data)
	if strsub(data,1,1)=="<" then
		local s,e,t1,msg = strfind(data,"(%b<>)%s+(.*)")
		t1 = gsub(t1,t1,"-=-=-=["..user.sName.."]=-=-=-")
		SendToAll(""..t1.." "..msg) return 1
	end
end

TAKE NOTE!!!!!

NO SCRIPTS WILL WORK WITH THIS!!!
I was bored lastnight and tired of '<' nick '>'
Guarding    

plop

QuoteOriginally posted by Typhoon?
love your work as usual Phatz, but weird part is that you script dies when i build it into my bot .. ? any ideas of how that can be fixed? or maybe what is causing it ?
check really good where you insert it into your script.
it has 2 be after all commands, if not it's gone screw them all up.
this is also the answer 2 why this script can f*ck up all other scripts beside it.
the way 2 solve this is 2 make a bypase for every command syntax.

but anyway this is best inserted in a script package then 2 run it beside a lot of tiny scripts, much easyer 2 solve the conflicts on other scripts as they are in the same script.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

pHaTTy

if gonna use by itself then use it like

--//NaughtyASs Cook Bot v1.06 fixed by Phatty
--//Does things with words lol :p

checkbadword = 2

--checkadword nr's as follows:
--1 = blocks bad word
--2 = use word trader
--3 = censor bad words
--4 = space bad words
--5 = badboy setting

Bot = "!crazy"

 
badtable = {

["twat"]="bread",
["cunt"]="dish washer",
["bastard"]="cook-book",
["fucker"]="chief",
["fucking"]="cooking",
["fuck"]="cook",
["arsehole"]="microwave",
["arse"]="microchip",
["clit"]="tomato",
["cock"]="banana",
["tosser"]="baker",
["bitch"]="teaspoon",
["shit"]="mcdonald's manager",
["crap"]="chocolate",
["pissed"]="diluted",
["piss"]="orange juice",
["shagging"]="boiling",
["shag"]="sauce",
["cum"]="water",
["spunk"]="juice",
["asshole"]="fridge-freezer",
["ass"]="oven",
["slut"]="grape-fruit",
["dick"]="sausage",
["fanny"]="pie",
["whore"]="hotdog",
["wanker"]="i'm a wanker",
["slag"]="i'm a slag",

}


function DataArrival(user,data)
	if not strfind(data,"> !") then
		if strsub(data, 1, 1) == "<" then
			--data=strsub(data,1,strlen(data)-1)--not needed
			--s,e,cmd = strfind(data,"%b<>%s+(%S+)")--not needed
	
			----------------------------------
			--## BadWord Check by Phatty ## --
			----------------------------------
			if checkbadword == 1 then
				for i,v in badtable do
					if strfind(data, i) then
					return 1
					end
				end
			elseif checkbadword == 2 then
				for i,v in badtable do
				    	data=gsub(data, i, v)
					--data, x,y = gsub(data, "%b"..i, v)
				end
			elseif checkbadword == 3 then
				for i,v in badtable do
				    	data=gsub(data, i, "*censored*")
				end
			elseif checkbadword == 4 then
				for i,v in badtable do
				    	data=gsub(data, i, "")
				end
			elseif checkbadword == 5 then
				for i,v in badtable do
				    	if strfind(data,i) then
						reply = Random(user)
						user:SendData(Bot,reply..i)
						return 1
					end 
				end
			end	
			SendToAll(data)
			return 1
		end
	end
end
function Random(user)
	test = random(5)
		x1 = user.sName.." your a "
		x2 = user.sName.." you "
		x3 = user.sName.." haha you "
		x4 = user.sName.." is a "
		x5 = user.sName.." muhahahah you stupid, "
		dostring("ret=x"..test)
	return ret
end
Resistance is futile!

SMF spam blocked by CleanTalk