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
Jim Vance
Beginner


Joined: 07 Dec 2006
Posts: 16

PostPosted: Mon Jan 26, 2015 10:51 pm   

Returning user needs help with MXP Triggers & Capture
 
After a few years of more graphical games, I have decided to come back to the world of MUDs. I am happy to see that this company and community are still here. I rejoined a MUD that I love and am working on developing an interface using CMUD, but I need some help, if possible. Over the last three weeks, I have reacquainted myself with CMUD scripting but I have finally reached the extent of my coding abilities.

The MUD uses a new MXP-based system to provide clickable links and colored elements. I have decided to separate out chat systems (tells, comm channels, etc) and combat messages into their own windows, and I was hoping to use MXP triggers (or something similar) to create this. I keep running into two problems, multi-line capture and a MXP trigger firing more than once on a single event. I was hoping that some guidance might be given about a better solution than what I have attempted, given below.

Multiline Capture

I have no problem creating a trigger for a single line of text. The problem with multi-line capture has to do with how CMUD recognizes the MXP elements, and I just cannot figure out to create a more specific trigger. Here's an example of the raw MUD output in the form of a tell.

Code:
*<ESC>[0m<ESC>[4z<m17>You tell Carol: thanks. i am thinking i am going to go take a nap and be<ESC>[6z<CR><LF>
 <ESC>[7z     back later<ESC>[4z</m17><ESC>[4z<m17><ESC>[3z<ESC>[7z<CR><LF>


The <m17> element identifies a sent tell; received tells use <m16>. I found a way to grab the entire message using the %0 variable and redirect using the #WINDOW command, but then I get issues with #GAG (I don't want to see the tell in the parent window, only the child window). Plus, all formatting is stripped, which I would like to keep in case color is added to messages.

One thought was to create distinct triggers for single line and then multiple line messages with corresponding amounts of gagging. I spent a while trying to get the trigger to recognize the start of the line in relation to the MXP element, but just never found the right pattern for start or end of the line matches. I wound up using {<m17>*</m17><m17>} to capture everything in between. Not great, because #CAPTURE only grabs a single line effectively. My request would be to help me figure out a way to grab the opening element id, and I can figure out a multi-line solution for the closing id's.

Single trigger, single line, multiple results

Combat uses the element id of <m30>, so I created a similar trigger: {<m30>*</m30><m30>}. Here's an example of the raw MUD output for a one-line combat message:

Code:
<ESC>[0m<ESC>[4z<m30>You <ESC>[4z</m30><ESC>[4z<m30><ESC>[33mgraze<ESC>[4z</m30><ESC>[4z<m30> Mouse.<ESC>[4z</m30><ESC>[4z<m30><ESC>[3z<ESC>[7z<CR><LF>


Here is what my child window showed:

You
You graze
You graze Mouse.

These elements are being used to format colors, so they enclose the default color assigned to any particular event. I think if there was a way to identify the start of a line, then this problem might also go away. Only an entirely different tangent, is there a way for CMUD to see the color being rendered in the main window using a pattern trigger? My thoughts were to set the colors in the MUD to a similar, non-ANSI color and then create corresponding triggers in CMUD to capture to specific windows. Any thoughts?

I apologize for the long-winded post. Any help would be great, especially in regards to making sense of the raw MUD code. Thanks in advance!

Jim
Reply with quote
Jim Vance
Beginner


Joined: 07 Dec 2006
Posts: 16

PostPosted: Sat Jan 31, 2015 10:01 am   
 
After reviewing the MXP specification, I think I have riddled out why the capture does not work the way I would like: the elements used by this MUD are secure or locked, not open.

From my understanding of the specification, secure or locked elements do not have options for client-side adjustment (coloring, child window capture, or gagging).

Does this seem correct? If anyone could confirm this, then I would like to know why a MUD might use MXP for customization but do so with locked/secure tags. It seems like all it would need to do would be to enclose the different types of MUD messages with an opening and closing tag, not use multiple tags on a single line.

Any clarification or insight would be great, thanks.

Jim
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