-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBestServer.ts
More file actions
31 lines (27 loc) · 814 Bytes
/
BestServer.ts
File metadata and controls
31 lines (27 loc) · 814 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
27
28
29
30
31
import {BitBurner as NS} from "Bitburner";
import {
getServers,
compareProfit
} from "hhelper.js";
export function main(ns: NS) {
hackableServers(ns).forEach(function(s) {
ns.tprint(`${s.name} ${s.profit} ${s.hackTime * 4} `);
});
}
export function hackableServers(ns) {
let hl = ns.getHackingLevel();
return getServers(ns)
.sort(compareProfit)
.filter(function(server) {
let s = server.name;
if (s.startsWith('darkweb') ||
s.startsWith('home') ||
s.startsWith('pserv') ||
!server.hasRoot ||
server.reqHacking > hl ||
server.minSecLvl == 1 && server.moneyAvailable === 0
) return false;
else
return true;
});
}