Neofetch in BitBurner

Review

Well, Neofetch is a command-line system information tool written in bash. Neofetch displays information about your operating system, software and hardware in an aesthetic and visually pleasing way. The overall purpose of Neofetch is to be used in screen-shots of your system.

I tried to code it in Java-Script so you can use it inside BitBurner however, there are some problems that I encountered:

Some API limitations that doesn't allow me to get access to all the information on the server (Not so important however like org name)

I wanted to find a way to turn it into a built-in like command that I can use on any server like analyze command but I didn't find any command to copy files from home to server X without leaving server X

The whole plan was to make an alias that copies the script from your home and put it inside server x then run it and then server x deletes the file after execution

If you like my fetchburner, give this guide a thumbs up <3

More features will be added in the future like Config files, Custom Colors, Custom ASCII Logos

(If they are possible)

How To Use It?

Create a Script called neofetch.js and paste the following codes inside (In the next updates I add github links):

"""

/** @param {NS} ns */

export async function main(ns) {

// neofetch script made by DeVil

// Check steam guide or github page for more information

// use the following alias commands:

// alias neofetch="home; run neofetch.js"

// alias neofetch="home; clear; run neofetch.js"

let tuser = "bitburner";

let thost = "";

if (ns.args.length > 0 && ns.serverExists(ns.args[0]))

thost = ns.args[0];

else

thost = ns.getHostname();

if (ns.hasRootAccess(thost))

tuser = "root";

const title = tuser + "@" + thost;

let line = "";

for (let i = 0; i <= title.length; i++)

line += "-";

const hskill = ns.getHackingLevel(thost);

const rhskill = ns.getServerRequiredHackingLevel(thost);

const hchance = ns.formatPercent(ns.hackAnalyzeChance(thost));

const htime = ns.tFormat(ns.getHackTime(thost));

const nukep = ns.getServerNumPortsRequired(thost);

const seclvl = ns.getServerSecurityLevel(thost);

const amoney = ns.formatNumber(ns.getServerMoneyAvailable(thost), 3);

const mmoney = ns.getServerMaxMoney(thost);

const ramv = ns.getServerMaxRam(thost);

const ramu = ns.getServerUsedRam(thost);

const rama = ramv - ramu;

const runningscr = ns.ps(thost).length;

ns.tprintRaw("\n aa " + title);

ns.tprintRaw(" fi aa bb aa fi " + line);

ns.tprintRaw(" pl aa sa if an aa ot " + "Hack Lvl: " + hskill);

ns.tprintRaw(" fa wa ba a0aaaaaa aa aw ab " + "Req Hack Lvl: " + rhskill);

ns.tprintRaw(" ba aa ba aa fa aa aa aa aa " + "Hack Chance: " + hchance);

ns.tprintRaw(" baaa aaaca db aaaaa aaaa " + "Hack Time: " + htime);

ns.tprintRaw(" ca aag pa if aq aaa ab " + "Req Ports: " + nukep);

ns.tprintRaw(" ba ja aaa aa aaa ai aa " + "Sec Lvl: " + seclvl);

ns.tprintRaw(" fa sallmaak baaa aaaaaaaw ac " + "Available Money: " + amoney);

ns.tprintRaw(" caamaaaaaa aa aa ae alaac " + "Max Money: " + mmoney);

ns.tprintRaw(" aa7a ea aa aa ab a5aa " + "Max Ram: " + ns.formatRam(ramv));

ns.tprintRaw(" aa ba ai aa ab aa " + "Used Ram: " + ns.formatRam(ramu));

ns.tprintRaw(" aaa ea aa ae aaa " + "Available Ram: " + ns.formatRam(rama));

ns.tprintRaw(" aa qz z vt aa " + "Scripts Running: " + runningscr + "\n\n");

}

"""

Add An Alias And DONE!

Copy and Paste one of the following commands into terminal to add an alias:

alias neofetch="home; run neofetch.js"

alias neofetch="home; clear; run neofetch.js"

The second one clears the terminal and then runs the script; so use the one you are okay with...

Now when you type "neofetch" into terminal It will move you to "home" and executes the script; But How to execute it for other servers? Use arguments:

[home /]> neofetch zer0

Have fun!

Source: https://steamcommunity.com/sharedfiles/filedetails/?id=3418323584					

More Bitburner guilds