-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathSaveRep.js
More file actions
26 lines (22 loc) · 789 Bytes
/
SaveRep.js
File metadata and controls
26 lines (22 loc) · 789 Bytes
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
/** @param {NS} ns */
export async function main(ns) {
//await ApplyWorkReputation(ns);
}
async function ApplyWorkReputation(ns) {
let current = ns.singularity.getCurrentWork();
//{ "type": "FACTION", "cyclesWorked": 1621, "factionWorkType": "HACKING", "factionName": "CyberSec" }
if (current?.type != 'FACTION') {
ns.tprint('FAIL: current?.type = ' + current?.type);
return;
}
if (current?.factionWorkType != 'HACKING') {
ns.tprint('FAIL: current?.factionWorkType = ' + current?.factionWorkType);
return;
}
//ns.singularity.stoo();
await ns.sleep(100);
//ns.singularity.workForFaction(current.factionName, 'Hacking Contracts', false);
ns.tprint(JSON.stringify(current));
ns.singularity.workForFaction(current.factionName, 'HACKING', false);
await ns.sleep(100);
}