-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlazystarter.js
29 lines (29 loc) · 1011 Bytes
/
lazystarter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** @param {NS} ns */
/**
* Intention
* - start several scripts
* - only run once
*/
export async function main(ns) {
var filesToExecute = [
//"/sleeves/sleeve-starter.js", //--> moved to different caller
"/data-mining/world-profiler.js",
"scpToWorld.js",
"worldcracker.js",
"selfHackWorld.js"
];
for (let i = 0; i < filesToExecute.length; i++) {
if (i == 3) {
//start purchasing script on foodnstuff first
ns.tprint("starting purchasing server-script on foodnstuff");
ns.exec("purchaseServer8GB.js", "foodnstuff", 1);
await ns.sleep(1000);
}
ns.tprint("starting script ", filesToExecute[i]);
ns.exec(filesToExecute[i], "home", 1);
await ns.sleep(5000);
}
ns.tprint("LazyStarter done running. Enjoy!");
// no longer necessary, as the waiting time between execs was reduced in worldcracker script
//ns.spawn("selfHackWorld.js", 1); //call the script again, because in endgame situation worldcracker is not finished before selfhack starts
}