|
gmueller Apprentice
Joined: 06 Apr 2004 Posts: 173
|
Posted: Thu Mar 26, 2009 10:14 pm
[3.05] #ALARM "xyz" {+0} |
background on this posting:
I have telnet triggers, which when used in conjunction with a #SAY command have the terminal ANSI codes appear on the screen instead of just inserting a piece of text on the screen... so I tried solving it by forcing the #SAY command to execute inside a different thread.
BUG: inside of my telnet trigger I put a:
#ALARM "say" {+0} {#SAY here}
but, the Alarm does not delete itself after execution...
I doesn't fire again, but it doesn't delete. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Mar 27, 2009 8:02 am |
I don't think this is really a bug. According to the #ALARM
Quote: |
A normal alarm cannot match a time smaller than or equal to half a second, so the fastest-repeating alarm you could have would be #alarm 0.501 {commands}. These restrictions don't apply to one-time alarms. The smallest unit of time you can use is a millisecond. |
Frankly i am surprised it fired at all, and think it's a bug if it did.
Code: |
#ALARM "say" {+1} {#SAY here} |
That should do what you want. |
|
_________________ Asati di tempari! |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Fri Mar 27, 2009 2:10 pm |
Try enabling a prompt trigger that will display the information and then disable itself after it displays the information.
|
|
|
|
gmueller Apprentice
Joined: 06 Apr 2004 Posts: 173
|
Posted: Fri Mar 27, 2009 5:54 pm |
ReedN, do you have an example?
If I use a #RAISE and do the text in an event it still has the same problem. (because it's still using the same thread, I believe)
#THREAD {#SAY hi}
works, but... I'm curious if this solution will only work half of the time... (because of the racing conditions of competing threads)
I think ReedN's solution might work, but I'm not sure how to implement it.
Oh, and I think in my previous posting.. I was only saying that the bug was that the #ALARM didn't delete itself, yeah, I realize that I used #ALARM incorrectly, but I think that it still must have an error in the way that the check is done.
If it's at all possible I'd like to not have too many duplicate triggers... I mean, since the prompt executes so often, I think it's got the potential of being one of the bottlenecks of the entire system. |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Fri Mar 27, 2009 7:45 pm |
I guess what I was trying to say was something like this:
You get a telnet trigger and you want to display something, but if you print it out right now it prints out garbage because Cmud wasn't designed to allow you to print just now. So do a #T+ PromptTrigger1 and optionally save the text you want to display to some variable, ie #var message "hello"
Now on a subsequent line you get a prompt and your 'PromptTrigger1' executes. It displays the @message you want displayed and then it disables itself with #T- PromptTrigger1.
Something along those lines. |
|
|
|
|
|