fixin and cleaning up some files

This commit is contained in:
2024-10-06 13:25:54 +02:00
parent 9d020e473e
commit 4068de1e39
15 changed files with 286 additions and 35 deletions

View File

@@ -0,0 +1,39 @@
/** @param {NS} ns */
export async function main(ns) {
const sMessage = ns.args[0]; //
const nCurrentProgress = ns.args[1]; //
const stest = ns.args[2];
const nPID = ns.pid;
const sFileName = "progress_" + nPID;
//ns.print("nPID = "+nPID);
const sProgress = [
"░░░░░░░░░░",
"█░░░░░░░░░",
"██░░░░░░░░",
"███░░░░░░░",
"████░░░░░░",
"█████░░░░░",
"██████░░░░",
"███████░░░",
"████████░░",
"█████████░",
"██████████"
];
ns.tail(nPID);
while (nCurrentProgress < 100) {
//ns.read(""filename"");
ns.print(sProgress[Math.floor(nCurrentProgress / (sProgress.length - 1))]);
ns.write("filename", "text", "w");
}
if (nCurrentProgress >= 100)
ns.rm(sFileName);
return nPID;
}