The3vilM0nk3y

hiveCluster/grow.js

Apr 26th, 2022
1,347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /** @param {NS} ns **/
  2. export async function main(ns) {
  3.     //Args - target, timeToFinish, executionTime, actionID
  4.     var server = ns.args[0];
  5.     var timeToFinish = ns.args[1];
  6.     let doWait = true;
  7.    
  8.     while (doWait){
  9.         if (performance.now() + (ns.getHackTime(server) * 3.2) >= timeToFinish) break;
  10.         await ns.sleep(1);
  11.     }
  12.     await ns.grow(server);
  13.     if (performance.now + 50 > timeToFinish) ns.tprint("Grow Finished Late!! " + performance.now());
  14. }
Advertisement
Add Comment
Please, Sign In to add comment