PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: pHaTTy on 02 March, 2004, 01:27:17

Title: NaughtyASs by Phatty (gsub bot)
Post by: pHaTTy on 02 March, 2004, 01:27:17
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

Title: Nice!!!! =)
Post by: WickeD on 02 March, 2004, 13:41:58
I am gona try it and see!  
Thx a lot m8!!


//WickeD
Title: Hi (uk-kingdom)pH?tt? !!!
Post by: WickeD on 02 March, 2004, 14:47:06
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
Title:
Post by: yepyepyep4711 on 02 March, 2004, 16:13:14
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?
Title: Nice idea! =)
Post by: WickeD on 02 March, 2004, 16:16:08
If wee just can get the script to work!  =)

//WickeD
Title:
Post by: pHaTTy on 02 March, 2004, 16:25:19
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
Title:
Post by: pHaTTy on 02 March, 2004, 16:32:55
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

Title: Hi (uk-kingdom)pH?tt? !!!
Post by: WickeD on 02 March, 2004, 16:36:38
I can not get the script to work! It is regged in user list now!  But it do not work!

Why?

//WickeD
Title:
Post by: Guibs on 02 March, 2004, 16:37:50
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,, ;)
Title:
Post by: pHaTTy on 02 March, 2004, 16:57:59
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 ;)
Title: Hi...pH?tt?!
Post by: WickeD on 02 March, 2004, 17:43:24
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
Title:
Post by: pHaTTy on 02 March, 2004, 18:04:33
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
Title: Hi (uk-kingdom)pH?tt? !!!
Post by: WickeD on 02 March, 2004, 18:43:44
Now your script don?t work at all!

Why?

//WickeD
Title:
Post by: pHaTTy on 02 March, 2004, 18:48:39
QuoteOriginally posted by WickeD
Now your script don?t work at all!

Why?

//WickeD

sorry im not goow ith strsub lmao
Title:
Post by: Typhoon on 03 March, 2004, 19:27:28
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 ?
Title:
Post by: kepp on 03 March, 2004, 20:00:06
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 '>'
Title:
Post by: plop on 07 March, 2004, 19:53:55
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
Title:
Post by: pHaTTy on 07 March, 2004, 20:03:33
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