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


Joined: 24 Feb 2003
Posts: 5
Location: USA

PostPosted: Sun Jul 27, 2003 2:46 pm   

%path @variable from #path {pathname} ?
 
I am looking for a way to get a #PATH definition into a %variable.

example: #path {shoptilyoudrop} {RUN 2w2n2e2s;OPEN up;UP}

I would like to reference the "RUN..." command part of the #PATH definition.

thus: #path {shoptilyoudrop} {RUN 2w2n2e2s;OPEN up;UP}
goes: #var letsgo %path(shoptilyoudrop)
then: #show PATH dir = @letsgo
show: PATH dir = RUN 2w2n2e2s;OPEN up;UP

so I can then maybe do: SAY 'To get back to the temple, use: %pathreverse(@letsgo)'
or maybe even try: #SHOW %pathreverse(%path(shoptilyoudrop))

that isn't necessarily the exact scenario I am gunning for, but it demonstrates a use for such a @variable definition. I note, however, that anything other than a simple DIR (say, any use of OPEN commands, or GET PASSPORT BAG, any semi-colon at all, I suspect) throws %pathreverse way off course. but that's okay, I really am not looking to use this particular feature right now, I just want to get a given speedwalk #path definition (OPEN, GET, etc. and all) into a @variable by referencing is "name" without much fuss.

oh, and a side-note,
#SHOW Reverse path: %pathreverse(2w2n2e2s)
even using a @variable, strangely appends "sd" on the end of the output...
Reverse path: 2n2w2s2esd

I understand about using .shoptilyoudrop to utilize a predefined speedwalk, and ..shoptilyoudrop to reverse the order, but I am looking to use the actual speedwalk definition on-the-fly for purposes other than just moving around the MUD.

-=+*+=-=+*+=-=+*+=-=+*+=-

I have come up with an immediate work-around while I have been attempting to post this to this forum without success (I now see I had to use the computer that is acting as my internet gateway, and not one of the others on the network).

The coding is as follows:

#TRIGGER "speedwalkdir" {&%*{autoquestdirs} assigned to speedwalkdir} {#NOOP}
#PATH speedwalkdir
#T- speedwalkdir

the initial trouble with this is that:
* #1, I have to manually type in a .speedwalkname to get it into the #MAPPER/#PATH cue, but once the #PATH command is executed, the DIR is cleared and then I would have to start over, if I wanted to capture/reference a whole other speedwalk.
* #2, this requires a "&%*{}" trigger (as my #PATH definitions often have OPEN n/e/s/w type commands in them, so have to use a semi-colon alot) running in memory to capture the speedwalk DIRs, unless I go so far as to turn it on/off as needed.

any suggestions?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Jul 27, 2003 5:08 pm   
 
The only methods I can think of right now is by using COM:
#VAR pathRef %session.GetPath("shoptilyoudrop", "")
#SH @pathRef.Value

and using %exec:
#SH %exec(.shoptilyoudrop)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Jul 27, 2003 5:44 pm   
 
Paths are considered aliases. As such they can be expanded with the %alias function. Hrm, should have put a crosslink and example of that in the help.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Jul 27, 2003 5:49 pm   
 
Hmm, interesting, much easier than other methods. I wonder if one day I'll find out all of the hidden functionality in zMUD...

A mention in the %alias reference would be great. There should also maybe be a mention in the #PATH reference, because I don't think people will look in %alias when trying to find out how to programatically expand a path.
Reply with quote
pcghost2k
Newbie


Joined: 24 Feb 2003
Posts: 5
Location: USA

PostPosted: Mon Jul 28, 2003 2:17 pm   
 
thanks go out to both Kjata and Vijilante for your replies to my queries...

Kjata, I do intend to try your lil' piece of coding above. I have already tried the piece of coding presented in the other thread... THANKS! worked like a charm with some minor editing:
[ so that all the | are replaced by ; ]
#EXEC {%concat("#SH %replace(%exec(.", @location, ")"),"|","`;")}

Vijilante, and THANK YOU! %alias(@location) was EXACTLY what I was looking for. No muss, no fuss, straight-forward and true, each and every time.

now that I know who my personal gurus are, look out!! [?j/k?] *snicker*
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