mIRC Home    About    Download    Register    News    Help

Print Thread
#190610 23/11/07 10:41 AM
Joined: Jun 2006
Posts: 79
B
Babel fish
OP Offline
Babel fish
B
Joined: Jun 2006
Posts: 79
Code:
on ^!@*:text:*:?: { 
  if ($nick isreg #) { 
    if ($regex($1-,/\b(fuck|suck|shit|bitch)\b/i)) {
      !kick # $nick swearing on private
      .ban # $nick 2
    }
  }
}
 


its not work. Is it replace # with $comchan ? or ? .. thanks

Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Code:
if ($comchan($nick, 0) > 0) {


Then kicked and ban on a loop.

That being said, '@' won't be a trigger level for a private message, so you'll have to check if you are isop on the $comchan()'s.

Joined: Jun 2006
Posts: 79
B
Babel fish
OP Offline
Babel fish
B
Joined: Jun 2006
Posts: 79
Code:
 

on ^!*:text:*:#: { 
  if ($nick isreg #) && ($me isop #) { 
    if ($regex($1-,/\b(fuck|suck|shit|bitch)\b/i)) {
      if ($comchan($nick, 0) > 0) {
        !kick # $nick swearing on private
        .ban # $nick 2
      }
    }
  }
}



like this ?

Joined: May 2007
Posts: 89
T
Babel fish
Offline
Babel fish
T
Joined: May 2007
Posts: 89
No, the condition Bekar gave you is to check whether you are on atleast a channel in common with the user who triggered the event.

The next step would be to verify if you are opped on one of these common channels and then proceed to kick/ban the latter.

Here's an example:

Code:
; Notice here the usage of the '$' dollar sign which then
; permits to make regex matches directly in the event declaration.
; I've also replaced 'fuck|suck' with '[fs]uck'
; Ah, almost forgot it. The /S modifier is to strip the
; text ($1-) received before searching.

On ^$!*:Text:/\b([fs]uck|shit|bitch)\b/iS:?:{

  ; Here's Bekar's condition. Very useful :)
  If ($comchan($nick,0) > 0) {
    Var %t = $v1 , %n = $nick

    ; Now we loop on the number of common channels with $nick
    While %t {
      Var %ch = $comchan(%n,%t)

      ; And if we find a common channel where we are opped
      If (%n isreg %ch) && ($me isop %ch) {

        ; then kick/ban
        KICK %ch %n swearing on private
        Ban %ch %n 2
        Break
      }
      Dec %t
    }
  }
}


Voila smile

Cordialement

Last edited by TropNul; 23/11/07 02:02 PM.

tropnul
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
Originally Posted By: Tropnul
KICK %ch %n swearing on private
Ban %ch %n 2
You should use ban -k %ch %n 2 swearing on private


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard