sleepy time update

This commit is contained in:
2024-10-21 03:32:32 +02:00
parent 6189db539a
commit 6b5c5733c2
9 changed files with 441 additions and 14 deletions

27
Mizzajl/home/testgang.js Normal file
View File

@@ -0,0 +1,27 @@
export async function main(ns) {
ns.tail();
// Get the list of all task names
let aTasks = ns.gang.getTaskNames();
// Create an array to store task stats
let oTasks = [];
// Loop through each task and get the stats
for (let i = 0; i < aTasks.length; i++) {
let taskName = aTasks[i];
let taskStats = ns.gang.getTaskStats(taskName);
// Store task name and stats in an object and push to array
oTasks.push({
name: taskName,
stats: taskStats
});
}
// Convert the object to a JSON string for easy storage
let taskStatsString = JSON.stringify(oTasks, null, 2);
// Write the task stats to a file
await ns.write("GangTaskStats.txt", taskStatsString, "w");
ns.tprint("Gang task stats have been written to GangTaskStats.txt.");
}