1
0
Fork 0

fix import

This commit is contained in:
Massaki Archambault 2023-09-19 17:41:22 -04:00
parent 7f4102ab05
commit 166bf73c1a
3 changed files with 11 additions and 5 deletions

View File

@ -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")

View File

@ -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,

View File

@ -1,4 +1,4 @@
import {getServerTree} from '/lib/ServerTree.js'
import {getServerTree} from './lib/ServerTree.js'
/** @param {NS} ns */
export async function main(ns) {