mIRC Homepage
Posted By: Doyley No Flood - 12/12/08 06:46 PM
Hi guys..

I'm pretty new to mirc script... probably a newb question.

I have the following script. Some idiots in the room I use it in think it's funny to trigger it over and over to get me autokicked. I would like a way to limit it to once per user every 5 minutes or something similar. Thanks.

Code:
on *:action:*slap*:#channel:{
  if %slaps == $null { set %slaps 0 }
  inc %slaps 1
  describe # slaps the slapper.
  /msg $chan Number of slappers slapped: %slaps
} 
Posted By: Wims Re: No Flood - 12/12/08 07:26 PM
Code:
on *:action:*slap*:#channel:{
if (!$hget(nslfl,$wildsite)) {
hadd -mu300 nslfl $wildsite 1
inc %slaps
describe # slaps the slapper.
msg $chan Number of slappers slapped: %slaps
 }
} 
This will allow an address (not a nick, because they will change their nick..) to trigger this each 5 minutes, the line that put %slaps to 0 was useless.
Posted By: Doyley Re: No Flood - 12/12/08 08:35 PM
Hey... thanks for your reply.

It doesn't seem to be working though, the same person can still trigger it within a few seconds. Is there a typo?

Thanks again.
Posted By: Wims Re: No Flood - 12/12/08 09:16 PM
ah ah, yes there is, i miss a '1' in the hadd command, it's edited
Posted By: DJ_Sol Re: No Flood - 13/12/08 08:13 AM
Code:
on *:action:*slap*:#channel:{
if (%slap. [ $+ [ $nick ] ]) { return }
set -u300 %slap. [ $+ [ $nick ] ] $true
  if %slaps == $null { set %slaps 0 }
  inc %slaps 1
  describe # slaps the slapper.
  /msg $chan Number of slappers slapped: %slaps
}


Use whatever address identifier you want instead of $nick.
Posted By: Doyley Re: No Flood - 13/12/08 06:20 PM
Thanks very much guys!!
© mIRC Discussion Forums