Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** @param {NS} ns */
- export async function main(ns) {
- // ns.disableLog("ALL");
- ns.tail();
- var hackLevel = ns.getHackingLevel();
- var money = ns.getServerMoneyAvailable("home");
- const moneyThresh = 5000000000;
- var script = ns.scriptRunning("bighack.js", "home");
- async function kill() {
- ns.run("kill-network-scripts.js");
- }
- async function earlyGame() {
- if (money < moneyThresh) {
- if (hackLevel < 10) {
- ns.exec("batchhack.js", "home", 1, "n00dles");
- while (hackLevel < 10) {
- ns.print("------------------------------");
- ns.print("Hacking n00dles: Hack Level is " + hackLevel + "/10");
- ns.print("------------------------------");
- await ns.sleep(1000);
- //ns.clearLog();
- }
- }
- else if (hackLevel >= 10 && hackLevel < 100) {
- ns.exec("batchhack.js", "home", 1, "joesguns");
- while (hackLevel < 100) {
- ns.print("------------------------------");
- ns.print("Hacking joesguns: Hack Level is " + hackLevel + "/100");
- ns.print("------------------------------");
- await ns.sleep(1000);
- //ns.clearLog();
- }
- }
- else if (hackLevel >= 100 && !ns.fileExists("Formulas.exe")) {
- ns.exec("batchhack.js", "home", 1, "phantasy");
- while (money < moneyThresh) {
- ns.print("------------------------------");
- ns.print("Hacking phantasy: Money is " + money + "/" + moneyThresh);
- ns.print("------------------------------");
- await ns.sleep(1000);
- //ns.clearLog();
- }
- await midGame();
- }
- }
- else if (money >= moneyThresh) {
- await midGame();
- }
- }
- async function midGame() {
- if (!ns.fileExists("Formulas.exe")) {
- ns.alert("You can now purchase Formulas.exe");
- while (!ns.fileExists("Formulas.exe")) {
- var money = ns.getServerMoneyAvailable("home");
- ns.print("------------------------------");
- ns.print("Hacking phantasy: Money is " + money + "/" + moneyThresh);
- ns.print("Waiting for Formulas.exe");
- ns.print("------------------------------");
- await ns.sleep(1000);
- //ns.clearLog();
- }
- }
- }
- if (script === false) {
- if (money < moneyThresh) {
- await earlyGame();
- }
- else if (money >= moneyThresh && !ns.fileExists("Formulas.exe")) {
- await midGame();
- }
- else if (ns.fileExists("Formulas.exe")) {
- ns.print("------------------------------");
- ns.print("Formulas.exe exists: Killing all scripts");
- ns.print("------------------------------");
- await kill();
- await ns.sleep(1000);
- //ns.clearLog();
- ns.print("------------------------------");
- ns.print("Purchasing servers, Queuing Stock Trader");
- ns.print("Spawning bighack.js");
- ns.print("------------------------------");
- ns.run("purchase-server.js", 1, 32);
- await ns.sleep(1000);
- ns.run("stonks.js");
- ns.spawn("bighack.js", 1, 20);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement