mIRC Home    About    Download    Register    News    Help

Print Thread
#41720 14/08/03 07:27 AM
Joined: May 2003
Posts: 2,265
P
pheonix Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
on *:TIME:[s,n,h]:{
on *:TIME:s:{
event occurs when time changes in seconds.
on *:TIME:n:{
event occurs when time changes in minutes.
on *:TIME:h:{
event occurs when time changes in hours.


new username: tidy_trax
#41721 14/08/03 11:28 AM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
The wonderful world of signals, they have a million uses... smile
Code:
on *:start:{ enable_time_event }
alias enable_time_event { .timer -m 0 500 chktime }
alias chktime {
  var %hh $asctime(hh) | var %nn $asctime(nn) | var %ss $asctime(ss)
  if (%last-hh == $null) { set %last-hh %hh }
  if (%last-nn == $null) { set %last-nn %nn }
  if (%last-ss == $null) { set %last-ss %ss }
  if (%last-hh != %hh) { .signal -n TIME-HOURS-CHANGE }
  if (%last-nn != %nn) { .signal -n TIME-MINUTES-CHANGE }
  if (%last-ss != %ss) { .signal -n TIME-SECONDS-CHANGE }
  set %last-hh %hh
  set %last-nn %nn
  set %last-ss %ss
}
on *:signal:TIME-HOURS-CHANGE:{ echo -a New Hour }
on *:signal:TIME-MINUTES-CHANGE:{ echo -a New Minute }
on *:signal:TIME-SECONDS-CHANGE:{ echo -a New Second }


NaquadaBomb
www.mirc-dll.com
#41722 14/08/03 11:35 AM
Joined: May 2003
Posts: 2,265
P
pheonix Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i posted here because its feature suggestion, i know it can be scripted but i dont want to use a laggy timer....
thanx anyway :tongue:


new username: tidy_trax
#41723 15/08/03 05:18 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Then use a high resolution or multimedia timer.

#41724 16/08/03 01:33 PM
Joined: May 2003
Posts: 177
P
Vogon poet
Offline
Vogon poet
P
Joined: May 2003
Posts: 177
Quote:

Then use a high resolution or multimedia timer.


Multimedia timers use more system resources than standard timers, therefore, it will be even more laggy!


Quote from the mIRC help file:

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.


#41725 16/08/03 04:18 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Yeah what's your point? To implement ON TIME mIRC is going to HAVE TO create a high resolution timer anyway! How else will mIRC know when the time changes? It can only figure it out by using a timer. And to ensure accuracy, the delay of the timer has to be less than the smallest change of the clock, which means the timer has to have a delay of less than a second which requires a high resolution timer. So ON TIME would basically be mIRC just triggers an ON TIME even each time the time changes as detected by the high resolution timer. So basically it would be SLOWER than just using a high resolution timer yourself.

#41726 16/08/03 05:12 PM
Joined: Dec 2002
Posts: 117
R
Vogon poet
Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
But mIRC could use one timer for all ON TIME events in all loaded scripts, instead of all scripts running one timer (or a lot of timers if they are coded the easy way)


$input(Me like stars, You too?)
#41727 16/08/03 09:04 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
It could be replicated using a single high-res timer and signals for those who wanted it. It just seems 'messy' for it to be a built-in event. I mean, would the timer always be running even if you had no 'on TIME' events? Or would mIRC check for the presence of an 'on TIME' event before creating the timer and then constantly monitor for the presence of one? Both ways seem pretty wasteful, especially for something provided just for convenience.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#41728 21/08/03 05:15 PM
Joined: Dec 2002
Posts: 30
A
Ameglian cow
Offline
Ameglian cow
A
Joined: Dec 2002
Posts: 30
Good Idea with the signal code though!


Link Copied to Clipboard