summaryrefslogtreecommitdiff
path: root/batch/batch.js
blob: c5cb7f5efbf43b8406c5fba10ced5437174482ee (plain)
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
30
31
32
33
34
35
36
import { setOfObjects } from '/batch/batcher.js';

/** @param {NS} ns */
export async function main(ns) {
	// SINGLE BATCH RUN BY BATCHER.JS
	// RUNS TWO WEAKENS, A GROW, AND A HACK
	// SEPERATED BY SOME TIME
	/*
	Initialize the object

	run weaken.js with [weaken-hack] threads
	wait some [weakenBuffer] time
	run weaken.js with [weakenThreadsGrow] threads
	wait some [grow buffer] time
	run grow.js with [grow] threads
	wait some [hack buffer] time
	run hack.js with [hack] threads
	*/

	// ns.disableLog("ALL");
	// ns.clearLog();
	// ns.tail();

	let object = setOfObjects[ns.args[0]];


	ns.exec("/batch/weaken.js", "home", Math.ceil(object.weakenThreadsHack), object.target);
	await ns.sleep(object.weakenBuffer);
	ns.exec("/batch/weaken.js", "home", Math.ceil(object.weakenThreadsGrow), object.target);
	await ns.sleep(object.growBuffer);
	ns.exec("/batch/grow.js", "home", Math.ceil(object.growThreads), object.target);
	await ns.sleep(object.hackBuffer);
	ns.exec("/batch/hack.js", "home", Math.ceil(object.hackThreads), object.target);
	// ns.tprint(object.weakenThreadsHack)

}