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
unrealtor
Beginner


Joined: 23 May 2020
Posts: 18

PostPosted: Tue Mar 26, 2024 5:00 pm   

ANSI Color Detecting for Trigger
 
Using CMUD, I am looking to see if its possible to detect the ANSI encoding coming from the mud to the client, so that a trigger can detect it and perform based on different color codes being sent.

For context: I am trying to set a DB Rec var with a list of mobs, that is built on the fly, when I enter a room. Since the mud I play allows assigning a unique ANSI color specifically for mobs, it seems to be far easier and less intensive to approach it this way, than to maintain by manual input (considering that this mud has no fixed part of the description to identify a mob over any other chunk of text / descriptions can change / new mobs added over time).

Is there possibly a way to create a trigger off the incoming ANSI codes?

Thanks in Advance!
Reply with quote
unrealtor
Beginner


Joined: 23 May 2020
Posts: 18

PostPosted: Wed Mar 27, 2024 3:27 am   
 
I figured out what I needed, so I'll share. The issue that I was fighting was that %1 (etc) was not returning any value, so it felt that it was not capable of capturing. However getting the whole value is simplified anyways by just calling %trigger, and in my case, thats what I want to store.

<trigger priority="9270" ansi="true" id="927">
<pattern>%e[37m*%e[0m</pattern>
<value>#say %stripansi(%trigger)</value>
</trigger>
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