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
Yaldair
Novice


Joined: 10 May 2003
Posts: 37
Location: Netherlands

PostPosted: Fri Jun 08, 2007 7:20 pm   

= or similar in the command line [all versions]
 
In the mud I play, you sometimes get "codes" for a specific location. Such as:


channel 'locate life' caemlyn
* HP:Healthy SP:Full MV:Strong >

You begin to weave the appropriate flows...

*

*
Ok.
the Caemlyn cityguard - [WWRydSA5IDQ2OTMzZjc0NzMgMTU=] - somewhere far south of here.
the Caemlyn cityguard - [WWRzMSA5IGY5M2JlNWYyYmYgMTU=] - somewhere far south of here.
the Caemlyn cityguard - [WWVxeCA5IGY2ZTMwMjhhYmEgNTA=] - somewhere far south of here.
the Caemlyn cityguard - [WWVscyA5IDJlODA2MzE4MDYgNzk=] - somewhere far south of here.
the Caemlyn cityguard - [WWVweCA5IDM4NjExMjNkYTYgNzU=] - somewhere far south of here.
the Caemlyn cityguard - [WWVvdSA5IGFhNmNjNjFjMjcgODA=] - somewhere far south of here.
the Caemlyn cityguard - [WWVvdSA5IGFhNmNjNjFjMjcgODM=] - somewhere far south of here.
the Caemlyn cityguard - [WWVzcyA5IGEzNTM4M2EyZDMgMTk=] - somewhere far south of here.
the Caemlyn cityguard - [WWVxcyA5IDhiMGRlZjE0Y2EgMzU=] - somewhere far south of here.
the Caemlyn cityguard - [WWVwdyA5IDkzYjliNTdjYjcgMg==] - somewhere far south of here.
the Caemlyn cityguard - [WWVtdiA5IDQ0Nzc2MTIxZDEgODc=] - somewhere far south of here.
the Caemlyn cityguard - [WWVtMCA5IGVlNWNiNWI2M2YgOTQ=] - somewhere far south of here.
the Caemlyn cityguard - [WWVydSA5IDU4ZTBhNTI0ZTIgODg=] - somewhere far south of here.
the Caemlyn cityguard - [WWVrMCA5IDZiODkyMDk0NWQgNTE=] - somewhere far south of here.
the Caemlyn cityguard - [WWVuMSA5IGFkMTRhNWVkMzkgMjA=] - somewhere far south of here.
the Caemlyn cityguard - [WWVveiA5IDRlN2I4ZmYyNGMgNjE=] - somewhere far south of here.
the Caemlyn cityguard - [WWZxMCA5IGI2OTU3YmRjYTkgNzI=] - somewhere far southwest of here.
the Caemlyn cityguard - [WWZxMCA5IGI2OTU3YmRjYTkgNzI=] - somewhere far southwest of here.
the Caemlyn cityguard - [WWZxMCA5IGI2OTU3YmRjYTkgNjM=] - somewhere far southwest of here.
the Caemlyn gatekeeper - [WWV0diA5IDAxOGVjYTQyNDAgMzc=] - somewhere far south of here.
the Caemlyn gatekeeper - [WWV0dSA5IDE3MWVjMTkwMmYgNTc=] - somewhere far south of here.
the Caemlyn gatekeeper - [WWV0dCA5IDY2YjRiNzFkM2EgNzU=] - somewhere far south of here.
the Caemlyn gatekeeper - [WWVzdyA5IDQwODVkYzYxY2IgNTA=] - somewhere far south of here.
the Caemlyn cityguard - [WWVzdCA5IGFlZjVmM2E1N2IgOA==] - somewhere far south of here.
the Caemlyn cityguard - [WWVyMCA5IDgwMDY0ZGFhMjQgNTU=] - somewhere far south of here.

Then, you can go there by typing in your command line:

channel 'travel' WWRydSA5IDQ2OTMzZjc0NzMgMTU=

If you do this however, it will give a parsing error. Which can be solved with the use of ~, but it's not really "handy".

