mIRC Homepage

not working properly

Posted By: Garou

not working properly - 04/12/06 04:02 AM

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 } }}
Posted By: Mardeg

Re: not working properly - 04/12/06 10:56 AM

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
Posted By: Sais

Re: not working properly - 04/12/06 11:40 AM

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 
    } 
  }
}
Posted By: Garou

Re: not working properly - 04/12/06 01:48 PM

Ok thx guys I will test it out.
© 2021 mIRC Discussion Forums