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
Evilness
Beginner


Joined: 05 Mar 2008
Posts: 10

PostPosted: Mon Mar 10, 2008 3:06 pm   

Need an explanation please
 
Ok, just switched to CMUD. I had an alias setup to speak oocly with my guild like this:

gdt `5-`4=`%[`7ooc`%]`4=`5-`% %1

the ` followed immediately by a number/shift number symbol is how our color system works. Never had a problem with it before.

In CMUD, it will show the colors, the -=[ooc]=- and then the %1, just like this:

[guildname](rank)(guildtitle) playername: '-=[ooc]=- %1'

What do I need to do? #alias isn't very helpful in the help file. According to it, should still work.
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Mon Mar 10, 2008 3:58 pm   
 
Interesting. I got a syntax error just putting that into an alias (due to the equals-signs not being escaped). Could you post the XML for your alias for testing?

To get the XML, open the Settings Editor (Ctrl-G), select your alias, and click the XML tab under the code.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Mon Mar 10, 2008 4:03 pm   
 
You're looking for %-1 for one.... That takes all the text you type in after the alias name.
But JQ is right, you need to escape the equal signs (should have in zMUD, but zMUD isn't as picky)
Should be:

gdt `5-`4~=`%[`7ooc`%]`4~=`5-`~% %-1

This is assuming from your description that the `% is also a color code. In which case you have to escape it as well.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Evilness
Beginner


Joined: 05 Mar 2008
Posts: 10

PostPosted: Mon Mar 10, 2008 4:03 pm   
 
<alias name="gd" id="443">
<value>gdt `5-`4=`%[`7ooc`%]`4=`5-`% %1</value>
</alias>

There you go. When I imported it from text file via the editor, I got the same error for the =. I closed that, redid the alias and no problem, cept it won't accept any speech after the last -
Reply with quote
Evilness
Beginner


Joined: 05 Mar 2008
Posts: 10

PostPosted: Mon Mar 10, 2008 4:08 pm   
 
Okay, sorry for the double post but, I did as you said, ralgith, and worked. Now, why am I 'escaping' the = signs and the color code %?
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Mon Mar 10, 2008 4:10 pm   
 
Evilness wrote:
I closed that, redid the alias and no problem

Not exactly. You still have the illegal token error, and the alias won't compile. So that's why the %1 isn't getting substituted. To verify, click on the 'Compiled Code' tab, and you'll see the error instead of bytecodes. And when I run 'gd foo' at the command-line, I get 'gdt `5-`4=`%[`7ooc`%]`4=`5-`% %1' in the window.

CMUD is a bit stricter about quoting, special characters, and the like. So replace your alias with the following, which has the '=' escaped, and also uses %-1 to get all the arguments:
Code:
<alias name="gd" id="1">
  <value>gdt `5-`4~=`%[`7ooc`%]`4~=`5-`% %-1</value>
</alias>


That will give 'gdt `5-`4=`%[`7ooc`%]`4=`5-`% foo' when run.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Mar 10, 2008 4:49 pm   
 
You'd probably find it a lot easier just to do:

gdt "`5-`4=`%[`7ooc`%]`4=`5-`%" %-1

in the alias. It's the same number of characters in this example, but if you had any more complex collections of colour codes with many =s, it'd save you some typing.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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