Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
misterbalrog Posted: Sat Jan 29, 2005 2:57 pm
tired of %quote bugging...
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Mon Jan 31, 2005 10:08 am   
 
Summary:

1. Using an Alias.
Quote:
#AL goss {gos @randcolor%literal(%quote(%-1))&+y}
    Strange, using the above with commas work for me now, not sure why it did not seem to work earlier, but it still has problems with the semicolon character.


2. Using an OnInput Alias.
Quote:
#ONINPUT {^goss3 (.+)$} {gos %literal(@{randcolor}%1)&+y} "" {case|notrig|regex}
    Semicolons do not work with #1 and #2 because they are automatically parsed into multiple lines before the aliases can use the input. Even if command-line parsing (eg. the #verbatim 0) was turned off, aliases do not work.


3. Using a Prompt and a Variable.
Quote:
#AL goss2 {#PR gossmessage {What do you want to gossip?};gos %literal(@randcolor@gossmessage)&+y}
    Semicolons work with #3.


PS It seems that if you allow [] or () for eval in your script parser settings, you will not be able to stop its evaluation in the command-line or pop-up prompt unless they are manually prefixed with tildes.

Good?
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Mon Jan 31, 2005 12:59 pm   
 
actually I have no problem with parenthesis... perhaps If I try and use it as a smiley... lemme try it.. nope... no problem there either...

The only thing I do have a problem with is if I use both [ and ] in the same sentence in that order... if I use them ] and [ there will, ofcourse, not be a problem. but that could be fixed with a %replace I think... but .. I don't use such smileys.. so I'll manage...

=)
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Mon Jan 31, 2005 3:24 pm   
 
Oh.. just noticed... with %concat, commas stop working....

and with @{randcolor} the variable is not expanded, it just ends up blank, it returns NULL... so no color code applied...

and with @randcolor%1&+y , the first word vanishes and no color code is applied...
Reply with quote
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Mon Jan 31, 2005 6:57 pm   
 
misterbalrog wrote:
actually I have no problem with parenthesis... perhaps If I try and use it as a smiley... lemme try it.. nope... no problem there either...

The only thing I do have a problem with is if I use both [ and ] in the same sentence in that order... if I use them ] and [ there will, ofcourse, not be a problem. but that could be fixed with a %replace I think... but .. I don't use such smileys.. so I'll manage...

=)

I suggest turning off [] and () evaluation in your settings, since you intend to enter those characters directly into the command-line or prompt without evaluation.

misterbalrog wrote:
Oh.. just noticed... with %concat, commas stop working....

and with @{randcolor} the variable is not expanded, it just ends up blank, it returns NULL... so no color code applied...

and with @randcolor%1&+y , the first word vanishes and no color code is applied...

You may be seeing weird things going on because you did not use %literal() in the right places to prevent immediate evaluation of variables (eg. @{randcolor}) when entering the script from the command line or from a script import. @{randcolor} - with the braces, does not prevent it from being expanded, rather it could have been expanded too early.
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Mon Jan 31, 2005 7:37 pm   
 
Que?

I did not enter the script from commandline, I altered the existing one with the editor. I don't do script imports either..

Like I said, it doesn't evaluate () at all, but [] it does... however, since I don't use such smileys, I can keep the evaluation still intact, cuz if I uncheck it, it will affect other triggers/scripts...

Basically, I will not alter anything in the settings cuz I have the current ones as they are for a reason. I've toggled em on and off depending on diff sets of scripts and triggers. If I were to change smth it will affect something else... thus I don't wanna ruin anything by toggling them... Esp since it's ONLY going to affect if I use [] (both are needed, and in that order) in a sentence, which normally are not ever used in a sentence anyway except for smileys (which I don't have a habit of using)..

However, I've temporarily fixed the trigger by just putting the @randcolor script in the trigger directly... that fixes the comma problem...

But I'd still like to get that to work properly (using @randcolor that is)..


Additionally, if @{randcolor} does get expanded too early, then that's just silly... why should/would it do that?

(tho that seems to be the effect, since if a variable contains "&+" and you do #echo @var, it shows "&+", but with #echo @{var} it shows "", it could be just hateful against the amphersand...)

Edit: Using %expand on @randcolor worked just fine...

so the content of the trigger you made earlier (the oninput one) looks like this:

goss %expand( @randcolor)%1&+y
Reply with quote
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Mon Jan 31, 2005 8:00 pm   
 
Try using the lines of script I typed out in my earlier post. http://forums.zuggsoft.com/phpbb/viewtopic.php?t=19754&postdays=0&postorder=asc&start=14

Enter them into the command line, not the script editor. They were meant for command line input.

If you are using the first alias, remove the %quote(), I got it mixed up with another thread.

misterbalrog wrote:
Like I said, it doesn't evaluate () at all, but [] it does... however, since I don't use such smileys, I can keep the evaluation still intact, cuz if I uncheck it, it will affect other triggers/scripts...

Basically, I will not alter anything in the settings cuz I have the current ones as they are for a reason. I've toggled em on and off depending on diff sets of scripts and triggers. If I were to change smth it will affect something else... thus I don't wanna ruin anything by toggling them... Esp since it's ONLY going to affect if I use [] (both are needed, and in that order) in a sentence, which normally are not ever used in a sentence anyway except for smileys (which I don't have a habit of using)..

I guess you will have to change your triggers and scripts. IMHO using [] for evaluation is unneccesary and only a minor convenience in your script. In this case, it is a hindrance.

misterbalrog wrote:

Additionally, if @{randcolor} does get expanded too early, then that's just silly... why should/would it do that?

That applies to command-line entry of the script.
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Mon Jan 31, 2005 11:11 pm   
 
I'm using the ONINPUT... but instead of %literal, it's using %expand on the @randcolor variable... works just fine now.
Reply with quote
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Tue Feb 01, 2005 2:33 am   
 
As I said in the other thread, %literal is used in command line input of a script.

Your @randcolor uses %expand only because it requires recursive expansion.

They are 2 seperate things.

Cheers
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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