mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2003
Posts: 19
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Jun 2003
Posts: 19
HI

I am new to mIRC scripting and would appreciate any help in this issue.

I am an OP in a channel. I have scripted a profanity control script and it works fine. It will BAN / KICK the abuser (on the first offense) just fine. The only enhancement I like to make in this procedure is to only kick them for first offence but keep track and BAN/KICK them for second offence.

Thanks

sahmed01

Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
It would be helpful to see your code. Then suggestions can be made for changes.


I refuse to engage in a battle of wits with an unarmed person. wink
Joined: Jun 2003
Posts: 19
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Jun 2003
Posts: 19
Thanks for your quick reply. Here is the code I have..

Remote Code:
-----------

on *:text:*:#:{
if ( $istok($strip($1-),penis,32) || $istok($strip($1-),ass,32) || $istok($strip($1-),[censored],32) ) { /profanity }
}

Alias Code:
----------
/profanity {
if ( $me isop #SampleChan) { ban -u1200 #SampleChan $address($nick,4) | kick #SampleChan $nick PROFANITY detected. BANNING $nick for 10 minutes. }
}

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
On @$*:text:/\b(fawk|penis|ass)\b/iS:#:{
  • if $nick !isreg # { return }

    ; create a record for 10 minutes
    ; $site is the user's unique address
    hinc -mu600 swear $site
    var %level = $hget(swear,$site)
    if %level == 1 {
    kick # $nick Please don't swear.
    }
    elseif %level == 2 {
    ; kick + ban for 5 minutes
    ban -ku600 # $nick 2 You were warned
    }
}

Few things to note...
  • "isop" check is already done by the @ event prefix.
  • The $ prefix denotes that matchtext is a Regular Expression.
  • Incoming text is stripped by the S modifier.
  • Swear words are grouped by the () parentheses and are separated by the | pipe separator.
  • You may increase the record storage duration and add more level handlers (for example, 3 for autokick)

Joined: Jun 2003
Posts: 19
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Jun 2003
Posts: 19
Thanks for the reply.
your code

On @$*:text:/\b(fawk|penis|ass)\b/iS:#:{...

Wouldn't this also kick/ban if someone typed pen or as or faw?

Plus can you please explain each line of your code in some more detrail especially on text line

Thanks.
ps more solurions will be greatly appreciated

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi,

nope, the Regular Expression code that Online gave you will only match at those words, and those words only (case unsensitive).

Note that it wouldn't match on things like asswipe or penishead, but it would trigger to ass-wipe or penis-head. That's because he's using word boundaries \b in his code, and chars like - match word boundaries.

Greets


Gone.
Joined: Mar 2004
Posts: 130
T
Vogon poet
Offline
Vogon poet
T
Joined: Mar 2004
Posts: 130
yes you right but sahmed01 code was :

on *:text:*:#:{
if ( $istok($strip($1-),penis,32) || $istok($strip($1-),ass,32) || $istok($strip($1-),[censored],32) ) { /profanity }
}

;he is using istok and istok is only triggering if its equal to

of course if you want to kick for words like ass-wipe use:


on @*:TEXT:*:#:if ($regex($1-,fawk|penis|ass)) kick # $nick watch you words. }





Link Copied to Clipboard