|
Andymedae Beginner
Joined: 19 Jul 2004 Posts: 12 Location: Atlanta Georgia
|
Posted: Sat Jul 31, 2004 11:44 pm
Alarm doesn't fire |
I am having a problem with elapsed alarms not firing.
Here is the code that invokes the alarm:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#if (%defined( cmd)) {
#var cmd1 @cmd
#unvar cmd
#show "Command: " @cmd1
#show "Rt: " @rt
#if (@rt > 0) {#alarm +@rt {#exec @cmd1}}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Here is the relevant section of the output buffer when this code executes:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> observe sun
You scan the skies for a few moments.
The mid-afternoon sun is unobscured by clouds.
The sun shines with a steady, yellow light.
You see nothing regarding the future.
Roundtime: 7 seconds.
> Variable cmd removed.
encountered # 2
Command: observe sun
Rt: 7
> Variable cmd1 removed.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Uppon completion of this script the alarm trigger still exists. I moved it to a class and took the code for the trigger from the class text as follows:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#ALARM "_Alarm6619" {+@rt} {#exec @cmd1}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
At the time the trigger was invoked the timing variable @rt had a value of 7. I would have expected the trigger to fire in seven seconds and then not exist.
Any ideas? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Aug 01, 2004 12:55 am |
Your transcript shows that you use the #UNVAR command on both @cmd and @cmd1, but #UNVAR cmd1 is not to be found in your snippet so there must be more to the script than you showed. There's nothing wrong with the little snippet of script you showed us, so the problem is undoubtedly somewhere in the (likely much larger) part of the script you didn't show us.
When one-time alarms don't fire as expected, it's usually caused by disabling the class they are in. However, in this case it might be that you simply deleted the variable, @cmd1, before the alarm fired, so that when the alarm fired it had nothing to do. |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
Andymedae Beginner
Joined: 19 Jul 2004 Posts: 12 Location: Atlanta Georgia
|
Posted: Sun Aug 01, 2004 2:14 am |
I have a lot of live triggers going on.
It is possible that cmd1 got dropped before the alarm could fire. But wouldn't the alarm still fire but do nothing. In that case the alarm would no longer exist.
I should also point out that the variable @rt is counting down by second throught the alarm interval. I assume that the change in its value would not affect the time that the alarm fires after the alarm has been invoked. |
|
|
|
|
|