Saltar al contenido
Bits antidisturbios

Bits antidisturbios

  • Hogar
  • Noticias
  • Guías
  • Videoguías
  • Notas del parche
  • Reportar abuso
  • Alternar formulario de búsqueda
Quemador de bits

Quemador de bits – Script avanzado de granja automática

Publicado el 12/19/202112/19/2021 Por Nekotorep 1 comentario en Quemador de bits – Script avanzado de granja automática
  • Título: Quemador de bits
  • Fecha de lanzamiento:
  • Revelador:
  • Editor:
Information about Bitburner is still incomplete. Por favor ayúdanos a completar los detalles del juego usando esto formulario de contacto.

Inspired by this basic auto farm, automate all servers with improved performances.

Aviso

Nota: Require at least 8.1G on your ‘home’ servidor.

Create a ‘runner.js’ file on your home server, paste the content below on it then run it.

nano runner.js

Por defecto, this script will not kill all other services running on each server. You can enforce it by running

run runner.js --kill

This script will use all your personally owned servers. The more you have, the more it’ll be efficient.

Guion

/** @param {Ns} ns **/
export async function main(ns) {
  ns.disableLog('ALL');
  ns.enableLog('print');
  var options = ns.flags([
    ['kill', FALSO],
    ['hack', FALSO],
    ['grow', FALSO],
    ['weaken', FALSO],
    ['waitTime', 10],
    ['help', FALSO]
  ]);

  si (opciones['help']) {
    ns.tail();
    ns.print(`Auto-script, opciones:
    * --matar: Force kill every other process on every servers
    * --hack some-script.js: Replace hack script with some-script.js one
    * --grow some-script.js: Replace grow script with some-script.js one
    * --weaken some-script.js: Replace weaken script with some-script.js one
    * --waitTime 10: Wait time between two servers in ms, must be higher than 1
    * --ayuda: show this message
    `);
    devolver;
  }

  // Creating scripts
  var hack = options['hack'] || '/temp/hack.js',
    grow = options['grow'] || '/temp/grow.js',
    weaken = options['weaken'] || '/temp/weaken.js';

  si (!opciones['hack']) {
    await ns.write(cortar, `
      /** @param {Ns} ns **/
      export async function main(ns) {
          await ns.hack(ns.args[0]);
      }
    `, 'w');
  }
  si (!opciones['grow']) {
    await ns.write(crecer, `
      /** @param {Ns} ns **/
      export async function main(ns) {
          await ns.grow(ns.args[0]);
      }
    `, 'w');
  }
  si (!opciones['weaken']) {
    await ns.write(weaken, `
      /** @param {Ns} ns **/
      export async function main(ns) {
          await ns.weaken(ns.args[0]);
      }
    `, 'w');
  }

  // Divs variables declarations
  var serverList = ns.scan('home'),
    serverCount = [serverList.length, 0],
    softwares = [0, 0, 0, 0, 0, 0],
    softwaresCount = 0,
    scanLevel = 2,
    index = 0,
    notProxyList = [],
    proxyList = ['home'],
    hackables = [],
    growables = [],
    weakenables = [],
    linked,
    target,
    proxyTarget,
    depth = 0,
    checked = 0,
    hackType;

  // Checking softwares
  if (ns.fileExists('BruteSSH.exe')) {
    softwares[0] = 1;
    softwaresCount++;
  };
  si (ns.fileExists('FTPCrack.exe')) {
    softwares[1] = 1;
    softwaresCount++;
  };
  si (ns.fileExists('relaySMTP.exe')) {
    softwares[2] = 1;
    softwaresCount++;
  };
  si (ns.fileExists('HTTPWorm.exe')) {
    softwares[3] = 1;
    softwaresCount++;
  };
  si (ns.fileExists('SQLInject.exe')) {
    softwares[4] = 1;
    softwaresCount++;
  };
  si (ns.fileExists('DeepscanV1.exe')) {
    scanLevel += 2;
  };
  si (ns.fileExists('DeepscanV2.exe')) {
    scanLevel += 5;
  };

  ns.print('/---/ SEARCHING \\---\\\n-- Default --\n > ' + serverList.join('\n > ') + '\n>- Scan Limit: L' + [scanLevel + 1] + ' -<');
  mientras (índice <= serverCount[profundidad] - 1 && profundidad < scanLevel) {
    linked = ns.scan(serverList[comprobado]);
    checked++;
    para (let index = 0; índice <= linked.length - 1; index++) { target = linked[índice]; si (target != 'home' && !serverList.includes(target)) { serverList.push(target); ns.print('L' + [profundidad + 2] + ' > ' + target);
        serverCount[profundidad + 1]++;
      }
    }
    si (index == serverCount[profundidad] - 1) {
      index = 0;
      depth++;
      serverCount.push(0);
    } demás {
      index++;
    };
  }

  ns.print('/-------/ CHECKING \\-------\\');
  para (let index = 0; índice <= serverList.length - 1; index++) { target = serverList[índice]; si (ns.getPurchasedServers().includes(target)) { await ns.scp([cortar, crecer, weaken], 'home', target); si (opciones['kill']) { ns.killall(target); } proxyList.push(target); ns.print(' >>>  PROXY ' + target);
    } de lo contrario si (ns.getServerNumPortsRequired(target) > softwaresCount) {
      ns.print(' >X<  SOFTWARE ' + target);
    } de lo contrario si (ns.getServerMaxRam(target) < 2) { ns.print(' >X<  NO RAM ' + target);
    } de lo contrario si (ns.getHackingLevel() < ns.getServerRequiredHackingLevel(target)) { ns.print(' >X< SKILL ' + target); } demás { si (softwares[0]) { ns.brutessh(target); }; si (softwares[1]) { ns.ftpcrack(target); }; si (softwares[2]) { ns.relaysmtp(target); }; si (softwares[3]) { ns.httpworm(target); }; si (softwares[4]) { ns.sqlinject(target); }; ns.nuke(target); await ns.scp([cortar, crecer, weaken], 'home', target); si (opciones['kill']) { ns.killall(target); } si (ns.getServerMoneyAvailable(target) == 0) { ns.print(' >X< NO MONEY ' + target); proxyList.push(target); ns.print(' >>>  PROXY ' + target);
      } demás {
        notProxyList.push(target);
        ns.print(' >>>  VALID ' + target);
      }
    }
  }

  si (notProxyList.length > 0) {
    ns.print('/------------/ HACKING \\------------\\');
    mientras (verdadero) {
      hackables = [];
      growables = [];
      weakenables = [];
      para (target of notProxyList) {
        // Priority for targets: weaken, then grow, then hack
        if (ns.getServerSecurityLevel(target) > ns.getServerMinSecurityLevel(target) + 5) {
          hackType = weaken;
          weakenables.push(target);
        } de lo contrario si (ns.getServerMoneyAvailable(target) < ns.getServerMaxMoney(target) * 0.80) { hackType = grow; growables.push(target); } demás { hackType = hack; hackables.push(target); } si ((ns.getServerMaxRam(target) - ns.getServerUsedRam(target)) > ns.getScriptRam(hackType)) {
          ns.exec(hackType, target, Math.floor((ns.getServerMaxRam(target) - ns.getServerUsedRam(target)) / ns.getScriptRam(hackType)), target);
          ns.print('|||||||||| ' + hackType + ' --> ' + target + ' ||||||||||');
        }
      }
      para (target of proxyList) {
        // Priority for proxies: cortar, then grow, then weaken
        if (hackables.length > 0) {
          proxyTarget = hackables[Math.floor(Math.random() * hackables.length)];
          hackType = hack;
        } de lo contrario si (growables.length > 0) {
          proxyTarget = growables[Math.floor(Math.random() * growables.length)];
          hackType = grow;
        } de lo contrario si (weakenables.length > 0) {
          proxyTarget = weakenables[Math.floor(Math.random() * weakenables.length)];
          hackType = weaken;
        }
        si ((ns.getServerMaxRam(target) - ns.getServerUsedRam(target)) > ns.getScriptRam(hackType)) {
          ns.exec(hackType, target, Math.floor((ns.getServerMaxRam(target) - ns.getServerUsedRam(target)) / ns.getScriptRam(hackType)), proxyTarget);
          ns.print('|||||||||| proxy --> ' + target + ' --> ' + hackType + ' --> ' + proxyTarget + ' ||||||||||');
        }
      }
      // Await n ms between each servers to avoid issue with the infinite loop
      await ns.sleep(opciones['waitTime']);
    }
  } demás {
    ns.print('Error, no server available.');
  }
}

