 |
fernir Newbie
Joined: 05 May 2015 Posts: 7
|
Posted: Tue Jun 02, 2015 8:51 pm
Creating Links that perform speedwalks? |
Is it possible? I tried doing it with <send> but it doesn't seem to work.
Code: |
<trigger priority="16410" id="1641">
<pattern>text i want to trigger on</pattern>
<value>#sub { text i want to trigger on ~(speedwalk~)}</value>
</trigger> |
For some reason the forums isn't showing the text right. where it says the speedwalk I have a send that has a #walk command to the room I want it to speedwalk to.
All it does though is send speedwalk (example .ej2e) directly to the mud without expanding it. |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4734 Location: Pensacola, FL, USA
|
Posted: Tue Jun 02, 2015 8:58 pm |
it is quite possible
Code: |
<send '#EXEC {#WALK roomname}'>some text</send> |
|
|
_________________ Discord: Shalimarwildcat |
|
|
 |
fernir Newbie
Joined: 05 May 2015 Posts: 7
|
Posted: Tue Jun 02, 2015 9:13 pm |
Yeah that's exactly what I'm putting in the #sub for it (except with the room's id instead) and it sends the speedwalk unexpanded and since the mud doesn't understand ".k6w" it doesn't work.
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4734 Location: Pensacola, FL, USA
|
Posted: Wed Jun 03, 2015 4:28 am |
Aha... you have to make an alias to run the path and have the send call the alias.
|
|
_________________ Discord: Shalimarwildcat |
|
|
 |
fernir Newbie
Joined: 05 May 2015 Posts: 7
|
Posted: Wed Jun 03, 2015 8:03 am |
I attempted that and it still doesn't work for some reason. https://gist.github.com/fewyn/d3ba6b652fc3b0313dc3 is the output from the script debugger. If I just manually type the #walk and press enter it does the speedwalk perfectly fine but if I make it part of a <send> it doesn't work at all.
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4734 Location: Pensacola, FL, USA
|
Posted: Wed Jun 03, 2015 8:06 am |
#ALIAS walk {#WALK %1}
Code: |
<send 'walk roomnum'>some text</send> |
|
|
_________________ Discord: Shalimarwildcat |
|
|
 |
fernir Newbie
Joined: 05 May 2015 Posts: 7
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4734 Location: Pensacola, FL, USA
|
Posted: Thu Jun 04, 2015 12:09 am |
Very odd... my apologies for not testing it before assuming.
I have no explanation for why this isn't working. |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4734 Location: Pensacola, FL, USA
|
Posted: Thu Jun 04, 2015 12:12 am |
$room=name or number
#FORALL %pathexpand(%pathfrom(,$room)) {%i} |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
fernir Newbie
Joined: 05 May 2015 Posts: 7
|
Posted: Thu Jun 04, 2015 1:31 am |
Getting closer! The intercardinal directions (NE / SE / SW / SE) are showing up as l or h. I tried setting up aliases for those directions and they don't seem to work either. I ended up making aliases on the mud side but it does not move me on the map (because l h j and k aren't real directions)
Thanks for your help so far shalimar! |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Jun 04, 2015 4:26 am |
I use these 2 things:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<func name="PathExpand" copy="yes">
<value>#RETURN %leftback(%subregex($path,"(?:\.|;|\(([^)]+)\)|((\d+)([newshjklud]))|([newshjklud]))","(?(1)\1\||(?(2)%repeat(%concat(@DirTable(\4),""|""),\3)|(?(5)@DirTable(\5)\||)))"),1)</value>
<arglist>$path</arglist>
<notes>.u2els;.(borrow skiff)3s3wsw6s5e3s2wnd</notes>
</func>
<func name="DirTable" copy="yes">
<value>#IF (%ismember($dir,"n|e|w|s|u|d")) {#RETURN $dir}
#SWITCH ($dir)
("h") {#RETURN "nw"}
("j") {#RETURN "ne"}
("k") {#RETURN "sw"}
("l") {#RETURN "se"}
</value>
<arglist>$dir</arglist>
</func>
</cmud> |
And that makes it @PathExpand instead of %pathexpand. The note field on one of the functions is a test value. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
fernir Newbie
Joined: 05 May 2015 Posts: 7
|
Posted: Thu Jun 04, 2015 7:43 am |
Yay! Thanks Vijilante! That works perfect!
|
|
|
 |
|
|