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
myddrun
Wanderer


Joined: 31 Mar 2005
Posts: 58

PostPosted: Thu Sep 15, 2011 11:05 am   

Script to follow a tunnel. (Forget it. Not worth the hastle *grin*)
 
Sounds easy enough?

But the tunnel may or may not be random so mapping looks unlikely at the moment and I only want to go forwards until I get to the end then come back again.

You get teleoprted to the start of the tunnel which only has one exit and all the other rooms have 2 exit in a standard 8 point compass until you get to the dead end. Then I want to reverse the procedure.

The only minor problem is some rather hard random monsters that prevent you from leaving in any direction once you enter a room. They also randomly spawn too. They may not be visable but appear when you try to exit.

All room names and exit will be in a standard format. EG. Room_Name [n,se].

What I'm trying to figure out is the best way ignore the exit from where I've come. Any ideas?


Edit.....

There come a point when in a vague attempt to be lazy it actually makes more work than it's worth! Laughing
Reply with quote
shalimar
GURU


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

PostPosted: Fri Sep 16, 2011 7:57 pm   
 
First you need a way to capture what way you came from. I use this:

Code:
<trigger type="Command Input" priority="600" trigontrig="false" id="95">
  <pattern>^(%w)$</pattern>
  <value>#IF (%reversedir(%1)) {lastDir=%reversedir(%1)}</value>
</trigger>


Now that we have that we just need to capture off the exit line:

Code:
<trigger priority="520" id="89">
  <pattern>%w ~[(*)~].</pattern>
  <value>$exits=%replace(%1, ",", "|")
#DELITEM $exits @lastDir
#WAIT 750
#IF (@autoWalk=1) {#IF (%numitems($exits)=1) {$exits}}</value>
</trigger>


This waits almost a second before moving again so long as @autowalk has a value of 1 (so you can turn it off).[/code]
_________________
Discord: Shalimarwildcat
Reply with quote
myddrun
Wanderer


Joined: 31 Mar 2005
Posts: 58

PostPosted: Mon Sep 19, 2011 12:01 pm   
 
Thanks Shalimar. It might be worth playing with but after investigating this area further, it appears I dont need to walk all the way to the end.

The monsters drop random objects that can teleport you to the next level. Smile
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