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
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Sat Oct 08, 2016 5:16 pm   

Allow Mud-Side Tags to Pass Through, But Not Capture
 
I'm having a difficult time with this... I'm playing a MUD that has color triggers. &W for white or &z for black and such.

An often-used command is something like: makearmor sienarium about cover &wA S&zuit &wo&zf &wD&zurasteel &wA&zrmor&G&w

But when I set an alias to capture it, it will not capture the full syntax with colorcodes. What I'd like for it to do is output the syntax with colorcodes to the MUD (&wA S&zuit &wo&zf &wD&zurasteel &wA&zrmor&G&w) but store just "A Suit of Durasteel Armor" in a variable.

Any ideas?
Reply with quote
shalimar
GURU


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

PostPosted: Sat Oct 08, 2016 5:39 pm   
 
Try using #SENDRAW if your codes are getting eaten in parsing.
You can use %replace if you know exactly what you are trying to strip out.
_________________
Discord: Shalimarwildcat
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Sat Oct 08, 2016 6:35 pm   
 
Code:

startarmor_material = %1
startarmor_location = %2
startarmor_covering = %3
startarmor_name = %-4

makearmor @startarmor_material @startarmor_location @startarmor_covering @startarmor_name


This is the alias (STARTARMOR) that I have. I'm trying to work through how to do such a thing. Perhaps startarmor_name with the %replace covering all possible colorcodes? Does sendraw work with variables?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Oct 09, 2016 1:26 pm   
 
I doubt the problem is in the sending, but you can add #SEND or #SENDRAW to your makearmor line in the alias. I think the problem is that the & is special character so the command line is trying to do something with it. Using quotes should get the proper value passed to the alias.

startarmor sienarium about cover "&wA S&zuit &wo&zf &wD&zurasteel &wA&zrmor&G&w"
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
shalimar
GURU


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

PostPosted: Sun Oct 09, 2016 2:21 pm   
 
%replace(%replace(%replace(@startArmor_name, "&w"), "&z"), "&G")

As for #SENDRAW, it does evaluate functions and variables unless you quote (tilde ~) out the operative character or "surround your @string in quotes"

do=look
#SENDRAW @do
sends look
#SENDRAW ~@do
sends @do
#SENDRAW {@do}
sends look
#SENDRAW "@do"
sends @do

You might want to switch that over to local $variables unless you have a need to use them in other settings
Otherwise it seems odd that you need an alias for this at al... just do :

#SENDRAW "makearmor sienarium about cover &wA S&zuit &wo&zf &wD&zurasteel &wA&zrmor&G&w"
_________________
Discord: Shalimarwildcat
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