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
reave
Newbie


Joined: 20 Jul 2002
Posts: 2
Location: Australia

PostPosted: Sun Nov 10, 2002 9:46 am   

Exits and Slowwalking
 
Hi,

I would like to have a set of triggers that automatically unlocks and opens a door for me, if it senses their is a door in a certain direction, and I try and move in that direction.

I get an exits line like this:
[Exits: north [south] east (west)]


Directions enclosed in [] are locked doors (need to run "unlock south;open south;s" in this case). Directions enclosed in () are closed doors (need to execute "open west;w").

There is also the special cases of:
[Exits: south (Info) northeast up]

In this case, (Info) does not need to be processed as anything special for movement.

I would like to have the slowwalking feature be able to unlock/open doors accordingly. Any help in setting this up would be appreciated!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sun Nov 10, 2002 5:20 pm   
 
This can readily be done by using a trigger to capture the exit line, and a command input trigger to change the commands sent when needed.

#VAR EXITLINE {} {}
#VAR ExitConvert {northeastnesoutheastsenorthwestnwsouthwestswnorthnsouthseastewestwupudownd}
#VAR ExitState {} {}
#TRIGGER {^~[Exits: &%*{ExitLine}~]$} {ExitLine=%replace(%expand(@ExitLine,1),"[","");ExitLine=%replace(%expand(@ExitLine,1),"(","");#LOOPDB @ExitConvert { #IF (%pos(%key,@ExitLine)) {ExitLine=%replace(@ExitLine,%key,%val)}}}
#ONINPUT {^(%t)$} {#IF (%pos(%1,@ExitLine)) {ExitState=%copy(@ExitLine,%eval(%pos(%1,@ExitLine)+%len(%1)),1);#IF (@ExitState="]") {unlock %1;open %1;%1};#IF (@ExitState=")") {open %1;%1}}} "" {"notrig"}
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