|
lizard42069 Beginner
Joined: 15 Dec 2014 Posts: 19
|
Posted: Tue Jan 06, 2015 7:20 am
Alarm based on character action wait time |
Certain actions in the mud require the character to devote a portion of time to the action. In the MUD's command prompt which posts to the window with every return this is identified by Wait[0]. I would like to somehow create a trigger to count down this time at a rate of 1 second until 0 at which point the alarm would need to terminate. I'm not sure how to identify the variable to set the parameter for how many ticks to put into the alarm.
In short:
How do I tell the trigger I'm looking for the number in the brackets? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Wed Jan 07, 2015 5:31 pm |
You need to escape out the brackets, because the have a meaning of there own in pattern definition
#TR {wait~[(%d)~]} {#ALARM "waitOver" +%1 {do spmething}} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
lizard42069 Beginner
Joined: 15 Dec 2014 Posts: 19
|
Posted: Mon Jan 26, 2015 5:01 am |
%d is how to call a value then.
So I've attempted the following, there's no error in the compiling, but it is not creating the necessary alarm.
#IF (%1==0) {#ALA wait-timer {*1} {#PL Sounds/Heartbeat.wav}} {#SUS wait-timer}
This is intended to create an alarm that fires every 1 second playing a 1 second wav file IF %d is not equal to 0, otherwise to suspend the wait-timer alarm state. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Mon Jan 26, 2015 7:03 am |
%d is the wildcard for numeric values
And the issue is the curly brackets around the time parameter i believe.
(even though that contradicts the help file)
that or the lack of quotations on the ID
Try:
#IF (%1) {#ALA "wait-timer" -1 {#PL Sounds/Heartbeat.wav}} {#SUS wait-timer} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Mon Jan 26, 2015 8:23 am |
This would re-create the alarm every time, which is a lot of extra work for nothing. It would be more efficient to create it once manually, then use #resume and #suspend in your trigger to enable and disable it as required.
|
|
|
|
|
|