# Statuscolors

Statuscolors

Author

Shachaf &amp; Oren Ben-Kiki

Download

link

Bilious PatchDB

142

The statuscolors patch for 3.4.3 allows the user to configure colors for the bottom status line; these colors vary as the HP and Pw change and status indicators appear and disappear. This patch is modeled after the menucolors patch, which allows the user to configure colors for menu items. Both patches only operate in the tty interface. The user must put STATUSCOLOR lines into their nethackrc, or the statuscolors patch does nothing.
In versions 3.6.1 and later, status hilites are included by default. The rest of this article is mainly useful for those on earlier versions.

Comparison to HPmon
Statuscolors patch does the same as HPmon, and more; HPmon only colors the HP display. However, the fact that statuscolors does nothing without configuration from the nethackrc might be viewed as a regression. The Statuscolors patch is used on nethack.alt.org, while an expanded version of HPmon exists in GruntHack.
The HPmon patch only overwrites the HP display with a colorised version, occasionally neglecting to do this (in which case the display is not colorised) or writing the numbers at the wrong position. The statuscolors patch actually modifies the code in botl.c that generates the status line, thus inserting color. However, this brings the statuscolors patch into conflict with the dumplog patch, which tries to modify the same code to support the provision of a string to the end-of-game character dump. NetHack brass players can use the brass interface patch which provides one possible resolution to this conflict.

Usage
To enable statuscolors:

OPTIONS=statuscolors

To specify statuscolor options, write:

STATUSCOLOR=

<option>,<option>

Numeric options have the format <field>%<max-percent>:<color-option>. For example:

STATUSCOLOR=hp%15:red&amp;bold,pw%100=green

Text options have the format <text>:<color-option>. Text is case-insensitive. For example:

STATUSCOLOR=hallu:orange,foodpois:red&amp;inverse&amp;blink

On NAO, you can also specify exact values:

STATUSCOLOR=hp.1:red&amp;inverse,hp&lt;8:red,hp&gt;50:grey

A color option is a <color> followed by an optional sequence of &amp;<attr>. Color and attribute names are case insensitive. Valid colors are: black, blue, brown, cyan, gray, green, lightblue, lightcyan, lightgreen, lightmagenta, magenta, none, orange, red, white, yellow.
Valid attributes are: blink, bold, dim, inverse, none, underline.
A reasonable set of defaults might be:

# HP
STATUSCOLOR=hp%100=green,hp%66=yellow,hp%50=orange
STATUSCOLOR=hp%33=red&amp;bold,hp%15:red&amp;inverse,hp%0:red&amp;inverse&amp;blink
# Pw
STATUSCOLOR=pw%100=green,pw%66=yellow,pw%50:orange,pw%33=red&amp;bold
# Carry
STATUSCOLOR=burdened:yellow,stressed:orange,strained:red&amp;bold
STATUSCOLOR=overtaxed:red&amp;inverse,overloaded:red&amp;inverse&amp;blink
# Hunger
STATUSCOLOR=satiated:yellow,hungry:orange,weak:red&amp;bold
STATUSCOLOR=fainting:red&amp;inverse,fainted:red&amp;inverse&amp;blink
# Mental
STATUSCOLOR=hallu:yellow,conf:orange,stun:red&amp;bold
# Health
STATUSCOLOR=ill:red&amp;inverse,foodpois:red&amp;inverse,slime:red&amp;inverse
# Other
STATUSCOLOR=held:red&amp;inverse,blind:red&amp;inverse

</attr></color></color-option></text></color-option></max-percent></field></option></option>