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


Joined: 15 Sep 2015
Posts: 9

PostPosted: Wed Sep 16, 2015 11:40 pm   

Walk - Kill - Repeat
 
Hi,

I was trying to setup a script that made my character walk from room to room in a specific path and kill predefined mobs if they are in the rooms. I have pretty much made it work using #slow, #pause and #step.

Is this still the way to go about it? How would I capture when the path is completed? One way would be to use a variable with the number of rooms in the path and then subtract it by 1 on each room
and once it reaches 0 reset it back to the length of the path and start the path again. That does not sound like the best of solutions though, suggestions?
Reply with quote
softballs
Newbie


Joined: 15 Sep 2015
Posts: 9

PostPosted: Wed Sep 16, 2015 11:51 pm   
 
Perhaps I could use a string list with the path and when i walk a room i could use %pop to remove it from the list. Even better would be if i could get the first item and put it last on the list again because then it would loop forever, is that possible?
Reply with quote
shalimar
GURU


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

PostPosted: Thu Sep 17, 2015 1:29 am   
 
I would use

#EVENT onRoomEnter {#PAUSE}

Provided you have a working map, that will pause in each room long enough for your other triggers to assess if there is anything to do.

#ALARM "keepGoing" +5 {#STEP}

Something like that would automatically resume your path after a given interval.Then if you find something to kill you can

#SUSPEND keepGoing

Only to #RESUME when you have made the kills.

You might need to code in a mob counter as well, so that you don't preemptively leave the area.

As for the actual path itself, you can save and use those via the #PATH command, or you can just use the #WALK command with the %roomnumber or ID.
_________________
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