|
symposes Novice
Joined: 26 Apr 2006 Posts: 34
|
Posted: 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. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
symposes Novice
Joined: 26 Apr 2006 Posts: 34
|
Posted: 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 |
|
|
|
symposes Novice
Joined: 26 Apr 2006 Posts: 34
|
Posted: 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. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Nov 30, 2008 6:12 pm |
Mmm, it'll have %e[38m where 38 is any number or other ANSI sequence.
|
|
|
|
symposes Novice
Joined: 26 Apr 2006 Posts: 34
|
Posted: 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. |
|
|
|
|
|