mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 10
B
Bonnie Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Jan 2003
Posts: 10
Hi All
I'm trying to work out a script that will read a file/schedule and issue a command to trigger another script. I can make mIRC do that. The problem comes in trying to get the script to with in 30 seconds of the actual time needed. The command needs to be given at 59 minutes 30 seconds. I had it set up and repeating "timer 1 60" that sometime hit at 5 seconds and again at 57 seconds. Most of the time it was rendom seconds. Is there away for mIRC to alway know the time, read the schedule and send the command right on the mark? I have looked at $time and gmt. They would work if there was a way for mIRC to read the time all that time. I real need any ideas or help on this. Thank you all
Bonnie

Joined: Dec 2002
Posts: 332
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
not really sure what your askin but perhaps look into $ctime

Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Would something like this be of use?

from the help file:

(/help Timers)

[help]
If you specify the -m or -h switch, this indicates that the interval delay is in milliseconds.

Note: The -h switch creates a high-resolution multimedia timer. This type of timer should only be used in critical timer situations since it uses system resources heavily.
[/help]

Don't know if it's of any use, I don't even know what they are for/how they work/how much more system resources they use. I suppose they are supposed to be more "acurate"?

Last edited by Aubs; 14/02/03 01:30 PM.

Aubs.
cool

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
/timer does have a [time] parameter which allows you set a specific time for the timer to start running. So for instance /timer 15:59 1 30 echo -a moo would mean that mIRC waited until 15:59 and then started the timer, so after another 30 seconds it echoed 'moo' to the active window. Using this and some $asctime calculations you can make a timer to go off every hour within a second of the specified time. I think you wanted it to go off every hour at xx:59:30, so that's what I did here:
Code:
alias hourly {
  if ($1 == off) {
    timerhourly off
    halt
  }
  var %hours = $asctime(HH)
  timerhourly $+($iif($regex($asctime(nn:ss),/^59:[2-5][0-9]$/),$iif(%hours == 23,00,$calc(%hours + 1)),%hours),:59) 1 30 hourly
  if ($1 != on) {
    ####commands here####
  }
}

Just use /hourly on to start the timer and /hourly off to stop it. I haven't fully tested the alias but it should work fine. There might also be an easier way to do this, I haven't even looked at most of /timer's switches.


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard