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
I am gona try it and see!
Thx a lot m8!!
//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
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?
If wee just can get the script to work! =)
//WickeD
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
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
I can not get the script to work! It is regged in user list now! But it do not work!
Why?
//WickeD
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,, ;)
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 ;)
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
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
Now your script don?t work at all!
Why?
//WickeD
QuoteOriginally posted by WickeD
Now your script don?t work at all!
Why?
//WickeD
sorry im not goow ith strsub lmao
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 ?
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 '>'
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
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