-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgym.js
35 lines (31 loc) · 956 Bytes
/
gym.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
30
31
32
33
34
35
/** @param {NS} ns **/
export async function main(ns) {
function workout(stat) {
ns.gymWorkout("powerhouse gym", stat, true);
//ns.sleeve.setToGymWorkout(0, "powerhouse gym", stat);
}
var target = ns.args[0] || 100;
while (true) {
ns.stopAction();
ns.hacknet.spendHashes("Improve Gym Training");
if(ns.getPlayer().strength < target) {
workout("strength");
}
else if (ns.getPlayer().defense < target) {
workout("defense");
}
else if (ns.getPlayer().dexterity < target) {
workout("dexterity");
}
else if (ns.getPlayer().agility < target) {
workout("agility");
} else {
ns.sleeve.setToCommitCrime(0, "mug");
if(ns.args[1] == "crime") {
ns.spawn("do-crime.js", 1);
}
return;
}
await ns.sleep(15000);
}
};