This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How can i exclude channels and use the badword in a sentence

Old posts that have not been replied to for several years.
Locked
Q
Questor

How can i exclude channels and use the badword in a sentence

Post by Questor »

Hi there,

i've been able to get the following script working for identifying badword. The only thing i can't seem to get working is how to have this badword check been excluded from other channels. For instance this script should run in Cybercafe and 30+ but not in Sexroom:

What i also would like to do is be able to have the badword in a string so that when the bot reply's: That's quite a naughty word, it also mentions the badword so the sentence would be like: $badword , that's quite a naughty word. I know $n is showing me the badword but it still shows the * that are around the badword.

Who can help me... My script is a s follows:

set badword {
lul
"lul *"
"* lul"
"* lul *"
}
bind pubm - * checkword
proc checkword {nick uhost handle chan text} {
global badword
if (![matchattr $nick +o]) {
foreach n $badword {
if ([string match $n [string tolower $text]]) {
putlog "$nick said bad word in $chan - $n"
putserv "PRIVMSG $chan :\001ACTION says: That's quite a naughty word \001"
return 0
}
}
}
}
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

to exclude it from channels you could make a list and then do a check each time something is said and check if it is a chan you want it to be excluded from... but intstead you could just add a

Code: Select all

bind pubm - "#chan1 *" checkword 
bind pubm - "#chan2 *" checkword
etc... then you specify which channels you want it to monitor.

to get the bad word I would use lsearch instead of string match, when doing lsearch you get the position of the first matching variable in a list, this way you could just pull out the word by using lindex
Elen sila lúmenn' omentielvo
Locked