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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Cronos
Novice


Joined: 06 Sep 2004
Posts: 30

PostPosted: Sat Feb 12, 2005 9:20 pm   

Trigger for variable wait time
 
I am trying to practice a skill that can be only used once per minute. How do I create a trigger where I send a command to the mud every x number of seconds.

If I try to use the skill before the minute is up, the game will tell me how much longer I have to wait before I can use the skill again.

Example:
You must rest 52 seconds and replenish your energies.

Where 52 is a number between 1-59.

I tried taking advantage of the #WA (Wait) command but I don't think I can use a variable with it. For example, I don't think #WA VARIABLE will work. I have to use #WA 52000.

Anyone know of a way to make this work?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Feb 12, 2005 10:08 pm   
 
#WAIT is never good

#ALARM "auto_practice" {*70} {practice skill}

should fire ever 70 seconds (due to lag and such you wanna be able to swing both ways on the 60 second mark)
you can also change the time left on the alarm using the %alarm function and disable the alarm by using
#T- auto_practice
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Cronos
Novice


Joined: 06 Sep 2004
Posts: 30

PostPosted: Sat Feb 12, 2005 10:50 pm   
 
How do I manipulate the alarm command so that it's a variable.

You must rest 52 seconds and replenish your energies.

Should I make it something like:

#T {You must rest (%d) seconds and replenish your energies.} {#ALARM "auto_practice" {%1} {skill} }

Would that work?


The thing is that the time will change. If I use the skill before the minute is up I would get let's say:
You must rest 52 seconds and replenish your energies.

And if I do the skill again, I would get:
You must rest 5 seconds and replenish your energies.


So I want the skill to fire in 5 seconds rather than wait another 60 seconds.
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sat Feb 12, 2005 11:52 pm   
 
Well if you've tested it you probably know by now that yes it does work.
When you change the time for an alarm to fire it starts counting from the time you changed it.
However thereafter the alarm would fire every 5 seconds (for example) unless you you made it a temporary alarm
which would fire once and then delete itself.
You can however have the alarm reset itself to 60 seconds every time it fires successfully.
Like this:

Code:
#TRIGGER {You must rest (%d) seconds and replenish your energies.} {#ALARM "auto_practice" {%1} {skill;#ALARM "auto_practice" {*60}}}


even if you didnt reset the time your trigger would work, however most of the time it wouldnt be sync'ed and have to fire 2x as much as you want.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Feb 13, 2005 12:00 am   
 
which is where the %alarm function comes in, remember help files are your friends
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Cronos
Novice


Joined: 06 Sep 2004
Posts: 30

PostPosted: Sun Feb 13, 2005 1:44 am   
 
Is that command above compatiable with zmud 4.62?
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sun Feb 13, 2005 2:19 am   
 
I think so, but if you have zmud 4.62 and you want to be sure why not read the zmud 4.62 helpfiles
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Cronos
Novice


Joined: 06 Sep 2004
Posts: 30

PostPosted: Sun Feb 13, 2005 5:30 am   
 
#TRIGGER {You must rest (%d) seconds and replenish your energies.} {#ALARM "auto_practice" {%1} {skill;#ALARM "auto_practice" {*60}}}

Can you explain each of the variables above and what they do. I want to customize it to my game. Thanks.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Feb 13, 2005 5:50 am   
 
I know 4.62 did not support the ID field with the #ALARM command. It seems to me that #EXEC, #ALARM, and %concat were available in 4.62 so you can do it the old fashioned way. You should check 4.62's help though to make sure.
#TRIGGER {You must rest (%d) seconds and replenish your energies.} {#EXEC {%concat("#ALARM {+",%1,"} {skill}")}}

This should create an alarm that fires once then deletes itself.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Cronos
Novice


Joined: 06 Sep 2004
Posts: 30

PostPosted: Sun Jan 06, 2008 7:01 am   
 
When I use the above, it doesn't seem to recognize the #ALARM command?
#TRIGGER {You must rest (%d) seconds and replenish your energies.} {#EXEC {%concat("#ALARM {+",%1,"} {skill}")}}

I get the following directly into the mud (like i typed it in), rather than working in the background executing the #ALARM command.
#ALARM {+52} {skill}

Any other suggestions? Is there like a way to turn the #WAIT command to kick off the skill that's in %d?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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