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
Belmyrddyn
Magician


Joined: 17 Oct 2001
Posts: 371
Location: USA

PostPosted: Fri Nov 16, 2001 1:23 am   

Alarm
 
I'm trying to change all my scripts to be based on #Alarms instead of #WAITs. What I'm doing is using triggers to locate the amount of time to wait, then using an alarm to the effect;
#ALARM +@RT {#VAR Continue 1}
#Until (@Continue = 1) {}
And the script continues.

But I come up with a syntax error on the alarm line, something about the #VAR command. Is there a workaround for this?

Belmyrddyn
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Nov 16, 2001 5:38 am   
 
quote:

I'm trying to change all my scripts to be based on #Alarms instead of #WAITs. What I'm doing is using triggers to locate the amount of time to wait, then using an alarm to the effect;
#ALARM +@RT {#VAR Continue 1}
#Until (@Continue = 1) {}
And the script continues.

But I come up with a syntax error on the alarm line, something about the #VAR command. Is there a workaround for this?

Belmyrddyn



That should've worked, I think. If not, you can probably do @continue = 1. It's really the same thing.

On a side note, are you sure you have all your braces in place?

li'l shmoe of Dragon's Gate MUD
Reply with quote
decantor
Apprentice


Joined: 14 Nov 2001
Posts: 100

PostPosted: Fri Nov 16, 2001 7:55 am   
 
Although this is not exactly a direct reply, I used to have a lot of problems with #wait and #alarm. So, instead of messing around with it, I decided to take full advantage of the tick timer. This is something that I would highly recommend to anyone who enjoys scripting and likes to make zmud do amazingly wonderful things to make their mudding time a whole lot easier, and more enjoyable.

First, I figured out how many seconds were in a 'round' on the MUD i frequent the most, which turned out to be around 3 seconds. Then, I configured my tick timer to a duration of 3 seconds, 0 second timeout margin, and set it to execute one single alias.

At first, I just thought 'OK, that's neat', and didnt really do much with it except count rounds, but if you use it to operate #math tick_counter {@tick_counter + 1}, you now have probably THE most powerful thing I have ever come across in coding zmud scripts.

The main thing it gives you is a basis to start counting anything on. For example, "#TR {You quaff a sanctuary potion.} {#VAR sanctuary_base @tick_counter}" would give you the number of the round that you quaffed said potion. If you add a sanctuary_duration variable(the total duration of the spell), and integrate an alias to keep track of how many rounds of sanctuary you have left(also using the tick_counter), you can always know what spells are affecting you and how long it will be before they run out. I use this type of trigger for all of my spells, and use the status window to display them in real-time.

This can also be used in doing simple delays by adding another alias for the tick timer to execute, next_action or whatever... the uses for the tick timer once you do this are pretty much only limited to your imagination and scripting skill.

To do delays, the best way I have found so far is to lump all the commands into a different class, and create a button that toggles the class on and off and assigns a noop to the alias you execute to spam thru the commands(eg. #ALIAS next_comand {""}).

Anyway, I hope someone else thinks this is a cool idea, cuz I sure have fun with it ;)

~~deca
Reply with quote
Belmyrddyn
Magician


Joined: 17 Oct 2001
Posts: 371
Location: USA

PostPosted: Fri Nov 16, 2001 1:19 pm   
 
Yes, I use the tick timer to countdown the number of second left in the roundtime, for a gauge. Its really quite nifty.

Belmyrddyn
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