mIRC Home    About    Download    Register    News    Help

Print Thread
#18847 11/04/03 10:32 AM
Joined: Dec 2002
Posts: 124
B
bloupx Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Dec 2002
Posts: 124
would be nice to have the $timer identifier work with wildcards eg; $timer(whatever*,0)

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Make one >:F

Code:
; Wildcard timer
; Syntax: $cstimer(<wildcard>, [N])
; - wildcard - Value to match timer (Ex: *)
; - N - Nth match, or 0 for complete count of matches
; - N, when not specified, is 0
alias wctimer {
  if ($1 != $null) {
    if ($timer(0) > 0) {
      /set -u0 %timers 0
      /set -u0 %a 1
      while (%a <= $timer(0)) {
        if ($1 iswm $timer(%a)) {
          /inc -u0 %timers
          if (($2 != $null) && ($2 == %timers)) return $timer(%a)
        }
        /inc -u0 %a
      }
      return %timers
    }
    return 0
  }
  else /echo -s Missing Parameter: $wctimer(<wildcard>, [N])
}


-KingTomato

Link Copied to Clipboard