mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2003
Posts: 42
Demarko Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Sep 2003
Posts: 42
Hi,

Im again stuck with a very simple problem. blush

I have a timer function
Quote:
/timer $+ $time 1 $1 $2-
where $1 is the time delay in seconds and $2- is the action command to be executed

Now what I want to do is to make a simple /echo -s ... which will tell me the time the timer will be executed.

For example, when typing
Quote:
/timerTest 1 600 /echo -s Take a break!
at 12:00:00, the /echo command should look something like this
Quote:
Take a break @ 12:10:00

Sounds simple, but still I had no luck getting this to work with all those cmds I found in the help file; I think I tried it all, like $ctime $asctime $duration $gmt $calc etc.



Only thing I got to work is
Quote:
/echo -s $asctime( $calc( ($calc($ctime + 600)) - $ctime()))
but this will show me the full date in the following form
Quote:
Sun Feb 23 12:10:00 2014
and I have no idea how to get the time from it. confused


Hope someone here can help me quickly with this.
Many Thanks in advance! smile


P.S: Im using an old mirc version 6.35


Joined: Dec 2010
Posts: 89
D
Babel fish
Offline
Babel fish
D
Joined: Dec 2010
Posts: 89
Is this what your looking for?
Quote:
/echo -s $time( $calc( ($calc($ctime + 600)) - $ctime()))

It's pretty much your previous script but with $time instead of $asctime
smile

Joined: Feb 2006
Posts: 181
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2006
Posts: 181
Code:
alias test_timer {
  ;$1 = timer name
  var %t = $iif($1 != $null,$1,Test)
  if (!$timer(%t)) .timer $+ %t 1 600 echo -s Take a break!
  ;$asctime(N,format) -> N = $calc(), format = HH:nn:ss
  $timer(%t).com @ $asctime($calc($ctime + $timer(%t).secs),HH:nn:ss)
}


/help $asctime
/help $timer (properties)

Joined: Sep 2003
Posts: 42
Demarko Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Sep 2003
Posts: 42
Yeah, that will do it. Thanks to both of you! smile smile


Link Copied to Clipboard