mIRC Home    About    Download    Register    News    Help

Print Thread
/timer [time] bug? #236491 29/02/12 06:18 PM
Joined: Feb 2012
Posts: 8
A
Andulien Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Feb 2012
Posts: 8
I'm not sure if this might be a bug or a feature request, please move this topic if so.

I tried to use for my countdown script the /timer with the time of activation option. This option only takes minutes but not seconds. Would it be possible to include seconds as time of activation instead of just minutes?

Thanks.

Re: /timer [time] bug? [Re: Andulien] #236495 29/02/12 08:03 PM
Joined: Jul 2006
Posts: 3,764
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,764
Certainly not a bug, I guess being able to specify second here wouldn't hurt but the actual way of doing this is to use the 'delay' parameter of timer:

/timer 20:00 1 30 echo -a it's 20:00:30


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /timer [time] bug? [Re: Wims] #236496 29/02/12 09:06 PM
Joined: Feb 2012
Posts: 8
A
Andulien Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Feb 2012
Posts: 8
Hey there,

thanks for the response, yea I suppose it would be a request then, since I need a way to start at a certain seconds time. Maybe a new Parameter for the next release.

@Mods: Please move this topic to the feature request section.

Re: /timer [time] bug? [Re: Andulien] #236498 29/02/12 10:19 PM
Joined: Jul 2006
Posts: 3,764
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,764
We don't need a new parameter, the syntax would just be extended to support seconds, I also gave you the way to do that for now.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /timer [time] bug? [Re: Andulien] #236499 29/02/12 10:21 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You can do this in a multitude of ways, I don't see why you need a new parameter.

If you really just want to start a timer in N seconds, what you're really looking for is a timer to start the timer:

Code:
.timer 1 5 /timerACTUALTIMER 0 30 /command_here


That will start the actual timer command in 5 seconds. This is really the programmatic translation of what you are trying to do anyway (you want a delay to trigger a delay, and a delay in mIRC is just a /timer, so replace "delay" with "timer"), so it makes sense to do it like this, and should be perfectly intuitive.

The HH:NN:SS format is meant for starting timers at an absolute time of day (something that would otherwise require a constant 1sec timer running to check the time, which is a lot more complex than the above example and somewhat worth having builtin functionality). If you're just looking to start at a relative time, the above example is easy to use and already available. But if you must use the [time] syntax, it's also very easy to convert relative times into absolute times:

Code:
/timer $asctime($calc($ctime + 5),HH:nn:ss) 0 30 /command_here


That would trigger in 5 seconds. You could simplify the above with an identifier alias (alias reltime return $asctime($calc($ctime + $1),HH:nn:ss)) and use /timer 1 $reltime(5) 0 30 /command_here.

Given the two options, I really don't see the need for a builtin switch, this is already easy to do.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: /timer [time] bug? [Re: Wims] #236501 29/02/12 10:27 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
The syntax can't be extended to support seconds without a switch to denote that the [time] parameter is an integer... unless you want users to specify seconds in a non-standard non-integer fashion (with a prefix or suffix or something annoying). That would effectively constitute "a new parameter"-- at least a new switch.

Neither of which are necessary.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: /timer [time] bug? [Re: argv0] #236502 29/02/12 10:37 PM
Joined: Jan 2004
Posts: 1,319
L
Loki12583 Online
Hoopy frood
Online
Hoopy frood
L
Joined: Jan 2004
Posts: 1,319
He wants the time parameter to support 07:00:00 instead of 07:00, not a plain integer.

Re: /timer [time] bug? [Re: argv0] #236503 29/02/12 10:48 PM
Joined: Jul 2006
Posts: 3,764
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,764
Yeah as Loki12583 stated, I think you misunderstood what he is asking for.

Last edited by Wims; 29/02/12 10:48 PM.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /timer [time] bug? [Re: Wims] #236507 01/03/12 01:37 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Ah you're right, I did misunderstand the suggestion. Yes, adding :ss to the format should be done.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"