diff --git a/custom-stats.js b/custom-stats.js index e4cc0a9..36e53bb 100644 --- a/custom-stats.js +++ b/custom-stats.js @@ -1,5 +1,6 @@ /** @param {NS} ns **/ export async function main(ns) { + ns.disableLog("sleep"); const args = ns.flags([["help", false]]); if (args.help) { ns.tprint("This script will enhance your HUD (Heads up Display) with custom statistics."); @@ -17,19 +18,19 @@ export async function main(ns) { const headers = [] const values = []; // Add script income per second - headers.push("ScrInc"); - values.push(ns.getScriptIncome()[0].toPrecision(5) + '/sec'); + headers.push("Script inc"); + values.push(ns.nFormat(ns.getScriptIncome()[0], "0.000a") + "/s"); // Add script exp gain rate per second - headers.push("ScrExp"); - values.push(ns.getScriptExpGain().toPrecision(5) + '/sec'); + headers.push("Script exp"); + values.push(ns.nFormat(ns.getScriptExpGain(), "0.000a") + "/s"); // TODO: Add more neat stuff // Now drop it into the placeholder elements - hook0.innerText = headers.join(" \n"); + hook0.innerText = headers.join(" \n"); hook1.innerText = values.join("\n"); } catch (err) { // This might come in handy later ns.print("ERROR: Update Skipped: " + String(err)); } await ns.sleep(1000); } -} \ No newline at end of file +}