fix import
This commit is contained in:
parent
7f4102ab05
commit
166bf73c1a
|
@ -1,4 +1,4 @@
|
||||||
import { getServerTree } from "/lib/ServerTree.js"
|
import { getServerTree } from "../lib/ServerTree.js"
|
||||||
|
|
||||||
/** @param {NS} ns */
|
/** @param {NS} ns */
|
||||||
export async function main(ns) {
|
export async function main(ns) {
|
||||||
|
@ -26,7 +26,7 @@ export async function main(ns) {
|
||||||
|
|
||||||
// 2nd pass: walk the tree and backdoor servers
|
// 2nd pass: walk the tree and backdoor servers
|
||||||
const backdoor = async (subtree) => {
|
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)
|
ns.tprintf("backdoor %s, do not change server", subtree.info.hostname)
|
||||||
await ns.singularity.installBackdoor()
|
await ns.singularity.installBackdoor()
|
||||||
ns.tprint("backdoor complete")
|
ns.tprint("backdoor complete")
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
/** @param {NS} ns */
|
/** @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 {
|
class ServerTreeNode {
|
||||||
constructor(ns, serverName) {
|
constructor(ns, serverName) {
|
||||||
|
@ -28,7 +34,7 @@ class ServerTreeNode {
|
||||||
}
|
}
|
||||||
this.ns.tprintf(
|
this.ns.tprintf(
|
||||||
"%s %s %s %4s %s",
|
"%s %s %s %4s %s",
|
||||||
importantHosts.includes(this.serverName) ? "!" : " ",
|
IMPORTANT_HOST.includes(this.serverName) ? "!" : " ",
|
||||||
this.info.hasAdminRights ? "Y" : "N",
|
this.info.hasAdminRights ? "Y" : "N",
|
||||||
this.info.openPortCount,
|
this.info.openPortCount,
|
||||||
this.info.requiredHackingSkill,
|
this.info.requiredHackingSkill,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {getServerTree} from '/lib/ServerTree.js'
|
import {getServerTree} from './lib/ServerTree.js'
|
||||||
|
|
||||||
/** @param {NS} ns */
|
/** @param {NS} ns */
|
||||||
export async function main(ns) {
|
export async function main(ns) {
|
||||||
|
|
Loading…
Reference in New Issue