diff --git a/src/auto/backdoor.js b/src/auto/backdoor.js index 7699a6c..e12f91a 100644 --- a/src/auto/backdoor.js +++ b/src/auto/backdoor.js @@ -1,4 +1,4 @@ -import { getServerTree } from "/lib/ServerTree.js" +import { getServerTree } from "../lib/ServerTree.js" /** @param {NS} ns */ export async function main(ns) { @@ -26,7 +26,7 @@ export async function main(ns) { // 2nd pass: walk the tree and backdoor servers const backdoor = async (subtree) => { - if (!subtree.info.backdoorInstalled) { + if (!subtree.info.backdoorInstalled && subtree.info.requiredHackingSkill <= ns.getHackingLevel()) { ns.tprintf("backdoor %s, do not change server", subtree.info.hostname) await ns.singularity.installBackdoor() ns.tprint("backdoor complete") diff --git a/src/lib/ServerTree.js b/src/lib/ServerTree.js index a422cdb..8f623a2 100644 --- a/src/lib/ServerTree.js +++ b/src/lib/ServerTree.js @@ -1,5 +1,11 @@ /** @param {NS} ns */ -const importantHosts = ["CSEC", "avmnite-02h", "I.I.I.I", "run4theh111z", "w0r1d_d43m0n"] +export const IMPORTANT_HOST = [ + "CSEC", + "avmnite-02h", + "I.I.I.I", + "run4theh111z", + "w0r1d_d43m0n" +] class ServerTreeNode { constructor(ns, serverName) { @@ -28,7 +34,7 @@ class ServerTreeNode { } this.ns.tprintf( "%s %s %s %4s %s", - importantHosts.includes(this.serverName) ? "!" : " ", + IMPORTANT_HOST.includes(this.serverName) ? "!" : " ", this.info.hasAdminRights ? "Y" : "N", this.info.openPortCount, this.info.requiredHackingSkill, diff --git a/src/map.js b/src/map.js index d1c2387..2478e20 100644 --- a/src/map.js +++ b/src/map.js @@ -1,4 +1,4 @@ -import {getServerTree} from '/lib/ServerTree.js' +import {getServerTree} from './lib/ServerTree.js' /** @param {NS} ns */ export async function main(ns) {