|
albo Apprentice
Joined: 27 Mar 2008 Posts: 106
|
Posted: Mon Apr 27, 2009 5:07 am
can #alarm be used with wildcards? |
I try to recall and will be told:
You can't recall yet! (%d) seconds remaining.
I have a very large script that relies on a recall at the end of each completed task; the most annoying work is adjusting the #wait time for each individual task as some of them are greater. There are also kinks, for instance, one task may require a large wait time before the recall on one occasion but may not require the wait time on another occasion. To get around to the point I want a trigger off the above pattern, using #alarm preferrably, to take the number that would be in the place of (%d) and convert it into milliseconds which the alarm would then count down and issue the recall command at the proper time. I have the #wait command in every one of my scripts and if I were able to work out this one trigger I could eliminate a lot of useless and potentially harmful code in my scripts. It would simply work like this: task is over and recall is issued and if I must wait the recall #alarm kicks in and issues recall for me at the appropriate time. |
|
|
|
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Mon Apr 27, 2009 5:14 am |
No, unfortuantly you cant use %1-99 wildcards from a trigger in an alarm.
You can however use local variables as a jump between. |
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Mon Apr 27, 2009 7:15 am |
wrym wrote: |
No, unfortuantly you cant use %1-99 wildcards from a trigger in an alarm.
You can however use local variables as a jump between. |
Not true.
#TRIGGER {^You can't recall yet! (%d) seconds remaining.} {#ALARM +%1 {recall}}
works perfectly...
I don't know where you got that you can't use %1-%99 in an alarm...
Charneus |
|
|
|
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Mon Apr 27, 2009 12:43 pm |
GAHHHh, zmud, no local variables anyway.
Thou your code does work charneus, I've always been wary cause of the lil red note at the bottom of the #alarm help page.
Quote: |
Note: #ALARM does not preform any expansion on it parameters at the time of creation. If you need a parameter expanded use a syntax similar to the #EXEC example below. |
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Mon Apr 27, 2009 2:50 pm |
that's because the time option is not bracketed, thus allowing variable expansion
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Mon Apr 27, 2009 3:10 pm |
wrym wrote: |
GAHHHh, zmud, no local variables anyway.
Thou your code does work charneus, I've always been wary cause of the lil red note at the bottom of the #alarm help page.
Quote: |
Note: #ALARM does not preform any expansion on it parameters at the time of creation. If you need a parameter expanded use a syntax similar to the #EXEC example below. |
|
Heh. I hadn't realized it was zMUD myself! And while that note exists, it doesn't state that you can't use wildcard expression. If that had failed, it would have been just as simple to change it to:
#EXEC %concat("#ALARM +",%1," {whatever}")
and it'd still work.
Charneus |
|
|
|
albo Apprentice
Joined: 27 Mar 2008 Posts: 106
|
Posted: Mon Apr 27, 2009 9:18 pm |
I threw one together real quick, i think it worked like this:
You can't recall yet! (%d) seconds remaining
#alarm %1 {recall}
and it created the alarm with the proper time the only problem was that it created a steady alarm and was going off every 37 seconds, but at least it says that you can use wildcards. I just didn't edit the post because it was late and I wanted some sleep.
#EXEC %concat("#ALARM +",%1," {whatever}")
I tried that one, it works and I like it.
Thanks! |
|
|
|
Troublemag Wanderer
Joined: 14 Jul 2004 Posts: 83
|
Posted: Tue Apr 28, 2009 3:14 am |
On your original one, you didn't have +%1. The + is very important as it creates a temporary alarm trigger that will fire once then delete itself. Omitting the + creates an alarm that will repeat every %1 seconds.
|
|
_________________ CMUDPro 3.22 |
|
|
|
|
|