www.ClassicTW.com
http://www.classictw.com/

TWX Proxy - New Commands addQuickText and clearQuickText
http://www.classictw.com/viewtopic.php?f=15&t=35639
Page 1 of 1

Author:  Micro [ Fri Jan 03, 2020 11:12 pm ]
Post subject:  TWX Proxy - New Commands addQuickText and clearQuickText

Remember my recent rant about TWX Colors:
Subject: Stupid question of the day?

It included this chart showing TWX codes out of order:

Code:
| Color |  ANSI |  TWX   | TW2002 |
|Black  | ^[30m | ANSI_0 |   ~a   |
|Red    | ^[31m | ANSI_4 |   ~b   |
|Green  | ^[32m | ANSI_2 |   ~c   |
|Yellow | ^[33m | ANSI_6 |   ~d   |
|Blue   | ^[34m | ANSI_1 |   ~e   |
|Magenta| ^[35m | ANSI_5 |   ~f   |
|Cyan   | ^[36m | ANSI_3 |   ~g   |
|White  | ^[37m | ANSI_7 |   ~h   |


This is a partial list, there are actually over 40 codes. The column on the far right is the internal color codes used by TW2002. You can see them in MENUFILE.TXT, which holds the help menu screens, and they are used internally as a shorthand for ANSI color codes in prompts and other screens.

In another post you may have noticed TWX color codes are RED:

Image

They are RED because they should be considered depreciated (Along with setVar). TWX 2.06.05+ will support TW2002 color codes, which are in ANSI order "krgybmcw" and capital letters are the bright versions of the same color. For bright white ANSI_15 is replaced with ~H and you can include the code in the string.

So the above snippet becomes:

Image

Not that much of a difference, but each color code is 10 characters the old way and only 2 characters the new way, so you probably didn't even notice I made the dashes yellow and the string is still shorted than the original. You can also use actual ANSI codes (i.e. "^[3A' - cursor up 3 lines), which are actually still shorter than TWX color codes. This is so much easier to use I may actually consider writing a TWX script.

But wait, there is more!!!

The new commands addQuickText and clearQuickText let you create your own color codes!

Image

User color codes are applied first, so they override built-in color codes, so you can even change existing colors.

See the TWX WIKI for more information:
https://github.com/MicroBlaster/TWXProx ... dQuickText

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/