mIRC Home    About    Download    Register    News    Help

Print Thread
#29119 11/06/03 05:25 AM
Joined: Feb 2003
Posts: 67
N
Naz Offline OP
Babel fish
OP Offline
Babel fish
N
Joined: Feb 2003
Posts: 67
The following code is meant to check for blacklisted addresses when I join a channel and get opped. It works great when I get opped with a "@" prefix (mode +o) but it does not work when I get opped with a "!" prefix (mode +a).

It works fine if I run manually after I join ( /bh.opscan) with either nick prefix, so I tried putting it on a timer. Still won't work.

Any suggestions are appreciated.

Code:
on *:rawmode:%bh.chan: { 
  if ((($1 == +a) || ($1 == +o)) && ($2 == $me)) {
    if ($hget(blackhash, bh.autoscan) == 1) { bh.opscan }
  }
}


alias bh.opscan {
  var %chan = $chan, %num = 0, %checked = 0, %y = $nick(%chan,0,a,!@)
  echo -a 10,1 BlackHash is scanning for blacklisted users in8 %chan $+ 10... 
  while %y {
    var %bl.taddress = $address($nick(%chan,%y,a,!@),5)
    if $hfind(blacklist, %bl.taddress, 1, W) {
      var %bl.address = $hfind(blacklist, %bl.taddress, 1, W), %bl.reason = $gettok($hget(blacklist, %bl.address),1,59)
      if ($gettok($hget(blacklist, %bl.address),2,59) == $null) {
        echo $chan 4,1 Blacklisted user, kickbanning... 
        ban -u $+ $hget(blackhash, bl.secs) $chan %bl.address | kick %chan $nick(%chan,%y,a,!@) %bl.reason
        if ($hget(blackhash, bl.ignore) == 1) { /.ignore -u $+ $hget(blackhash, bl.secs) %bl.address }
      }
      else {
        var %z = $gettok($hget(blacklist, %bl.address),2,59)
        if $istok(%z,%chan,44) { 
          ban -u $+ $hget(blackhash, bl.secs) $chan %bl.address | kick %chan $nick(%chan,%y,a,!@) %bl.reason
          if ($hget(blackhash, bl.ignore) == 1) { /.ignore -u $+ $hget(blackhash, bl.secs) %bl.address }
        }
      }
      inc %num
    }
    dec %y | inc %checked
  }
  echo -a 10,1 Checked9 %checked 10users, found9 %num 
}

  


Those who live by the sword get shot by those who don't.
#29120 11/06/03 07:53 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
What does your on JOIN statement looking like?


--------
mIRC - fun for all the family (except grandma and grandpa)
#29121 11/06/03 12:56 PM
Joined: Feb 2003
Posts: 67
N
Naz Offline OP
Babel fish
OP Offline
Babel fish
N
Joined: Feb 2003
Posts: 67
If you are reffering to when a user joins, that event gets directed to another alias. This alias runs when I join a channel and subsequently get opped. The rawmode event detects when I've been opped with either mode +a or +o [ I did it that way because "on *:op: #:" does not detect when I am opped with a '!' (mode +a) ]

Once I'm opped the alias cycles through every non-opped users address looking for a match and acting on those it finds.


Those who live by the sword get shot by those who don't.
#29122 11/06/03 04:39 PM
Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
maybe: if (*a* iswm $1-) || (*o* iswm $1-)
works better?


If it ain't broken, don't fix it!

Link Copied to Clipboard