Speedwalk-ish alias

Posted by Brendolino on Fri 15 Apr 2011 12:31 AM — 8 posts, 31,374 views.

#0
I have an alias that sends me through an entire zone:
e;n;w;s;n;w

etc..

But I want to pick up specific objects I run across. I created a trigger to "get all" or "get <object>", and when I use my alias, the trigger fires... but the action doesn't happen until AFTER every command in the alias is executed. Thus.. once the "speedwalk" is done, I have 15 "You don't see that here."

Is there a way to inject a trigger into a speedwalk-style alias, where it goes instantly?
Australia Forum Administrator #1
Template:post=6008
Please see the forum thread: http://gammon.com.au/forum/?id=6008.


Look further down the page to the amended plugin, and in particular the part starting "What you can do if you need to stop automatically and fight is make a trigger that reacts to something ...".

Basically you need to walk slowly enough that you have time to react to messages (like an object is in the room) before you have left the room. So combining the slow speedwalk with your trigger should do it.
#2
Looks great.. and dunno if I should post issues here or on the primary, but I get...

Alias function "func_handle_speedwalk" not found or had a previous error.

when executing an alias: ! s d u n , as a test.
#3
Ok, so I reinstalled the plugin and it tries to work, only problem is, the exit format is different, so I assume this one may not work for me.

Obvious exits:
North - Cockpit
South - Durasteel Corridor
Down - Boarding Ramp
Australia Forum Administrator #4
Yes, you need to change the regexp near the start of the plugin (about line 11) to match what an exit line looks like, eg.


<!ENTITY exits_trigger 
      "^((?P<exits>Obvious exits:)|(.*)Alas, you cannot go that way\\.)$" > 

#5
Worked great. Only other issue I found was non-cardinal directions (ne, nw, se, sw) are parsed to their cardinal roots. I can bypass for now, but mebbe something to consider.

Thanks Nick, you rock!
Australia Forum Administrator #6
Well you are supposed to be able to type:


4esw


which means 4 x east, 1 x south, 1 x west

If you want to do things like NE and SW put them in brackets, eg.


4e(sw)

Australia Forum Administrator #7
Brendolino said:

Thanks Nick, you rock!


Thanks!