Skip to content

Instantly share code, notes, and snippets.

@KrunoSaho
KrunoSaho / batcher.ts
Last active June 30, 2023 08:59
new batcher
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,
@KrunoSaho
KrunoSaho / batcher.ts
Last active June 30, 2023 04:16
Bitburner batcher
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,
@KrunoSaho
KrunoSaho / gist:38b584a63b776c27b398cab1e4d8bd14
Last active June 28, 2023 17:14
MasterHackerController.ts
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,
@KrunoSaho
KrunoSaho / hack-all-the-servers.js
Created December 19, 2021 12:57
Bitburner script
/** @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;