mIRC Home    About    Download    Register    News    Help

Print Thread
#218925 28/02/10 03:16 AM
Joined: Jan 2009
Posts: 116
K
Knoeki Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Jan 2009
Posts: 116
It'd be nice, if not already possible (I haven't seen anything about it) if we could reference timers based on a wildcard. I suck at explaing it like this, so let me show examples:

$timer(bla.*, 0) - would return the number of timers that match bla.*
$timer(bla.*, 1) - would return info for the first timer matching bla.*

I hope I'm not overlooking this if it's in the manual...

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
This makes sense to me.

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Sounds good to me. With a lot of timers, this can make it easier to check specific ones when testing scripts.

Joined: Oct 2003
Posts: 3,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
Until it's added (if it's added), you can do:

Code:
alias wtimer {
  var %i = 1, %n = 0
  while ($timer(%i)) {
    var %timer = $v1
    if ($1 iswm %timer) { 
      inc %n
      if ($2 == %n) return %timer
    }
    inc %i
  }
  if ($2 == 0) return %n
}


//echo -a $wtimer(bla.*, 0)
//echo -a $wtimer(bla.*, 1)

Not likely to have any real performance issues unless you have hundreds of timers running (which is likely to be a performance issue in itself).


Link Copied to Clipboard