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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
shalimar
GURU


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

PostPosted: Tue Jul 21, 2009 6:50 am   

[3.09] Special Chars
 
There is no option to change or disable the local var symbol $
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jul 21, 2009 4:54 pm   
 
That is correct. This special character cannot be changed. If you are having trouble with MUD commands that use $, give me the specific examples so I can improve the smart command line to handle it. I might even add an option to disable using local variables on the command line. Although most cases I tried, like:
Code:
I just got $100!

worked just fine.

Also, remember that in a script you can always put a ~ character before a special character to prevent it from being parsed.
Reply with quote
shalimar
GURU


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

PostPosted: Wed Jul 22, 2009 12:36 am   
 
That's what i ended up doing, i was trying to parse blocks of text via an onimput trigger, but the overuse of $ forced me into a workaround...

#EXEC {%replace(%clip, "$", "~$")}

I tried going into the part of prefs dealing with special chars to disable it first, and thats when i noticed you couldm't.

P.S. Why can't you exactly? Seems like a break in continuity when every other char can be changed, but this one can't.
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jul 22, 2009 2:49 am   
 
Because local variables are handled within the internal compiler which is very different from how normal variables are handled in the main parser. That's what makes local variables fast and efficient. If local variables were treated the same as regular variables, then they'd be the same and we wouldn't need both.

Still, I'd be interested in the example that didn't work. When using #oninput triggers with the command line it should still work. Try turning on the "prompt" option for the #oninput trigger which forces it to fire *before* any other command line parsing is done.
Reply with quote
shalimar
GURU


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

PostPosted: Wed Jul 22, 2009 4:48 am   
 
No, checking the prompt doesn't seem to help, the problem arrised from when i try to process several lines of text at one time

Code:
<trigger type="Command Input" priority="10" id="1">
  <pattern>^(%d) ({a|an|the|some} *)$</pattern>
  <value>#ADDKEY crashInput {%1=%trim(%2)}</value>
</trigger>


There is the trigger itself

Quote:
1234 a $color bed
2345 an untanned $animal hide
3456 a field mouse


Send all three lines to it at once, and it fails.
Sent it just one line at a time, and its fine.

I was highlighting blocks of text up to 200 lines at a time.
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jul 22, 2009 8:21 pm   
 
The #ONINPUT triggers only process the *entire* command line. CMUD isn't sending each line to the trigger separately...it's sending the full multiline command at once. That's probably not how it should really work, so I'll give it some thought. Has nothing to do with using the $ character or not...it's a general restriction of #oninput triggers right now.
Reply with quote
shalimar
GURU


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

PostPosted: Thu Jul 23, 2009 7:29 am   
 
But it would only fail for me if there was a $ involved... do three lines with no $ and that will work just fine.
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Jul 23, 2009 5:18 pm   
 
Ahh, ok, I see the problem. The difference is that when you enter a multi-line command into CMUD, that turns off the "smart command line" feature and always tries to parse your multi-line command as a CMUD script. Since it's processing the full command as a script, the $ gets treated as a local variable reference.

What you should be able to do is mark your #oninput trigger with the "Prompt" option (and remove the Trigger on Newline option), then add the commands:

#SEND %0
#NOINPUT

to send the command to the MUD after you process it and then prevent the input from being parsed by CMUD.
Reply with quote
shalimar
GURU


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

PostPosted: Thu Jul 23, 2009 7:52 pm   
 
So the smart command line is only smart when it has one command? Gotcha.

Technically, i made that setting when there was no MUD connection to worry about, but its good to know.
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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