About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
fernir
Newbie


Joined: 05 May 2015
Posts: 7

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4734
Location: Pensacola, FL, USA

PostPosted: Tue Jun 02, 2015 8:58 pm   
 
it is quite possible

Code:
<send '#EXEC {#WALK roomname}'>some text</send>
_________________
Discord: Shalimarwildcat
Reply with quote
fernir
Newbie


Joined: 05 May 2015
Posts: 7

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4734
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
fernir
Newbie


Joined: 05 May 2015
Posts: 7

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4734
Location: Pensacola, FL, USA

PostPosted: Wed Jun 03, 2015 8:06 am   
 
#ALIAS walk {#WALK %1}
Code:
<send 'walk roomnum'>some text</send>
_________________
Discord: Shalimarwildcat
Reply with quote
fernir
Newbie


Joined: 05 May 2015
Posts: 7

PostPosted: Wed Jun 03, 2015 8:54 pm   
 
I'm starting to think this just isn't possible. Using the alias also doesn't expand it. (Debugger looks pretty much the same) https://gist.github.com/fewyn/61167c6c183e1edbbfb4
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4734
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4734
Location: Pensacola, FL, USA

PostPosted: Thu Jun 04, 2015 12:12 am   
 
$room=name or number
#FORALL %pathexpand(%pathfrom(,$room)) {%i}
_________________
Discord: Shalimarwildcat
Reply with quote
fernir
Newbie


Joined: 05 May 2015
Posts: 7

PostPosted: 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!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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
Reply with quote
fernir
Newbie


Joined: 05 May 2015
Posts: 7

PostPosted: Thu Jun 04, 2015 7:43 am   
 
Yay! Thanks Vijilante! That works perfect!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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