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


Joined: 25 Sep 2003
Posts: 3
Location: Russia

PostPosted: 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.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 25, 2003 4:52 pm   
 
The ANSI codes in colored log-files are the ones sent by the MUD.
Reply with quote
dikiy
Newbie


Joined: 25 Sep 2003
Posts: 3
Location: Russia

PostPosted: 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?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
dikiy
Newbie


Joined: 25 Sep 2003
Posts: 3
Location: Russia

PostPosted: 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...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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.
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