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


Joined: 10 Jun 2008
Posts: 17

PostPosted: Mon Dec 13, 2010 5:07 pm   

Walker help
 
Greetings everyone,

I know there are a dozens of posts about walkers and I've read through the majority of them and couldn't find one that quite fit what I'm trying to do. I play Achaea and am trying to get it to check every room in an area for missing plants. What I'm using now is incredibly unreliable - I go to a specific room in an area, I type an alias, it checks PLANTS in that room and goes off an echo on a trigger then uses #COND to move to the next room. I have perhaps 100 conds and if I get interrupted it'll keep trying to go and I'll have to delete the temporary trigger it makes with all of them stored.

To summarise it, what would be the best way to make a script to walk through a predetermined route (west, west, west, southwest, east, east, east, etc), once it enters a room it checks plants, then once it sees 'none missing' or 'plant missing', it will go to the next room on the route?

Thank you in advance for your assistance
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Dec 13, 2010 6:15 pm   
 
There are numerous possible methods, and which one fits best might depend on details you haven't mentioned yet.

If you have this area mapped by the Mapper, then here is one suggestion:
Create a class called CheckPlant.
Within CheckPlant, create an OnEnter event which executes the check plants routine.
Within CheckPlant, create a trigger to catch whatever message that indicates you are finished, and do whatever you need to do then--probably disabling the CheckPlant class, at the least.
Within CheckPlant, create a trigger(s) on the "none missing" or "plant missing" message which pops from the stringlist the command(s) to move to the next room and executes it.
Make other triggers which will catch common conditions that should cause you to stop, which disables CheckPlant.
Set CheckPlant to be disabled by default on startup.
Make an alias outside of CheckPlant which enables CheckPlant and executes a command to get things started--either by moving or executing the check plant routine.
Make an alias which will disable CheckPlant, so that you can manually stop it if your triggers don't do it for you.

Alternatively, if this is supposed to always execute the same route and always moves regardless of whether you find plants or not:
Make one stringlist with all the commands for moving and checking plants.
Make an alias which executes each element of the stringlist in a #FORALL loop, with #WAIT to put appropriate time spacing into it.
Make triggers to catch the common events that should stop the routine, using #STOP to stop the check plant thread.
Make an alias to #STOP the check plant thread, so you can do it manually if necessary.
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