mIRC Home    About    Download    Register    News    Help

Print Thread
#79056 12/04/04 10:03 PM
Joined: Mar 2004
Posts: 111
Z
Zeusbwr Offline OP
Vogon poet
OP Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
ok, i got a few questions for a few dif applications.

1. is it possible to flag or something a timer to have a name and still a number? like if you do 5 "/timerwoo"'s only 1 is active, you just keep updating "timer woo". is their a flag or something to go say "/timerwoo" 5 times and have it go "timer woo1, woo2, woo3, woo4, woo5" ?

2. Is it possible to gather information on a timer? like if i did "/timerwoo 5000 10 echo heh" is their a way i can monitor how many ticks it has left? without having the timer do an alias and count down a %var i mean.

3. assuming there isnt a way to make timers with names increase (wihout having to tag on a increasing %var if say woo or woo1 exists), how can i track a timer that is just created? now just by thinking logically i dont really see any way of this being done, but who knows lol. say in an alias i made a timer such as..
Code:
 
alias bleh {
timer 10 10 someotheralias
}
 

now is their a way to see what number that timer is assigned? ie if i have 10 timers running, (timer 1, 2, 3, 4 (ect..)) that one is assigned to timer "11". is their any way of knowing this? and a way that works 100% of the time, only way i know of is (prob dont even work) some type of raw ro something catching the message the user sees when a timer is created then noting which timer it is. Anyway, thanks smile

#79057 12/04/04 10:09 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
1) you'd have to do /timerwooN (where N is a number - mirc wont automatically do it for you) UNLESS you DONT name it in which case mirc will do this:

/timer 1 60 //echo blah
/timer 1 60 //echo blah
/timer 1 60 //echo blah
/timer 1 60 //echo blah
/timer 1 60 //echo blah

Shows in mirc's status screen (if you're in that window):

* Timer 1 1 time(s) 60s delay //echo blah
* Timer 2 1 time(s) 60s delay //echo blah
* Timer 3 1 time(s) 60s delay //echo blah
* Timer 4 1 time(s) 60s delay //echo blah
* Timer 5 1 time(s) 60s delay //echo blah


2) /help $timer - Using the $timer identifyer, you can do:

//echo $timer(N).secs - where N is a timer number
//echo $timer(NAME).secs - where NAME is a timer's name

3) not sure what you mean specifically, /timers would show all active timers


Hope the above helps


Those who fail history are doomed to repeat it
#79058 12/04/04 10:41 PM
Joined: Mar 2004
Posts: 111
Z
Zeusbwr Offline OP
Vogon poet
OP Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
by 3 i mean, ok, say i create a timer, ie "/timer 1 100 blah", now how can i make a script know which timer it is? so i can like set it to a %var and have another script monitor it. Otherwise the script wont know which # the timer is under. see what i mean?

#79059 12/04/04 10:43 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
1. No, but you could script it by looping through $timer() like so:
Code:
alias next_timer {
  ; Usage: $next_timer(name)
  if ($1 == $null) return
  var %i = 1, %num = 1
  while $timer(%i) != $null {
    if ($regex(nt, $ifmatch, /^ $+ $replace($1,\,\\,.,\.,?,\?,+,\+,[,\[) $+ (\d+)/i)) && ($regml(nt, 1) >= %num) %num = $calc($ifmatch + 1)
    inc %i
  }
  return %num
}


2. $timer()

3. $ltimer


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#79060 12/04/04 11:43 PM
Joined: Mar 2004
Posts: 111
Z
Zeusbwr Offline OP
Vogon poet
OP Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
ah ty smile, ya i knew i could do a loop i was just hoping their would be something simpler lol, like a good ol flag lol.


*edit* btw, regex scares the f00k out of me! lol. is regex more effective than doing a loop just doing like (roughly)
Code:
next_timer {
if ($1 == $null) halt
var %i = 1
while $timer($1 $+ %i) != $null {
inc %i
}
return $1 $+ %i
}
 

Last edited by Zeusbwr; 13/04/04 12:03 AM.
#79061 13/04/04 01:54 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Actually your method is a lot better than my one.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#79062 13/04/04 02:01 AM
Joined: Mar 2004
Posts: 111
Z
Zeusbwr Offline OP
Vogon poet
OP Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
ah k, ty smile


Link Copied to Clipboard