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
Altman
Beginner


Joined: 02 Feb 2010
Posts: 16

PostPosted: Sun Feb 14, 2010 6:23 pm   

How do you use CMUD to deal with enforced pauses from the MUD?
 
I have written a script that works by calling specific aliases in response to output from the MUD and is working well apart from one slight problem.

The MUD includes some locations with events that freeze you so that you can't move or do anything until you are released (usually a few seconds). When my script involves transiting through one of these locations it keeps sending commands to the MUD which responds with "You cannot move at the moment". When I am released the script is then out of sync.

I have tried inserting #waitfor commands in the aliases that are called by the script as well as the script itself but this does not seem to help as the script has already sent all the commands. I think I am probably doing something silly but I need one of you to point it out to me.

Here is one of the scripts called by a trigger:

#var dropoffloc %1
#execute %replace(%replace(%replace(from@pickupplanet@pickuploc, " "),"'",),",")
#waitfor {shuttle}
board
goto @dropoffplanet
board
#waitfor {shuttle}
#execute %replace(%replace(%replace(to@dropoffplanet@dropoffloc, " "),"'",),",")
dropoff
#waitfor {You hand over the package and receive a receipt for it.}
#execute %replace(%replace(%replace(from@dropoffplanet@dropoffloc, " "),"'",),",")
#waitfor {shuttle}
#execute %replace(%replace(%replace(toak@dropoffplanet, " "),"'",),",")
ak
buy fuel
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Feb 16, 2010 7:47 pm   
 
I assume your movement commands are within an alias represented by, for example, %replace(%replace(%replace(to@dropoffplanet@dropoffloc, " "),"'",),","). Is this alias simply a string of movement commands? If you are using the mapper, there are several things you can do, but I suspect you aren't. If you are using the mapper, let us know.

When exactly is this "freeze" happening? Is it at the point where you have put your #waitfor commands? Or is it in the middle of the movement alias immediately before the #waitfor? If it is the latter, the only thing you can do is to incorporate the delays into the alias itself. If the former, what you have should work, I think.
Reply with quote
Altman
Beginner


Joined: 02 Feb 2010
Posts: 16

PostPosted: Tue Feb 16, 2010 8:53 pm   
 
Hi Rahab,
Thanks again for the help. I cannot get the mapper to work with this MUD so i am making aliases for the key paths instead. The pause is in the middle of the movement alias and I have added #waitfor commands into these too but when the main script calls the alias it seems to send all the text to the MUD in one go. Here is an example of one of my aliases (you can see the #waitfor command) but it still sends the movement commands to the MUD before the #waitfor text is received.

e
e
s
press touchpad
#waitfor {South Dome Exterior Airlock}
e
se
se
sw
s
s
w
w
Reply with quote
Altman
Beginner


Joined: 02 Feb 2010
Posts: 16

PostPosted: Tue Feb 16, 2010 8:59 pm   
 
I think I'll try breaking up the trigger scripts into smaller chunks and using more triggers to advance them to the next state.... use more #if commands to check my location before advancing to the next state... dunno

Any other suggestions would be gratefully received
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Feb 17, 2010 1:07 am   
 
Why can't you get the mapper working?
_________________
EDIT: I didn't like my old signature
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Feb 17, 2010 2:01 pm   
 
As far as I can see, that alias should work fine. Testing it in a blank session seems to work. Have you checked whether that text, "South Dome Exterior Airlock", appears before you press the touchpad? Have you tried using the alias by itself to see if it works?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Feb 17, 2010 2:05 pm   
 
Oh, wait, I see the problem. Using the #waitfor puts that alias into a separate thread. Once that happens, the rest of the trigger continues in the main thread. I thought it was the direction commands that was being sent immediately, but it isn't, is it? It's the rest of the trigger that is happening before the movement is finished.

I'm afraid that the only solution (other than using the mapper) is to make sure that the entire trigger, including the aliases, get executed in the same thread. This will mean breaking up the alias, as you have suggested, so that you don't need a #waitfor in it.

[edit]
Well, there is probably another solution too, which would involve sending a signal from the alias thread to the trigger thread, but I don't know enough about signals to help with that.
Reply with quote
Altman
Beginner


Joined: 02 Feb 2010
Posts: 16

PostPosted: Wed Feb 17, 2010 6:45 pm   
 
Rahab, thanks for the help I will try breaking it up to see if that helps.

Matt, this MUD is made up of lots of custom user content and as such there is no uniformity in the location descriptions. There is enough to get the mapper recognizing the location name but it cannot find the exits. Coupled with this, the no exit messages are also custom and vary a lot which means that one would need a ton of no exit scripts to prevent the mapper getting confused. I tried fiddling a bit and decided that getting it to work properly would require too much work.
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