 |
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Thu Jan 09, 2003 2:59 am
user functions |
this is one i have, that is supposed to make it easier for me to use the %secs variable:
#var time {(%1*60*60*1000)+(%2*60*1000)}
but i can't get it to work...
when i do
#echo @time(20, 42)
i just get
(20*60*60*1000)+(42*60*1000)
#echo %eval(@time(20, 42))
just gives me a blank line
any hints or suggestions? |
|
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Jan 09, 2003 3:29 am |
#FUNC time {%eval((%1*60*60*1000)+(%2*60*1000))}
Kjata |
|
|
|
 |
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Thu Jan 09, 2003 4:45 pm |
thanks, that worked, but now my trigger isn't :(
#func time {(%1*60*60*1000)+(%2*60*1000)}
#TRIGGER (%secs = @time(10,29)) {#echo time is 10:29}
but the right time goes by without anything happening |
|
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Jan 09, 2003 4:55 pm |
Triggers don't work like that. Try using an alarm instead:
#ALARM {*0.1} {#IF (%secs = @time(10,29)) {#echo time is 10:29}}
The alarm fires every .1 seconds (there is a limit to how short the period can be, .1s is not it, but it is very short). Of course, the alarm would have to fire exactly when the time is 10:29 with no miliseconds. This means, that this approach is not the best one. Try looking into the %time function instead.
Kjata
Edited by - tondiening on 01/09/2003 20:49:05 |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jan 10, 2003 6:56 pm |
You don't need %secs for this
#ALARM 10:29:00 {#ECHO time is 10:29}
Perhaps you could give us your real use for the function?
LightBulb
Senior Member |
|
|
|
 |
|
|
|