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
symposes
Novice


Joined: 26 Apr 2006
Posts: 34

PostPosted: Sun Nov 30, 2008 1:25 am   

trigger to capture ansi colors?
 
I have an interesting setup id like to use, But I have no idea how to even do this.

What I would like to do, is make a trigger that captures the ansi color.

The trick is that I can check the strength of a power stone by the color of its glow.
the colors and the respective level arent important.

Im not entirely sure what Ill do with it if i can even make this work.

basicly when i check the stone, the line is the same,

You feel a power radiating from the stone.

but it will be different colors, ranging from blue to yellow and then finally red.

Id like to not have alot of windows open, if its even possible to put in on the face of a button, that would be interesting...

If its not possible to do, Ill get over it and move on. Its not important, just one of those, can it be done things.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Nov 30, 2008 1:46 pm   
 
The easiest way would probably be to have more than one ANSI trigger, one for each colour type, that then sets the colour. Check the ANSI trigger box in a trigger's options and then paste the line into the pattern box and the ANSI codes should appear - then you can set a variable with the value you want.

I'm not sure what you mean about having a lot of windows open.

To display it on the face of a button, you could set the variable to numbers 1, 2 and 3 for blue yellow and red, and then put %ansi(%case(@VarName,blue,yellow,red)) as the caption of the button.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
symposes
Novice


Joined: 26 Apr 2006
Posts: 34

PostPosted: Sun Nov 30, 2008 2:50 pm   
 
I had thought i might have to use the capture triggers for capturing lines of text.
the #c+ and #c- kind of capture.

thanks ill look into that
Reply with quote
symposes
Novice


Joined: 26 Apr 2006
Posts: 34

PostPosted: Sun Nov 30, 2008 2:55 pm   
 
I dont seem to be having much luck getting it to generate the ansi values with the text i want to put in...

I check that ansi box, and copy paste the line, and it just goes in as standard text.

I think i may be overlooking some key thing.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Nov 30, 2008 5:10 pm   
 
It won't go in colored, but it'll have an escape code at the beginning of the text. If it doesn't, there may be something else that you are missing. :P

Charneus
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Nov 30, 2008 6:12 pm   
 
Mmm, it'll have %e[38m where 38 is any number or other ANSI sequence.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
symposes
Novice


Joined: 26 Apr 2006
Posts: 34

PostPosted: Sun Nov 30, 2008 9:01 pm   
 
yea, it just goes in like normal text, without the ansi color codes.


so I guess i am missing something. Perhaps a setting in the preferences that i dont know about.
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