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


Joined: 02 Dec 2003
Posts: 1

PostPosted: Tue Dec 02, 2003 4:14 am   

how to code ansi trigger??
 
I'm trying to write a set of triggers that are based on the color of text outputted by my mud, anyone know of a way to do this?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Dec 02, 2003 7:36 pm   
 
Yes.
Highlight the text you want to match with the mouse.
Open the Settings Editor by clicking the Triggers button.
Click the New button.
Put "something" in the Pattern. (to prevent access violations if you accidentally save before you get the real pattern in place)
Switch to the Options tab.
Under Other Options select ANSI Trigger.
Switch to the Pattern tab.
Click on the Pattern field.
Press CTRL-V.
Edit the pattern as needed.
Put any commands you want executed in the Value field.
Make any other desired changes.
Click the Save button.
Reply with quote
musishun00
Wanderer


Joined: 16 Dec 2003
Posts: 77
Location: USA

PostPosted: Fri Jan 30, 2004 7:14 pm   
 
Is there any way to get this to work with wild cards? Here's the text from the mud that I'm using.

The cloak around An Abandoned Soul is ripped to shreds!

The word "cloak" is different colors depending on which cloak is dispelled. I've got the trigger working specifically for the enemy above, but I tried this trigger:

The %e[1;31mcloak%e[0m around * is ripped to shreds!

in which "cloak" is colored red for a fire cloak, but it won't catch the * wildcard for seperate opponents. Any thoughts on why the * isn't working to catch different opponents' names?

EDIT: Basically what I need is for "cloak" to be the only word that *needs* to be checked for color... Everything else doesn't really matter.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jan 30, 2004 11:56 pm   
 
If the rest of the line doesn't matter, then don't put it in the pattern.
The %e[1;31mcloak%e[0m around

In the current public version, there are several special characters which * won't match. One of these is the semi-colon. If there may be additional color changes which use the semi-colon then you'll have trouble coming up with a workable pattern using wildcards. The simplest solution is not to bother. End the pattern before the additional color changes will occur.
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