Ir para o conteúdo
Riot Bits

Riot Bits

  • Lar
  • Notícias
  • Guias
  • Guias de vídeo
  • Notas do Patch
  • Denunciar abuso
  • Alternar formulário de pesquisa
Bitburner

Bitburner – Automação de servidores disponíveis nuclear

postado em 01/20/2022 Por koutoftimer Sem comentários em Bitburner – Automação de servidores disponíveis nuclear
  • Título: Bitburner
  • Data de lançamento:
  • Desenvolvedor:
  • Editor:
Information about Bitburner is still incomplete. Por favor, ajude-nos a preencher os detalhes do jogo usando este formulário de contato.

For those who are looking for something useful out here. I hope you will not blindly copy/paste it in your game but will find out a few new ideas for structuring your code.

Also I can see several rooms for improvements:

  • Create supervisor process that will watch for new available nodes and nuke them for you, so you need to execute something like `run nuke-all-supervisor.js` only once per installing augments.
  • Another room for improvement is installing backdoor. It needs you to progress in the game a bit though, in order to unlock the required API.

Uso

run nuke-all.js

Nukes all the servers you have to meet hacking level. As simple as it looks. No further attention is required. Branding image contains my very first step after installing augments.

Memory consumption

As you can see below, memory consumption for this script is below 8G, which means you can use it at early game. I only now have recognized that the getPurchasedServers function takes half of RAM and it doesn’t really require it, so you can improve memory consumption for your needs.

[home ~/]> mem nuke-all.js 
This script requires 4.75GB of RAM to run for 1 fio(é)
  2.25GB | getPurchasedServers (fn)
  1.60GB | baseCost (misc)
200.00MB | scan (fn)
100.00MB | getServerRequiredHackingLevel (fn)
100.00MB | getServerNumPortsRequired (fn)
100.00MB | fileExists (fn)
 50.00MB | hasRootAccess (fn)
 50.00MB | getHackingLevel (fn)
 50.00MB | nuke (fn)
 50.00MB | brutessh (fn)
 50.00MB | ftpcrack (fn)
 50.00MB | relaysmtp (fn)
 50.00MB | httpworm (fn)
 50.00MB | sqlinject (fn)

Scripts

nuke-all.js – Executable script uses library functions to clarify and simplify behavior.

importar { acquireRootAccess, buildNetwork, networkToServerList } from 'utils'

/** @param {NS} ns **/
export async function main(ns) {
	const network = buildNetwork(ns)
	const networkList = networkToServerList(network)
	const notNuked = networkList.filter((servidor) => !ns.hasRootAccess(servidor))
	para (const host of notNuked) {
		acquireRootAccess(ns, host)
	}

	ns.toast(`${ns.getScriptName()} done`)
}

utils.js – Set of utility/library functions

/**
 * Returns list of callables you can use to open ports on specified server.
 * 
 * @param {NS} ns
 * @returns {Array.<(servidor: corda): void>} 
 */
export function getAvailableMethods(ns) {
	const methods = []
	para (const [método, arquivo] de [
	 	[ns.brutessh, 'BruteSSH.exe'],
		[ns.ftpcrack, 'FTPCrack.exe'],
		[ns.relaysmtp, 'relaySMTP.exe'],
		[ns.httpworm, 'HTTPWorm.exe'],
		[ns.sqlinject, 'SQLInject.exe']
	]) {
		se (ns.fileExists(arquivo)) {
			methods.push(método)
		}
	}
	return methods
}

/**
 * Try to acquire Root access to the target server.
 * 
 * @param {NS} ns
 * @param {corda} target Server name to get Root access to.
 * @returns {boolean} Was attempt successful or not.
 */
export function acquireRootAccess(ns, alvo) {
	se (!ns.hasRootAccess(alvo)) {
		se (ns.getHackingLevel() < ns.getServerRequiredHackingLevel(alvo)) {
			ns.print(`ERROR: Not enough hacking level for ${alvo}`)
			retornar falso
		}
		const methods = getAvailableMethods(ns);
		se (methods.length < ns.getServerNumPortsRequired(alvo)) {
			ns.print(`ERROR: Not enough breaking methods for ${alvo}`)
			retornar falso
		}
		para (const method of methods) {
			método(alvo)
		}
		ns.nuke(alvo)
	}
	retornar verdadeiro
}

/**
 * Simple directed graph representation of a network, which consists of
 * it's name and list of child nodes.
 * 
 * @typedef {{nome: corda, crianças: NetworkNode[]}} NetworkNode
 */

/**
 * Returns network representation in form of directed graph using DFS.
 * The most common case is that you do not care about network nodes you can 
 * not nuke right now. That is why this function only returns nodes for 
 * which you have meet hacking level.
 * 
 * @param {NS} ns
 * @param {corda} name Name of the network node/server we are working with.
 * @param {corda[]} used List of nodes we have already processed.
 * @returns {NetworkNode} Directed graph
 */
export function buildNetwork(ns, name = 'home', used = []) {
	used.push(nome)
	const node = { nome: nome, crianças: [] }
	const serverList = ns.getPurchasedServers()
	para (const child of ns.scan(node.name)) {
		se (ns.getServerRequiredHackingLevel(criança) <= ns.getHackingLevel() && 
		    !used.includes(criança) && !serverList.includes(criança)
		) {
			node.children.push(buildNetwork(ns, criança, usado))
		}
	}
	return node
}

/**
 * It is not strictly required to works with network in form of a graph. 
 * Sometimes we just have to know what nodes are present. This is what 
 * this function is for: to convert data structure format from directed 
 * graph to plain list of network's nodes.
 * 
 * @param {NetworkNode} nó
 * @returns {corda[]} List of all servers in the network.
 */
export function networkToServerList(nó) {
	const list = [node.name]
	se (node.children.length) {
		para (const child of node.children) {
			list.push(...networkToServerList(criança))
		}
	}
	return list
}

Isso é tudo o que estamos compartilhando hoje para isso Bitburner guia. Este guia foi originalmente criado e escrito por koutoftimer. Caso não atualizemos este guia, você pode encontrar a atualização mais recente seguindo este link.

Se você acredita que algum conteúdo deste site viola seus direitos, incluindo seus direitos de propriedade intelectual, entre em contato conosco imediatamente usando nosso formulário de contato.
Guias Tag:Bitburner

Navegação de artigos

Postagem anterior: LIVER DO LOUN – Guia de informações gerais e salas secretas
próxima postagem: Labiríntico – Nível 5 Mapa + Collectibles Locations Guide

Deixe um comentário Cancelar resposta

O seu endereço de email não será publicado. Campos obrigatórios marcados com *

  • Título: Bitburner
  • Data de lançamento:
  • Desenvolvedor:
  • Editor:
Information about Bitburner is still incomplete. Por favor, ajude-nos a preencher os detalhes do jogo usando este formulário de contato.

Isenção de responsabilidade

Todo o conteúdo citado é derivado de suas respectivas fontes. Se você acha que usamos seu conteúdo sem permissão, certifique-se de entrar em contato conosco e levaremos isso a sério.
  • Sobre nós
  • Contate-nos
  • política de Privacidade
  • Termos de serviço

direito autoral © 2025 Riot Bits.

Distribuído por PressBook Notícias tema WordPress