|
myddrun Wanderer
Joined: 31 Mar 2005 Posts: 58
|
Posted: 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! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
myddrun Wanderer
Joined: 31 Mar 2005 Posts: 58
|
Posted: 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. |
|
|
|
|
|