How to open a door on a failed move?

Posted by Kahenraz on Sat 23 Jan 2016 02:29 AM — 2 posts, 12,020 views.

#0
east <- command sent
The door is closed. <- response

How can I detect this and send an 'open east'? I can't use a trigger because the response doesn't specify the direction.
Australia Forum Administrator #1
I'm sure we did this a while back but can't find it. :(

The general technique is:

1. Have an alias that matches directions (eg. north|south|east|west). This "remembers" the last direction you typed into a variable, and then sends the command. ie.


lastDirection = "%1"  -- remember it
Send ("%1")  -- go there



2. In your trigger, now you can recall that variable so you know which door to open,