Guest User

modified worm.ns

a guest
Dec 19th, 2021
622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    if (hsthreads) {
  2.       var hsargs = [];
  3.       for (const argument of ns.args) {
  4.          hsargs.push(argument);
  5.          hsargs.push(ns.getServerMinSecurityLevel(argument));
  6.          hsargs.push(ns.getServerMaxMoney(argument));
  7.          hsargs.push(ns.getServerRequiredHackingLevel(argument));
  8.       }
  9.       //copy hack script to this server and spawn script with threads and arguments as a single string
  10.       if (ns.getHostname() != 'home' && !boughtServer.includes(ns.getHostname())) {
  11.          await ns.scp('hackservers.ns', 'home', ns.getHostname());
  12.          ns.spawn('hackservers.ns', hsthreads, hsargs.toString());
  13.       }
  14.    }
  15.    if (homethreads) {
  16.       var hsargs = [];
  17.       for (const argument of ns.args) {
  18.          hsargs.push(argument);
  19.          hsargs.push(ns.getServerMinSecurityLevel(argument));
  20.          hsargs.push(ns.getServerMaxMoney(argument));
  21.          hsargs.push(ns.getServerRequiredHackingLevel(argument));
  22.       }
  23.       if (boughtServer.includes(ns.getHostname())) {
  24.          await ns.scp('home.ns', 'home', ns.getHostname());
  25.          ns.spawn('home.ns', homethreads, hsargs.toString())
  26.       }
  27.       if (ns.getHostname() == 'home') {
  28.          ns.spawn('home.ns', homethreads, hsargs.toString())
  29.       }
  30.    }
Advertisement
Add Comment
Please, Sign In to add comment