This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @param {NS} ns | |
***/ | |
function collect_server_names(ns) { | |
let fromServers = ['home']; | |
let checkedServers = []; | |
let serverConnections = new Map(); | |
for (let i = 0; i < 10000; i++) { // 'infinite' loop | |
if (fromServers.length == 0) { | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NS } from "../NetscriptDefinitions"; | |
import { getThreadCount, getAllServers, breakServers } from "./Util"; | |
type SubscriptPaths = { Path: string; Cost: number }; | |
type ScriptInformation = { Hack: SubscriptPaths; Grow: SubscriptPaths; Weaken: SubscriptPaths }; | |
type Operations = "hack" | "grow" | "weaken"; | |
type Operation = ( | |
operation: Operations, | |
srcServer: string, | |
targetServer: string, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NS } from "../NetscriptDefinitions"; | |
import { getThreadCount, getAllServers, breakServers, ColorsForPrint } from "./Util"; | |
type SubscriptPaths = { Path: string; Cost: number }; | |
type ScriptInformation = { Hack: SubscriptPaths; Grow: SubscriptPaths; Weaken: SubscriptPaths }; | |
type Operations = "hack" | "grow" | "weaken"; | |
type Operation = ( | |
operation: Operations, | |
srcServer: string, | |
targetServer: string, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NS, Server } from "../NetscriptDefinitions"; | |
import { getThreadCount, getAllServers, breakServers, makeColour } from "./Util"; | |
type SubscriptPaths = { Path: string; Cost: number }; | |
type ScriptInformation = { Hack: SubscriptPaths; Grow: SubscriptPaths; Weaken: SubscriptPaths }; | |
type Operations = "hack" | "grow" | "weaken"; | |
type Operation = ( | |
operation: Operations, | |
srcServer: string, | |
targetServer: string, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NS, Player, Server } from "@ns"; | |
import { | |
getThreadCountForSimpleOps, | |
makeColour, | |
getTargetServersForHack, | |
getPurchasedServers, | |
} from "Util"; | |
type SubscriptPaths = { Path: string; Cost: number }; | |
type ScriptInformation = { Hack: SubscriptPaths; Grow: SubscriptPaths; Weaken: SubscriptPaths }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NS } from "@ns"; | |
import { buyAllTorStuff, buyServers, getServers, spendHashes } from "./Util"; | |
import { getMostProfitableCrime } from "./util/Crime"; | |
function upgradeHome(ns: NS) { | |
ns.singularity.upgradeHomeRam(); | |
ns.singularity.upgradeHomeCores(); | |
} | |
async function* serialBehaviour(ns: NS) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NS, Server } from "@ns"; | |
import { Task, getMyServers, getThreadCountForSimpleOps, makeColour } from "Util"; | |
type ServerWithThreads = { server: Server; task: Task; threads: number }; | |
function interleave(hack: ServerWithThreads[], grow: ServerWithThreads[], weaken: ServerWithThreads[]) { | |
const result = [] as ServerWithThreads[]; | |
const max = Math.max(hack.length, grow.length, weaken.length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NS, Server } from "@ns"; | |
import { copyHackFilesToServers } from "util/CopyFiles"; | |
export enum Task { | |
Hack = "hacks/SimpleHack.js", | |
Grow = "hacks/SimpleGrow.js", | |
Weaken = "hacks/SimpleWeaken.js", | |
} | |
export enum PortMessages { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Task, getMyServers, getThreadCountForSimpleOps, makeColour } from "Util"; | |
function interleave(hack, grow, weaken) { | |
const result = []; | |
const max = Math.max(hack.length, grow.length, weaken.length); | |
for (let i = 0; i < max; i++) { | |
if (i < weaken.length) | |
result.push(weaken[i]); | |
if (i < grow.length) | |
result.push(grow[i]); | |
if (i < hack.length) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ItemFilter xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> | |
<name>Necrodancer</name> | |
<filterIcon>1</filterIcon> | |
<filterIconColor>17</filterIconColor> | |
<description /> | |
<lastModifiedInVersion>1.0.0.1</lastModifiedInVersion> | |
<lootFilterVersion>2</lootFilterVersion> | |
<rules> | |
<Rule> |
OlderNewer