|
Joined: Jan 2005
Posts: 59
Babel fish
|
OP
Babel fish
Joined: Jan 2005
Posts: 59 |
ok i figure sincet i got the help on getting the code to wortk and it does i should start a new topic for this i would like to know if i can make some sort of .ini/mrc file for all the swear words because i have a large list that it wont take now here is the code for the warn/ban bot alias swear {
return [censored] [censored]
}
on @*:TEXT:*:#: {
if ($nick !isop #) {
var %i = 0
while (%i < $numtok(%swear.words,32)) {
inc %i
var %current.word = $gettok(%swear.words,%i,32) {
if ($istok($strip($1-),%current.word,32) == $true) {
set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
if (%rl. [ $+ [ $address($nick,2) ] ] == 1) {
notice $nick Please don't swear! - this is your first warning!
}
if (%rl. [ $+ [ $address($nick,2) ] ] == 2) {
notice $nick Please don't swear! - this is your second warning next time you will be banned!
}
if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) {
ban -k $chan $nick 2 Banned for $duration($duration(24 hrs)) --> $ifmatch <--
}
}
}
}
}
} all help is apreciated
Last edited by confuzzed; 13/01/05 08:39 AM.
|
|
|
|
Joined: Aug 2003
Posts: 314
Fjord artisan
|
Fjord artisan
Joined: Aug 2003
Posts: 314 |
If you think a text file would be easiest for you to handle the list of words in then you can use the following text event:
on @*:text:*:#:{
if ($nick !isop #) {
if ($read([color:brown]file.txt[/color],rn,/^(\Q $+ $replacecs($1-,\E,\E\\E\Q,$chr(32),\E|\Q) $+ \E)$/iS)) {
var %s = $+(%,$cid,$site,#)
inc -u3600 $(%s)
if ($(%s,2) < 3) .notice $nick Please don't swear! - $iif($v1 = 1,this is your first warning!,this is your second warning next time you will be banned!)
else ban -k # $nick 2 Banned for 1day
}
}
}
Change file.txt to the name/path of the file containing the swears, each swear on a new line
|
|
|
|
Joined: Jan 2005
Posts: 59
Babel fish
|
OP
Babel fish
Joined: Jan 2005
Posts: 59 |
theres no way for me to keep the code i have now and intergrate the .txt file in?
|
|
|
|
Joined: Jan 2005
Posts: 59
Babel fish
|
OP
Babel fish
Joined: Jan 2005
Posts: 59 |
|
|
|
|
Joined: Jan 2005
Posts: 59
Babel fish
|
OP
Babel fish
Joined: Jan 2005
Posts: 59 |
ok well i dont mean to triple post but i wanted to say i tried the code posted above but it did nothing and i mad a file.txt for it so i wouldnt have to goto the trouble of changeing that part of the code but it didnt do anything after swearing. and yes i added swear words to the file.txt file
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
I'm not sure whether this would work, like FiberOPtics I'm going to blame this on too many late nights. Put all the profanities on one line of the file swear.txt.
on @*:TEXT:*:#: {
if ($nick !isop #) {
var %i = 0
while (%i < $numtok($read(swear.txt,1),32)) {
inc %i
var %current.word = $gettok($read(swear.txt,1),%i,32) {
if ($istok($strip($1-),%current.word,32) == $true) {
set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
if (%rl. [ $+ [ $address($nick,2) ] ] == 1) {
notice $nick Please don't! - this is your first warning!
}
if (%rl. [ $+ [ $address($nick,2) ] ] == 2) {
notice $nick Please don't! - this is your second warning next time you will be banned!
}
if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) {
ban -k $chan $nick 2 Banned for $duration($duration(24 hrs)) --> $ifmatch <--
}
}
}
}
}
}
|
|
|
|
Joined: Jan 2005
Posts: 59
Babel fish
|
OP
Babel fish
Joined: Jan 2005
Posts: 59 |
YAY it worked *does happy dance* i realy appreciate it slade comes to save thew day agiain YAY works great man i still couldnt use my whole list but i got a good amount up there and alot more then i could befor and im happy YAY *bows befor o great mighty slade* YAY
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
You're welcome man lol..
|
|
|
|
Joined: Feb 2005
Posts: 1
Mostly harmless
|
Mostly harmless
Joined: Feb 2005
Posts: 1 |
I'm having kinda the same problem, but I want to kick a person also when he has more than 1 bad word in a sentense. example: when someone says: "Hello lame f*ckers", I want to kick the person, but only because he sayd "lame f*ckers", not only 'f*ckers' itself. I hope someone can help me Best Regards, Hendrik Edit: on @*:TEXT:*:#l: { if ($nick !isop #) { var %i = 0 while (%i < $numtok($read(words.txt,ii1),124)) { inc %i var %current.word = $gettok($read(words.txt,1),%i,124) { //echo -a %current.word if ($istok($strip($1-),%current.word,124) == $true) { /msg $chan fout! //echo -a %current.word var %cal2 = $readini(stats.ini, mainstats, %current.word) var %cal = $calc(%cal2 + 1) /writeini stats.ini mainstats %current.word %cal goto end } } } } :end } }
This is how i c/p your script you gave 2 posts up here (ty for that btw ), what do i have to edit to make it work like i want it to?
Last edited by Hendrik_; 01/02/05 01:38 PM.
|
|
|
|
Joined: Feb 2005
Posts: 40
Ameglian cow
|
Ameglian cow
Joined: Feb 2005
Posts: 40 |
I agree with the last post
..people who make scripts that ban people just for using swear words no matter the context just need to get a life.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
|
|
|
|
Joined: Nov 2004
Posts: 21
Ameglian cow
|
Ameglian cow
Joined: Nov 2004
Posts: 21 |
How can i make this code to work with wildcards example : *shi* *f*ck* ..etc on @*:TEXT:*:#: { if ($nick !isop #) { var %i = 0 while (%i < $numtok($read(swear.txt,1),32)) { inc %i var %current.word = $gettok($read(swear.txt,1),%i,32) { if ($istok($strip($1-),%current.word,32) == $true) { set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1) if (%rl. [ $+ [ $address($nick,2) ] ] == 1) { notice $nick Please don't! - this is your first warning! } if (%rl. [ $+ [ $address($nick,2) ] ] == 2) { notice $nick Please don't! - this is your second warning next time you will be banned! } if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) { ban -k $chan $nick 2 Banned for $duration($duration(24 hrs)) --> $ifmatch <-- } } } } } }
|
|
|
|
Joined: Apr 2005
Posts: 3
Self-satisified door
|
Self-satisified door
Joined: Apr 2005
Posts: 3 |
I'm not sure whether this would work, like FiberOPtics I'm going to blame this on too many late nights. Put all the profanities on one line of the file swear.txt.
on @*:TEXT:*:#: {
if ($nick !isop #) {
var %i = 0
while (%i < $numtok($read(swear.txt,1),32)) {
inc %i
var %current.word = $gettok($read(swear.txt,1),%i,32) {
if ($istok($strip($1-),%current.word,32) == $true) {
set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
if (%rl. [ $+ [ $address($nick,2) ] ] == 1) {
notice $nick Please don't! - this is your first warning!
}
if (%rl. [ $+ [ $address($nick,2) ] ] == 2) {
notice $nick Please don't! - this is your second warning next time you will be banned!
}
if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) {
ban -k $chan $nick 2 Banned for $duration($duration(24 hrs)) --> $ifmatch <--
}
}
}
}
}
}
My first post and my first search found exactly what i was looking for, .
Thanks for the great info!
Now, water can flow or it can crash. Be water, my friend. (Bruce Lee)
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
You're welcome. lol.
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
on $*:TEXT:/(lame|duck|shoot|dang|drats)/iS:#: if ($regml(0) > 1) ban -ku60 # $nick 2 U Sware 2 much!
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Sep 2005
Posts: 5
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Sep 2005
Posts: 5 |
i've searched and got this very fast. thnx Is there a way the i can use a type of *swearword* style of looking up? What i mean, lets say this is the swearword ---> dung now, without putting all the varaints of dung, like dungface, dunger etc. how can I pick up that swear word? Hope I explained it properly
|
|
|
|
Joined: Jul 2017
Posts: 2
Bowl of petunias
|
Bowl of petunias
Joined: Jul 2017
Posts: 2 |
one little problem line 4 * /while: '<' unknown operator (line 4, swear.mrc) not sure why it only posts as < but its '& l t ;'
Last edited by scoot; 28/07/17 07:39 PM.
|
|
|
|
Joined: Jan 2004
Posts: 2,127
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 2,127 |
the line should be in your script with the 1-character less-than symbol (alt-40) and not the 4-character html code beginning with the ampersand. I do not see an error in the code.
|
|
|
|
Joined: Jul 2017
Posts: 2
Bowl of petunias
|
Bowl of petunias
Joined: Jul 2017
Posts: 2 |
Ill take a look Thanks for the reply :)))
|
|
|
|
|