mIRC Home    About    Download    Register    News    Help

Print Thread
#132538 11/10/05 01:40 PM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
hello
i'm trying to make some kind of notice blocker for messages that repeat more then once (to stop spamming and annoying repeated messages)

here's the script i thougt of, only that it doesn't work smile cand anyone tell me why?
Code:
on *:NOTICE:*:*:{
  if (%repeatednotice == $null) set %repeatednotice $1-
  elseif ($1- == %repeatednotice) {
   ; 2 echos for testing purposes only to see whether  this loop executes
   ; they can and will be deleted after code turns out ok ;)
    echo -a xxx $+ 4 $+ %repeatednotice
    echo -a xxx $+ 7 $+ $1-
    halt
  }
  else set %repeatednotice $1-
}


thank you.

#132539 11/10/05 02:26 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Code:
on ^*:notice:*:*: {
  if ($1- == %repeatednotice) {
    haltdef
  }
  else set %repeatednotice $1-
}


Try that. It should prevent 2+ consecutive repeated notices. It won't prevent a repeated notice that has some other notice between the repeats:

-Bot- Hello
-Bot2- Bye
-Bot- Hello

(The second Hello wouldn't be blocked because of the Bot2 message in the middle)

Remember that to haltdef text, you need to use ^ or it won't halt.


Invision Support
#Invision on irc.irchighway.net
#132540 11/10/05 02:33 PM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
thanks a lot. i didn't know about that.

#132541 11/10/05 02:37 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
No problem. laugh

Also, just as an explanation, I removed the $null part because it isn't needed. If it's $null, then it isn't a repeated notice and it will go through the ELSE and get set. smile


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard