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
xiphoid
Newbie


Joined: 12 Jun 2008
Posts: 2

PostPosted: Thu Jun 12, 2008 9:27 am   

a=b syntax
 
Is there any way to emulate zMUD's "a=b syntax" toggle in cMUD?

The MUD that I play uses "=" as a command separator and I simply can't get used to escaping it on the command line.

Is there any way to preprocess input using lua or something similar?

All suggestions gratefully received.
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Jun 12, 2008 5:15 pm   
 
The simple way to send the command line to the MUD verbatim without parsing is to enclose the entire command in " quotes, or start the command with the ` line-escape character. But you can also completely control the command line parsing using #ONINPUT triggers.

To generate an #ONINPUT trigger to capture this and override it, go into the Settings Editor and create a New Trigger. In the pattern, enter:

(*)=(*)

and in the Trigger Type pulldown box in the "More" panel along the bottom, select "Command Input" as the trigger type. Then, uncheck the "Trigger on Newline" and CHECK the "Trigger on Prompt" option. This is the most important option. When you select "Trigger on Prompt" for a Command Input (#ONINPUT) trigger, CMUD will call your trigger *before* it attempts to parse the command line as a normal script command.

In the Script part of the trigger, you can just do this:

#SEND %1"="%2
#NOINPUT

and it will send the original command to the MUD and then prevent the command line input from getting parsed.
Reply with quote
xiphoid
Newbie


Joined: 12 Jun 2008
Posts: 2

PostPosted: Fri Jun 13, 2008 10:57 pm   
 
Thanks very much for the prompt and detailed reply.
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