-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscouterV2.js
More file actions
16 lines (14 loc) · 1.12 KB
/
Copy pathscouterV2.js
File metadata and controls
16 lines (14 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { tableMaker, format, getAllServers } from "ze-lib";
/** @param {NS} ns */
export async function main(ns) {
const content = [], inject = (data, style) => React.createElement("div", { style }, data),
target = ns.args[0] ?? await ns.prompt("Select Server", { type: "select", choices: getAllServers(ns) });
ns.clearLog(); ns.tail(); ns.resizeTail(620, 450);
for (const [key, value] of Object.entries(ns.getServer(target))) {
if (value === null || value === undefined) continue;
content.push(inject(key.toString(), { color: "white", "text-align": "right" }));
content.push(inject(typeof value === "number" ? format(value) : String(value), { color: "white", "text-align": "center" }));
}
ns.printRaw(React.createElement("div", { style: { width: "600px" } }, React.createElement("img", { style: { margin: "auto", display: "block", width: "50%" }, src: "https://raw.githubusercontent.com/Zelow79/My-Bitburner-Scripts/main/resources/vegeta-scouter.gif" })));
ns.printRaw(tableMaker(content, 4, { style: { border: "1px solid white", "border-collapse": "collapse", width: "600px" } }, { style: { border: "1px solid white" } }));
}