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
Vortigen
Novice


Joined: 10 Dec 2000
Posts: 44
Location: United Kingdom

PostPosted: Wed Dec 05, 2001 8:51 pm   

Here's a challenge for you.
 
Is it possible to pause all your triggers and alias's for a second.
I don't want to turn them all off.
I still want them to proccess the screen messages etc. Its just the commands it send to the MUD I wan't paused. After the one second is up I wan't them to be sent to the MUD.

Is this possible?

Thanks in advance

Vortigen

"It's not just a riot of blots and blurs and disjointed jottings linked by bursts of speed...it only looks as if it is, damn it."
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Thu Dec 06, 2001 4:58 am   
 
only thing i can think of is to add a line like
#if @pause {#wait 1000}
to the top of all triggers alias' that need to be paused.
couldn't think of a way to do it with #alarm
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Dec 06, 2001 5:16 am   
 
quote:

only thing i can think of is to add a line like
#if @pause {#wait 1000}
to the top of all triggers alias' that need to be paused.
couldn't think of a way to do it with #alarm



There's no way to pause executing scripts (you can probably kill the execution with %abort() however). If all you want are the commands to be paused, you can set up either a state machine or a queue system that waits until delay = 0.

It pretty much depends on how your MUD does things. On Dragon's Gate MUD, many commands have a delay attached to them which generates a line like this:

[3 sec. delay]

Using a state machine I can set up a @run variable that determines whether to send a command or not. In some other setting (ie, a delay gauge), I can tick down the delay value and when it reaches zero set @run to the positive state.

I could also include the delay line in various triggers and #alarm the next command.

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


Joined: 14 Nov 2001
Posts: 100

PostPosted: Thu Dec 06, 2001 8:14 am   
 
There is a way to delay anything by a set amount. You simply have to set an alarm or the tick timer to do something every so often, however, it would take a lot of coding. If you know in advance what you would want to be doing, it would be a bit easier, but even if you want to change things on the fly, it would still work.

To start with, if you wanted zmud to execute things every so often, you will need to set up an alarm or use the tick timer to execute an alias however often you want it to occur. I will use a tick timer example, because it is what I am most familiar with(I abuse the tick timer like you wouldn't believe).

I wouldn't really suggest doing this every second, but every 2 seconds works quite well.

#ALIAS do_action ""

Set up the tick timer:
timeout command: do_action
timeout margin: 0
timer interval: 2

Now, every 2 seconds, zmud will execute do_action (which you have set to null so that it doesn't spam the heck out of you while you set the rest up).

This is where other people's knowledge of lists is going to come into play, because the things I do with the timer are all trigger-based. The way I have things set up, triggers modify do_action, but from the sounds of things this will be very hard for you to make work under your particular circumstances.

What you need to is set up a list for do_action to step through. Basically, the alias do_action will perform the first command in a stringlist, and then delete it from the list. Then, if the stringlist is empty, do_action returns to null. Or, a better way to do it would be to edit the timeout command to: #IF (@actions_list) {do_action} {""}

You will then probably want aliases to modify the actions_list. Aliases like do_first (to add something to the beginning of the list) and do_last (to add something to the end of it) are definite musts. You might also want to have a command to turn this all off. Simply doing "#TS 0" will disable the timer.

I'm not sure if this will work for your situation, but I find that it's a format that is easily tweakable for most occasions. Once you have the basic skeleton up, anything is possible.

I am sorry, however, that I can't help with the lists. I had huge problems with them in earlier versions of zmud and I just started doing everything with triggers and aliases. Learning how to make the tick timer do everything so smoothly was just the icing on the cake.

I also hope that this text posts. The preview seems to be broken and I would hate to have to write it all again ;)

~~Decantor
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Thu Dec 06, 2001 8:32 am   
 
Was just thinking something similar..

Get all the scripts to write their results in a list instead of sending them to the mud, and user #ALARM to execute the commands after 1 second..

Lady C.
Reply with quote
Vortigen
Novice


Joined: 10 Dec 2000
Posts: 44
Location: United Kingdom

PostPosted: Fri Dec 07, 2001 8:43 pm   
 
First I'd like to thank you all for your replies.

I was secretly wishing there would be a
#PAUSEINPUT 1 command.

Otherwise I have alot of triggers to change to send their commands to a list.


thanks again

Vortigen

"It's not just a riot of blots and blurs and disjointed jottings linked by bursts of speed...it only looks as if it is, damn it."
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