mIRC Home    About    Download    Register    News    Help

Print Thread
#130970 24/09/05 12:51 AM
Joined: Aug 2005
Posts: 25
E
enotsoc Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Aug 2005
Posts: 25
anyone know how to make a timer that would reset a variable every 24hr back to 0, i want to use it to keep track of how many urls were posted then reset on the 24hr and start fresh , but since i suffer from occassional disconnects would that interfere?

#130971 24/09/05 02:27 AM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
You can define an offline timer with the -o flag (/timer -o)


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#130972 24/09/05 09:37 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
/timer.url.counter.reset -o 17:35 0 86400 set %varname 0
/timer.url.counter.reset.once.off -o 17:35 1 0 set %varname 0

These both go of at 5:25pm aka 17:35 (so set that to what ever you want), the first then sets off a endless timer that goes off once every 24hours aka 86400 seconds, the second one is needed becuase the first one doesant go off when its 5:35pm the first time, but rather sets off a 86400 second delayed timer, so it goes off the next day, thus u need a once off timer to go off then and there as well.

#130973 24/09/05 11:46 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Quote:
5:25pm aka 17:35


I've always found that American system weird, but I didn't think it was that weird :tongue:

Code:
alias reseturlcounter {
  if ($time(HHnn) == 1735) {
    set %urlcounter 0
    .timer -o 1 80 .timer.urlresetcounter -o 17:35 1 1 reseturlcounter
  }
  else .timer.urlresetcounter -o 17:35 1 1 reseturlcounter
}
on *:START:reseturlcounter

#130974 24/09/05 01:12 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
24h clock system is a globaly used system, there is nothing country specific about its use. You just mainly see it in coding (to avoid to am/pm confusions) and military type implementations for the same reason.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#130975 24/09/05 10:48 PM
Joined: Feb 2004
Posts: 206
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
Quote:
24h clock system is a globaly used system, there is nothing country specific about its use. You just mainly see it in coding (to avoid to am/pm confusions) and military type implementations for the same reason.


I think what is meant is that 5:25 pm does not equate to 1735 (hours), but to 1725 (hours) !

Cheers,

DK


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
#130976 24/09/05 11:27 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
5:25pm aka 17:35


Typo

Your code seemed overly complex when simply two near identical timers would handle the job.

#130977 25/09/05 12:47 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
5:25pm aka 17:35, for large values of 5:25pm.

smile

#130978 25/09/05 07:29 AM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Haha, yeah i suppose i overlooked the obvious.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby

Link Copied to Clipboard