mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2005
Posts: 12
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jan 2005
Posts: 12
I have been trying to use $duration($!idle) and even tried $duration( $!idle ) and it always returns 0.

I have had problems with $!idle before when inside the ()'s but was fixed by putting a space before and after the $!idle like so: ( $!idle ).

Any ideas?

Thanks


Knowledge = Power
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Your problem lies in the fact that you are escaping the wrong identifier.

$duration($!idle) is going to trigger the $duration function, with input the literal chars $idle, which has no meaning.

Solution: $!duration($idle)


Gone.
Joined: Jan 2005
Posts: 12
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jan 2005
Posts: 12
FiberOPtics. Thank you very much for your input. Your solution works great.

Question: Is there someplace that will let me know when to use $! and when not to use $! (with or without ('s and )'s among other things?

Thanks


Knowledge = Power
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Ah good way to see if things need escaping or not is using a timer.

//timer 1 5 echo -a $!duration($idle) | timers

After issuing the /timers, you will see the running timers and their according command.

Basically, you need to distinguish what should be evaluated with the setting of the timer, and what should be evaluated when the timer finishes.

Good luck.


Gone.
Joined: Jan 2005
Posts: 12
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jan 2005
Posts: 12
FiberOPtics. Thank you for your quick response.

Thanks


Knowledge = Power

Link Copied to Clipboard