Using Colors to print – Bitburner

Using Colors to print – Bitburner 1 - steamclue.com
Using Colors to print – Bitburner 1 - steamclue.com

Did you know you can use colors to print output?
 
 

Code:

You only need to use the available keywords at the start of the print command for it to change color.
 
Known:
 

KeywordColor
INFOblue
WARNyellow
WARNINGyellow
ERRORred

 
Here is a simple code to output the available colors and see them in the terminal:
 
 

/** @param {NS} ns **/export async function main(ns) {
 ns.tprintf('INFO---available log colors:')
 ns.tprintf('INFOthey only need to be at the start')
 ns.tprintf(`otherwise INFO or others won't work`)
 ns.tprintf('WARN this is a warning')
 ns.tprintf('WARNING this is also warning')
 ns.tprintf('ERROR this is an error')
} 

 
This will output in terminal:
 
 
Using Colors to print - Bitburner - Code: - 2A3C80035
 
 
Feel free to comment with anything else you know.
 
 

 
 
I hope you enjoy the Using Colors to print – Bitburner guide. This is all for now! If you have something to add to this guide or forget to add some information, please let us know via comment! We check each comment manually!
 


Be the first to comment

Leave a Reply

Your email address will not be published.


*