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
bskrzysiek
Newbie


Joined: 29 Jan 2015
Posts: 9

PostPosted: Thu Jan 29, 2015 10:19 am   

Two #SLOW functions one after another
 
I have two paths called Path_1 and Path_2

I want to execute them one after another with single command like this:
Code:
#SLOW "Path_1";#SLOW "Path_2"


The result is that Path_1 is starting executing but it is still unfinished when Path_2 is starting executing and by this it overwrites Path_1.

My slow walking timeout value is 1000.

How to make CMUD to execute first #SLOW "Path_1", wait until it's done and after that execute #SLOW "Path_2"?
Reply with quote
shalimar
GURU


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

PostPosted: Thu Jan 29, 2015 11:31 am   
 
include an alias in path_1 that will call path_2
_________________
Discord: Shalimarwildcat
Reply with quote
bskrzysiek
Newbie


Joined: 29 Jan 2015
Posts: 9

PostPosted: Thu Jan 29, 2015 11:45 am   
 
It's not a possible for the thing I am coding.

Is there any other way to achieve that? #WAIT would be ok but only if there would be a solution to calculate precisely how long Path_1 would take to complete.

Are there any other solutions?


Last edited by bskrzysiek on Thu Jan 29, 2015 12:05 pm; edited 2 times in total
Reply with quote
shalimar
GURU


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

PostPosted: Thu Jan 29, 2015 12:03 pm   
 
you could make use of the onWalkEnd event and test for the current room number
_________________
Discord: Shalimarwildcat
Reply with quote
bskrzysiek
Newbie


Joined: 29 Jan 2015
Posts: 9

PostPosted: Thu Jan 29, 2015 12:11 pm   
 
Can you expand you answer? I'm not using any map. The reason why the first solution wouldn't work for me is because I need to have flexiblity to change for example Path_2 to Path_3.
Reply with quote
shalimar
GURU


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

PostPosted: Thu Jan 29, 2015 12:18 pm   
 
#EVENT onWalkEnd {}
Will automatically fire at the completion of any path.
Room number is not the only variable you can use to decide the next step though.

#IF (@nextPath) {#PATH %pop(nextPath)}

That will check to see if the variable has a value, and if so, it will perform the path, and clear the variable.

so all you would need to do (after defining the event) is:

nextPath=path_2
#PATH path_1
_________________
Discord: Shalimarwildcat
Reply with quote
bskrzysiek
Newbie


Joined: 29 Jan 2015
Posts: 9

PostPosted: Thu Jan 29, 2015 12:52 pm   
 
I created #EVENT onWalkEnd {#ECHO Test} but it doesn't show anything after completion of #SLOW or speedwalk? How does it work exactly?
Reply with quote
shalimar
GURU


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

PostPosted: Thu Jan 29, 2015 1:08 pm   
 
It may be more directly tied to the mapper then I thought.
You might want to consider mapping.
_________________
Discord: Shalimarwildcat
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