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
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Oct 21, 2011 8:26 pm   

[3.34pro]#send inserting extra characters into variable arguments
 
Through some other scripts that figure out the validity of a speedwalk destination, I get this speedwalking path as generated via %walk()
Quote:
.(enter hole)17n


Once the destination has been validated and I am ready to actually start traveling, I raise this onWalkBegin event that takes the vnum as the only parameter (the second and subsequent #print $path commands are for debugging purposes).
Code:
<event event="onWalkBegin" priority="3520" id="582">
  <value><![CDATA[$zone = %zonename(%roomzone($vnum))
#print %concat("<color red>MAP (runto):</color><color yellow>Commencing speedwalk to</color> <color sandybrown>",$zone,"</color><color yellow>.</color>")
$path = %walk($vnum)
#print $path
$path = %replace(%replace($path,");",";"),")",";")
#print $path
$path = %replace(%replace($path,".(",""),".","")
#print $path
$path = %replace($path,";","|")
#print $path
#forall $path {
  #if (%match(%i,"^[newsud%d]$")) {#send "run "%i} {#send %i}
}]]></value>
  <arglist>$vnum</arglist>
</event>


This produces the following output.

Quote:

.(enter hole)17n
.(enter hole;17n
enter hole;17n
enter hole|17n
.(<enter hole>)
run 17n


I dunno where the stuff in red is coming from, but as far as I can tell it's being inserted by #SEND.
_________________
EDIT: I didn't like my old signature
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sat Oct 22, 2011 2:04 am   
 
I've had this problem before, sporadically. IIRC, it was happening when I tried to use paths in MXP send links, which probably uses the same code as #SEND. I can't reproduce it now with your event though...
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Sat Oct 22, 2011 2:25 am   
 
Interestingly enough, I didn't encounter that problem when I tried it: I tried the speedwalk from my manor to a clan hall and the generation was what one would have expected. The only difference is that I tried it as an alias.
Code:


<alias name="test4" id="1027">
  <value><![CDATA[$zone = %zonename(%roomzone($vnum))
#print %concat("<color red>MAP (runto):</color><color yellow>Commencing speedwalk to</color> <color sandybrown>",$zone,"</color><color yellow>.</color>")
$path = %walk($vnum)
#print $path
$path = %replace(%replace($path,");",";"),")",";")
#print $path
$path = %replace(%replace($path,".(",""),".","")
#print $path
$path = %replace($path,";","|")
#print $path
#forall $path {
  #if (%match(%i,"^[newsud%d]$")) {#send "run "%i} {#send %i}
}]]></value>
  <arglist>$vnum</arglist>
</alias>


the speedwalk generated is .(pcan)su [pcan is the script that invokes the recall portal]

The output:
Quote:

.(pcan)su
.(pcan;su
pcan;su
pcan|su
pcan
run su


I admit that nothing I did showed that there is anything in your script generating the extra characters. I just can't recreate your output.
I tried it both with RoomID and RefNum and it made no difference.
_________________
Sic itur ad astra.
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