Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
lizard42069
Beginner


Joined: 15 Dec 2014
Posts: 19

PostPosted: 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?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
lizard42069
Beginner


Joined: 15 Dec 2014
Posts: 19

PostPosted: 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.
_________________
Step into the shadows of Deckeon
deckeon.mine.nu :: 2065
----------
3rd Edition Shadowrun MUD
----------
http://deckeon.net/
http://deckeon-mud.wikidot.com/
https://www.facebook.com/deckeonMUD
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net