Advertisement
r00key

ragnarok.js

Aug 15th, 2022 (edited)
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Bitburner script: ragnarok.js
  2. /** @param {NS} ns */
  3. // 1 - payload: script to distribute
  4. // 2 - multithread : on true, runs payload with max threads for availiable ram
  5. // 3 - useHost: if hostname should be sent to the payload as param
  6. export async function main(ns) {
  7.     let payload = ns.args[0];
  8.     let multithread = ns.args[1];
  9.     let useHost = ns.args[2];
  10.     ns.exec('jormungandr.js', "home");
  11.     while (ns.isRunning('jormungandr.js', "home")) {
  12.         await ns.sleep(200);
  13.     }
  14.     let hackingLevel = ns.getHackingLevel();
  15.     let payloadRamUsage = ns.getScriptRam(payload);
  16.     let args = [payload, hackingLevel, multithread, payloadRamUsage, useHost];
  17.     for(let i = 3 ; i < ns.args.length; i++){
  18.         args.push(ns.args[i]);
  19.     }
  20.     ns.exec('yggdrasil.js', 'home', 1, payload, hackingLevel, multithread, payloadRamUsage, useHost, "home", "home");
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement