mIRC Home    About    Download    Register    News    Help

Print Thread
not working properly #165951 04/12/06 04:02 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
This script should kban when I get channel invited or channel advertise in my pm from outside the channel I am in. Its supose to find and kban matching nick or ip in my channel. Any ideal where the error is?

on *:text:*:?: { var %s.chan = #chat if ($nick !ison %s.chan && $me isop %s.chan) { var %nick.addr = $address($nick,2) var %cnt = $nick(%s.chan,0) while (%cnt) { if ($address($nick(%s.chan,%cnt),2) == %nick.addr) { ban -ku3600 %s.chan $nick(%s.chan,%cnt) 2 Relay Spammer Detected } dec %cnt } }}

Last edited by Garou; 04/12/06 04:03 AM.
Re: not working properly #165952 04/12/06 10:56 AM
Joined: Oct 2004
Posts: 73
M
Mardeg Offline
Babel fish
Offline
Babel fish
M
Joined: Oct 2004
Posts: 73
the $address() identifier I believe is only valid for a user that is currently in a channel you are in, so if they are in none of the same channels as you that identifier will return null

Re: not working properly #165953 04/12/06 11:40 AM
Joined: Oct 2003
Posts: 313
S
Sais Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
That would be correct. $address will hold the [email]userid@host[/email] part, and $fulladdress will hold the full nick!userid@host.

You can then use $mask (qv) to do the masking of the $fulladdress: $mask($fulladdress,2)

I assume that you have each command on a separate line, too, rather than all on the one line:

Code:
on *:text:*:?: {
  var %s.chan = #chat 
  if ($nick !ison %s.chan && $me isop %s.chan) {
    var %nick.addr = $mask($fulladdress,2)
    var %cnt = $nick(%s.chan,0) 
    while (%cnt) {
      if ($address($nick(%s.chan,%cnt),2) == %nick.addr) {
        ban -ku3600 %s.chan $nick(%s.chan,%cnt) 2 Relay Spammer Detected 
      } 
      dec %cnt 
    } 
  }
}


Sais
Re: not working properly #165954 04/12/06 01:48 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Ok thx guys I will test it out.