mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Im wondering how would I use a timer without it being static to the command i use with it for example


/timer 0 1 //echo -a $asctime($calc($insong.pos / 1000),n:ss)

this would only keep echoing the same value every second has it captured when the first command went through like

0:30
0:30
0:30

etc..


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
probably just escape the identifiers
/timer 0 1 //echo -a $!asctime($!calc($!insong.pos / 1000),n:ss)

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Actually, the only one that needs to be escaped is the $insong identifier
Code:
 /timer 0 1 echo -a $asctime($calc($!insoong.pos / 1000),n:ss) 

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
great

Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Quote:
Actually, the only one that needs to be escaped is the $insong identifier
Code:
 /timer 0 1 echo -a $asctime($calc($!insoong.pos / 1000),n:ss) 


Actually, if you're doing:
//timer 0 1 echo -a $asctime($calc($!insong.pos / 1000),n:ss)

It'll always be 0:00

Code:
//timer 0 1 echo -a $!asctime($calc($insong.pos / 1000),n:ss)


Is what you'd want to use.

Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Works thank you


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
I always found it to be a nuissance trying to decide which identifiers need to be $!escaped, so now I just do this:

/timer 0 1 $(echo -a $asctime($calc($insong.pos / 1000),n:ss),0)

Just add a $( at the beginning at a ,0) at the end.

-genius_at_work

Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Just a note:

The only identifiers that will need to be escaped, are the ones that have a space before the $.

If you have: $one($two,$three) all you have to escape is $!one

This is because it forces it to read it as plain text, and since there is no spaces before any of the other $'s, it treats them as part of a "word" (ie: //say Iam$me, will always return "Iam$me").

On the other hand, if you used:

$asctime( $calc( $something / $something ) )

Each one would need to be escaped. (Unless you wanted the calculations to be evaluated before sending it through the $asctime, of course.)

But yes, $( <stuff> ,0)

Tends to be much easier to use.


Link Copied to Clipboard