mIRC Home    About    Download    Register    News    Help

Print Thread
#84869 01/06/04 05:06 PM
Joined: Jun 2003
Posts: 19
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Jun 2003
Posts: 19
Hi

Here is what I have in my script

on *:text:*:*:{
if (penis isin $1-) {
if ($nick !isop # ) {
.kick # $nick Abuse detected | break } }

The problem is that it also kicks whoever types pen. How do I fix it so it compares the whole word in $1-

Thanks in advance

Sahmed01




Joined: Mar 2003
Posts: 160
Vogon poet
Offline
Vogon poet
Joined: Mar 2003
Posts: 160
on 1:TEXT:penis*:#: if ($me isop $chan) && ($chan == #yourchanhere) { .kick # $nick Abuse detected }

that post made me chuckle a bit grin

Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
You can also use this one:

on *:text:*penis*:#:{
if ($me isop $chan) {
kick # $nick Abuse detected
}
}


wink


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
Joined: Dec 2002
Posts: 124
B
Vogon poet
Offline
Vogon poet
B
Joined: Dec 2002
Posts: 124
on *:TEXT:*:#:if ($istok($1-,penis,32)) .raw kick # $nick :abuse detected.

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
on @*:TEXT:*penis*:#yourchannel: .kick # $nick Abuse detected

The @ replaces the if ($me isop $chan) and the channel is put in the trigger.

Problem is that there might be some words like blahpenisblah that are ok, and it will kick those too. Using regex:

on $@*:TEXT:m/\Wpenis\W/Si:#yourchannel: .kick # $nick Abuse detected

or for other words also (find a guide on regex)
on $@*:TEXT:m/\W(?:penis|nasty|vagina)\W/Si:#yourchannel: .kick # $nick Abuse detected

Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Just want to notice you Kelder that your script dont wort this way:

penis bla bla

bla bla penis

It only works this way:

bla penis bla


Just wanted to make a notice! Dont know how to fix it sorry


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
blush you're right, \W does not match end or start blush

This should do it...
on $@*:TEXT:m/(?<!\w)penis(?!\w)/Si:#yourchannel: .kick # $nick Abuse detected

For multiple words: replace penis with (?:word1|word2|word3)
If you also want to have the word itself use (word1|word2|word3) and you have the offending word in $regml(1)

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Better would be \b (word boundary)
  • on $@*:text:/\bpenis\b/Si:#yourchanhere:kick # $nick Abuse detected!

Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
nice Kelder it workes fine now wink


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Well firstly you got it backwards.
if pen isin $1- <- would match if someone typed penis
  • if $istok($1-,<word>,32) { commands }
    where 32 refers to space (ascii character 32)


on @*:text:*:#:{
  • if $nick isop # { return }
    if $istok($strip($1-),penis,32) { kick # $nick Abuse detected }
    elseif $istok($strip($1-),abuse,32) { kick # $nick Abuse detected }
    elseif $istok($strip($1-),more,32) { kick # $nick Abuse detected }
}

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
that looks too easy, can't be good :tongue:


OK I'm apparently having some sickness where I completely overlook the obvious stuff frown


Link Copied to Clipboard