-
Notifications
You must be signed in to change notification settings - Fork 0
/
32GB_autostart.js
77 lines (74 loc) · 2.44 KB
/
32GB_autostart.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* Intention:
* - start things after an augmentation reset
* - use only 32 GB --> spawn other scripts
*
* Basic plan:
* 1) set sleeves to study or work for faction
* 2) set player to study (or faction work)
* 3) buy hacknet server
* 4) buy TOR-router (if possible)
* 5) wait for hacking level 40
* 6) run lazystarter
*
* Prerequisites:
* - SF4 (Singularity)
*/
/** @param {NS} ns */
export async function main(ns) {
//delay, to make sure the game loaded properly
await ns.sleep(2000);
//check for faction invites
var factionsAvailable = ns.singularity.checkFactionInvitations();
//accept faction invitations, if there were any
if (factionsAvailable.length > 0) {
ns.toast("Accepting faction invitations.");
for (let faction in factionsAvailable) {
ns.singularity.joinFaction(factionsAvailable[faction]);
}
}
//set player to study at University
//LATER: Check, if faction is available, that we can work for
if (factionsAvailable.length > 0) {
//needs adaption for factions wo hacking...
ns.singularity.workForFaction(factionsAvailable[0], "Hacking Contracts", true);
ns.toast("Hacking for Faction.");
} else {
ns.toast("Studying...");
ns.singularity.universityCourse("Rothman University", "Study Computer Science", true);
}
//set sleeves to work
await ns.sleep(1000); //wait for factions to be properly available for sleeves?
ns.toast("Setting sleeves to work.");
ns.spawn("/sleeves/sleeve-starter.js", 1, "crime", true);
/**
//set player to study at University
//LATER: Check, if faction is available, that we can work for
if (factionsAvailable.length > 0) {
//needs adaption for factions wo hacking...
ns.singularity.workForFaction(factionsAvailable[0], "Hacking Contracts", true);
ns.toast("Hacking for Faction.");
} else {
ns.toast("Studying...");
ns.singularity.universityCourse("Rothman University", "Study Computer Science", true);
}
//buy hacknet server
//not available???
//buy TOR browser
//how to check for TOR price???
if (ns.getServerMoneyAvailable("home") >= 200000) {
ns.toast("Purchasing TOR browser.");
ns.singularity.purchaseTor();
}
//LATER: Check if we have at least one programme (e.g. BruteSSH.exe)
//if not, build it
//wait until player hacking level reached 40
ns.toast("Waiting for hacking level of 40.");
while (ns.getHackingLevel() < 40) {
await ns.sleep(1000);
}
//run lazystarter
ns.toast("Done. Handing over to lazystarter.");
ns.exec("lazystarter.js", "home", 1);
*/
}