 |
dikiy Newbie
Joined: 25 Sep 2003 Posts: 3 Location: Russia
|
Posted: Thu Sep 25, 2003 6:40 am
ESC-sequences |
How can explain me - WHAT codes Zmud uses?
I look thru some colored log-files, and saw very strange sequences, such as ESC[52m.
As far I know, in ESC[attr;attr;attr;...m, used for color text, attr CAN NOT be 52!
Look at this: http://www.bluesock.org/~willg/dev/ansi.html
So, the question: where I can see the list or ESC-codes, used by Zmud. |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Sep 25, 2003 4:52 pm |
The ANSI codes in colored log-files are the ones sent by the MUD.
|
|
|
 |
dikiy Newbie
Joined: 25 Sep 2003 Posts: 3 Location: Russia
|
Posted: Fri Sep 26, 2003 8:31 am |
No, that MUD does not send such sequenses.
Colored messages in log-files with strange attr generated by user triggers.
They give my example of such trigger:
#TRIGGER {Now you can revenge to (%w) !} {#color 11,20} "Fight" {case}
This one produce such log-file (ESC = escape character, #1b HEX):
ESC[56;41mNow ayou can revenge to Zlata ! ESC[0m
Maybe, bug in Zmud? |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Sep 26, 2003 4:18 pm |
Well, it would seem you could answer your own question then. Since you control the input, you can experiment to find out what 56 means.
It's not really surprising that you get odd results, since you use non-legitimate arguments to %ansi. The second argument to %ansi is the background color, which is limited to the non-bright colors numbered 0 to 7. 20 is NOT a legitimate value.
I don't think there's any documentation of non-standard internal ANSI sequences used by zMUD. |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Sep 27, 2003 12:29 am |
My own experiments indicate that 52 is bright green and 56 is bright cyan.
This was fairly simple:
#SHOW this is an ANSI test: %ansi( hi,black)hiblack, %ansi( hi,blue)hiblue, %ansi( hi,green)higreen, %ansi( hi,cyan)hicyan, %ansi( hi,red)hired, %ansi( hi,magenta)himagenta, %ansi( hi,brown)hibrown, %ansi( hi,gray)higray
Then highlight the line, and use CTRL-V to paste it as the pattern of an ANSI trigger.
this is an ANSI test: %e[50mhiblack, %e[54mhiblue, %e[52mhigreen, %e[56mhicyan, %e[51mhired, %e[55mhimagenta, %e[53mhibrown, %e[57mhigray
From which it is easily determined that zMUD uses these additional parameters with ESC[*m (SGR):
50 hiblack
51 hired
52 higreen
53 hibrown
54 hiblue
55 himagenta
56 hicyan
57 higray |
|
|
 |
dikiy Newbie
Joined: 25 Sep 2003 Posts: 3 Location: Russia
|
Posted: Mon Sep 29, 2003 8:15 am |
Now I see, Zmud does not check values, passed to #color and silently mod(%color, 7). In log file it put value 30+%color for foreground and 40+%color for background...
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Sep 29, 2003 9:41 am |
%ansi, #CW, and other means of applying color can be used either with words; such as red, blue, cyan, blink; or with numbers. With words, you use one word for each non-color attribute, one word for the foreground color, and one word for the background color. With numbers, you use one number for everything. If you want bright (8) cyan (3) on red background (64), you add all that up (8 + 3 + 64) and use 75.
It's much easier for most people to just use the words, especially since the tables explaining how the numbers are derived was deleted when Help was updated.
In any case, the numbers used with %ansi don't have any direct correlation with the numbers used in the ANSI escape sequences.
EDIT: The table should still be available from the online version of 5.55 Help in the Support Library. I believe it's in the entry for #COLOR. |
|
|
 |
|
|
|
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
|
|