I believe that cmud was supposed to be able to see if the = or ( for example were intended or not. So to see if it's meant as parsing or as just a command. This something not working then yet in this case? because it does work in the case of:

* HP:Healthy SP:Bursting MV:Tiring > say I'm typing somewhat so I can say =
You say 'I'm typing somewhat so I can say ='

So, I figure it has to do with the syntax it's used in?

Thanks in advance,
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Jun 08, 2007 8:27 pm   
 
I'm not seeing the behavior you're are describing at all. I'm able to type it in with no errors.

Alternatively you can start the line with the back tick (`) character which tells CMUD to quote the entire line.
_________________
Asati di tempari!
Reply with quote
Yaldair
Novice


Joined: 10 May 2003
Posts: 37
Location: Netherlands

PostPosted: Fri Jun 08, 2007 11:48 pm   
 
alias
newdest

Pattern
#local $Location
$Location=%1
#addkey Destinations %concat("Familiar.",$Location)=%1
#addkey Destinations %concat("Earthcode.",$Location)=%2
#addkey Destinations %concat("Year.",$Location)=@CurrentTime.Year
#addkey Destinations %concat("Month.",$Location)=@CurrentTime.Month
#say %db(@Destinations,%concat("Familiar.",$Location)) added with the code ~"%db(@Destinations,%concat("Earthcode.",$Location))~"

Now, if I use the Alias like this:

newdest Caemlyn Y2tzdiA5IDIxOTQ1ZjA5OWMgMTU=


It gives a parsing error:

"Parsing error command: illegal token: = "newdest Caemlyn Y2tzdiA5IDIxOTQ1ZjA5OWMgMTU= ""

However, when I use:

new_dest Caemlyn Y2tzdiA5IDIxOTQ1ZjA5OWMgMTU=

I get no error.

Which, to clarify, is not an alias. So if it's being send to the mud, then it DOES work. And there is no parsing error. So it seems that this only happens when you have an alias, and then have a %x which contains an = in my case.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sat Jun 09, 2007 1:46 am   
 
Ok. I've confirmed the behavior your describing. Basically if there an '=' in any alias parameters you get a parsing error. A similar problem occurs with '#' but I don't think that can be addressed. Zugg will have to weigh in on what, if anything, can be done about this one.

On the up side, there are several simple workarounds.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat Jun 09, 2007 2:20 am   
 
You are sending a string value to your alias, so you need to put double-quotes " around it to prevent the parsing error. So you should call your alias like this:
Code:
newdest Caemlyn "Y2tzdiA5IDIxOTQ1ZjA5OWMgMTU="

The quotes won't be sent to the alias, but they are needed to handle the special characters, just like if you wanted to put a space character in there. This is how CMUD works and there isn't anything I plan to change with this. Just like with other programming languages, you just have to be more careful putting quotes around string values. zMUD was more lenient about this because it wasn't compiled.
Reply with quote
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Wed Jun 13, 2007 7:19 pm   
 
Quote:
On the up side, there are several simple workarounds.


I have the following alias to color my chats randomly. (my mud uses the ` char and a letter to color text)

Code:
#execute {%1 `%item(b|d|e|f|g|h|i|j|k|l|m|n,%random(1,12))%-2}

so...
rcc chat asdf
would produce... chat `basdf

but i cannot use smilies like :( or the = char, etc

is their simple workaround for this?

is there anyway of not having to do... rcc chat "i died :(" or rcc chat "cmud=thebestmudclient"
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Wed Jun 13, 2007 10:22 pm   
 
Yaldair how about using a trigger instead of an alias?

Type:Command Input
Pattern:^newdest (%w) (*)
Script:
Code:
#gag
#local $Location
$Location=%1
#addkey Destinations {%concat("Familiar.",$Location)=%1}
#addkey Destinations {%concat("Earthcode.",$Location)=%2}
#addkey Destinations {%concat("Year.",$Location)=@CurrentTime.Year}
#addkey Destinations {%concat("Month.",$Location)=@CurrentTime.Month}
#say %db(@Destinations,%concat("Familiar.",$Location)) added with the code ~"%db(@Destinations,%concat("Earthcode.",$Location))~"
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Jun 14, 2007 12:26 am   
 
makena wrote:
is their simple workaround for this?

is there anyway of not having to do... rcc chat "i died :(" or rcc chat "cmud=thebestmudclient"


The problem you are having is because you are calling the #EXECUTE command. That tells CMUD to parse the string as if they were valid CMUD commands. The smiley face will be an error because :) would be bad syntax without the benefit of the smart command line parsing.

Simply removing the #EXECUTE command in this case should do the trick. At least it worked for me.

Change your command to this
Code:
%1 `%item(b|d|e|f|g|h|i|j|k|l|m|n,%random(1,12)) %-2
_________________
Asati di tempari!
Reply with quote
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Thu Jun 14, 2007 8:39 am   
 
the smiley :) does work WITH execute. its the :( smiley that throws the error, regardless of the execute command or not..
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Thu Jun 14, 2007 10:28 am   
 
That'll be because of the unmatched bracket. I'm not sure that there's a decent way around it - you could try using the %string function to convert %-2 into a string (and quote it), but the #exec command will probably strip the quotes when it runs.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Thu Jun 14, 2007 10:44 am   
 
Makena your problem is also amenable to the #oninput trigger solution as well.

Type:Command Input
Pattern:^rcc (%w) (*)
Script:%1 `%item(b|d|e|f|g|h|i|j|k|l|m|n,%random(1,12))%-2
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Jun 14, 2007 5:11 pm   
 
You guys really need to start using explicit %concat statements more. It would really solve a lot of the problems that I've seen posted. zMUD allowed some really lazy implied concat syntax that is ambiguous in a compiled language like CMUD. Here is a form of your script that would work no matter what text you sent it:
Code:
#execute {%1 %concat("`",%item(b|d|e|f|g|h|i|j|k|l|m|n,%random(1,12)),%-2)}

or, you can use the + operator in an expression like this:
Code:
%1 ("`" + %item(b|d|e|f|g|h|i|j|k|l|m|n,%random(1,12)) + %params(2))

Using the + operator is exactly the same speed as doing implied concat. Using the explicit %concat function is only very slightly faster. And if you are using #EXEC, none of the speed issues will matter since #EXEC itself is a slow way to do stuff.
Reply with quote
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Thu Jun 14, 2007 5:43 pm   
 
Zugg, neither of those work with the :( smiley either.

I can't even get the second example to compile, using the following

#alias rcc {%1 ("`" + %item(b|d|e|f|g|h|i|j|k|l|m|n,%random(1,12)) + %params(2))}

Dharkael, an oninput trigger works like the other example i posted, it works, but not for :( smileys, = signs, etc...
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Thu Jun 14, 2007 6:48 pm   
 
Hmm...Really It worked for me? It doesn't work if you use #execute but for the example you posted #execute is not necessary.
Did you try it exactly as I suggested?
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Fri Jun 15, 2007 9:19 pm   
 
Yes, I tried again Dharkael and it worked. All is well!
Thank you for making me try it again Surprised
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