Username:
Password:
  Home About Us Articles Rules Script Library FAQ Help
Not logged in (register
Simple floodprotection for mIRC
By: Rhodry

Last Modified: Oct 13 12:02am

Well.... quite simple, basically returns $true or $false depending on the arguments that were used.

Example:
on *:!kill &:#:{
if ($flpr(kill,$address($nick,3),2,3600)) {
if ($2 == $me) describe $chan shoots $nick
else describe $chan exterminates $nick
}
}

This would allow a person to use this command twice in one hour.
; Syntax: $flpr(id,nick/hostmask,max triggers in time,time)
; Return: $true or $false
;
; Standard examples
;
; on *:text:!beer:#chan:if ($flpr(beer,$address($nick,3),2,3600)) describe $chan gives $nick a beer
;
; Result: allows the person to trigger the give beer thing twice per hour from his hostname
;
; WARNING: Currently doesn't check for invalid input
;

alias flpr {
  if (!$hget(floodprotection)) {
    hmake floodprotection 150
  }

  var %entry $+($1,/,$2)
  var %time = $hget(floodprotection,%entry)
  var %step = $4 / $3

  if (%time) {
    if (%time < $calc($ctime - $4)) {
      hadd floodprotection %entry $calc($ctime - $4 + 2 * %step)
      return $true
    }
    if (%time >= $calc($ctime - $4) && %time < $ctime) {
      hadd floodprotection %entry $calc(%time + %step)
      return $true
    }
    return $false
  }
  else {
    hadd floodprotection %entry $calc($ctime - $4 + 2 * %step)
    return $true
  }
}

Comments
 
All content Copyright © 2004 - 2008 UtoNet IRC Network
UtoNet is sponsored and hosted by Datinix Systems