|
Churlant Novice
Joined: 17 Oct 2002 Posts: 44 Location: USA
|
Posted: Fri Dec 07, 2007 9:42 pm
Another Quickie |
I'm trying to record runs in the proper format using hunt. Now I can capture directions, but consolidating duplicate movements is tricky (or so it is for me.)
Basically here's what I have at the end of a hunt:
run down|down|down|down|down|east|east|north|west
How do I write a trigger (or whatever) that will change the above input to:
run 5d2enw
? |
|
_________________ >-Churlant-< |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Dec 07, 2007 9:54 pm |
I think you are looking for the %pathcompress function. Post back it you can't get what you want done from that.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Churlant Novice
Joined: 17 Oct 2002 Posts: 44 Location: USA
|
Posted: Fri Dec 07, 2007 10:36 pm |
It has promise, but I think my zmud isn't a big fan of the function. I expect there's some checkbox I need to fix or something... this is what I get
As as an example, I enter:
#SHOW %pathcompress(n|n|n|n)
And I get:
(n);(n);(n);(n)
Any ideas? |
|
_________________ >-Churlant-< |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Dec 07, 2007 10:54 pm |
The only idea I have is that you do not have #DIRECTION settings enabled for the standard English directions. The defaults include such definitions and enable them by default. Wiithout more information to go on I really can not say what the failure is.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Dec 08, 2007 3:32 am |
To add more detail, open the package editor and select Show Default Packages on the View menu. You should have two packages called EnglishDirections and EnglishKeypad loaded. The untitled session doesn't load these packages, so don't use that for this kind of testing.
|
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Sat Dec 08, 2007 2:09 pm |
Guys, its ZMud General Forum :P
Btw, I did enter the %pathcompress example you gave, Churlant, and it gave .4n as supposed to. I guess the best I could suggest is to check if you have "." set as "speedwalking character". I'm not sure, however, if that would do the trick.
Prog |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Dec 08, 2007 2:27 pm |
I pulled a Tech :(
Sorry, Churlant. |
|
|
|
Churlant Novice
Joined: 17 Oct 2002 Posts: 44 Location: USA
|
Posted: Mon Dec 10, 2007 4:23 pm |
Well I fiddled with the directions (re-added them, as suggested they were absent), but the function still doesn't seem to like me...
...SO... can anyone think of another way to get what I'm after? The mud will actually take run nnnneuuuss commands in place of run 4ne3u2s... so the hurdle is the | character I suppose.
Any suggestions? |
|
_________________ >-Churlant-< |
|
|
|
Churlant Novice
Joined: 17 Oct 2002 Posts: 44 Location: USA
|
Posted: Mon Dec 10, 2007 11:25 pm |
Stupidity on my part.. as always, making things complicated.
Okay, so I have a very simple:
#TR {You catch the scent of *, heading (%w)} {#ADD direction %1}
After the hunt, I just clear the variable. Now all I need is to cut down full directions (north, south, etc) to their first letters (n, s). Please don't kill me.. I KNOW that function is out there, but I'm fried... soon as someone can give me a way to capture the first letter only, I'm in business.
Thanks again! |
|
_________________ >-Churlant-< |
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Mon Dec 10, 2007 11:29 pm |
Code: |
#TR {You catch the scent of *, heading (%w)} {#ADD direction %left(%1,1)}
|
Prog |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
Churlant Novice
Joined: 17 Oct 2002 Posts: 44 Location: USA
|
Posted: Tue Dec 11, 2007 3:26 pm |
Brilliant again.. it is done. Proving once again there is more than one way to skin a cat. :)
Thanks all for the help!
-JC |
|
_________________ >-Churlant-< |
|
|
|
|
|