Control Codes

From Scriptwiki
Jump to: navigation, search

Control codes are used to modify the appearence of text (colors, bold, underline, inverse color)

$chr(02) (ctrl+b) = bold
$chr(03) (ctrl+k) = color
$chr(15) (ctrl+o) = normal (turn off all control codes)
$chr(22) (ctrl+r) = reversed foreground/background color
$chr(31) (ctrl+u) = underline


//echo -a $chr(03) $+ 04 $+ Some $chr(02) $+ text $chr(03) $+ with $chr(31) $+ control $chr(15) $+ codes.

At first, this will start control code for color ($chr(03)) with color 04, then add bold after the first word, end the color code (plain $chr(03) without any numbers after it), then start underline for the word "control", and end all control codes before word "codes".
(i used those $+'s in there, so there will only be 1 space between words)