Advanced Usage

You can see all options in-game with

run runner.js --help

You are allowed to use your own hack, crecer, weaken script. You can also customize the waiting time between each server. Advertencia. Always use more that 1ms or you’ll freeze your game.

Eso es todo lo que estamos compartiendo hoy para este Quemador de bits guía. Esta guía fue originalmente creada y escrita por Nekotorep. En caso de que no actualicemos esta guía, puede encontrar la última actualización siguiendo este enlace.

Si cree que alguno de los contenidos de este sitio viola sus derechos, incluyendo sus derechos de propiedad intelectual, por favor contáctenos inmediatamente usando nuestro formulario de contacto.
Guías Etiquetas:Quemador de bits

Navegación de entradas

Publicación anterior: Cinco noches en Freddy's: Violación de seguridad – Cómo superar el rompecabezas de la guardería
Publicación siguiente: Listo o no – El manual táctico del operador

Comentario (1) on “Bitburner – Script avanzado de granja automática”

  1. leofev dice:
    08/20/2022 a las 8:24 SOY

    As of release 2.0.1, the last two arguments of the scp function need to be flipped. It won’t throw errors, but you’ll find that it will only be using the home computer to run the grow/weaken/hack cycle.

    Responder

Deja una respuesta Cancelar la respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

  • Título: Quemador de bits
  • Fecha de lanzamiento:
  • Revelador:
  • Editor:
Information about Bitburner is still incomplete. Por favor ayúdanos a completar los detalles del juego usando esto formulario de contacto.

Descargo de responsabilidad

Todo el contenido citado se deriva de sus respectivas fuentes.. Si cree que hemos utilizado su contenido sin permiso, asegúrese de comunicarse con nosotros y lo tomaremos en serio.
  • Sobre nosotros
  • Contáctenos
  • política de privacidad
  • Términos de servicio

Derechos de autor © 2025 Bits antidisturbios.

Funciona con Tema PressBook Noticias para WordPress