From 40843e35434d56e883655e4377994ac76746b184 Mon Sep 17 00:00:00 2001 From: AlmightyMiau Date: Wed, 13 Nov 2024 10:56:53 -0800 Subject: Organized scripts into folders --- start/home.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 start/home.js (limited to 'start/home.js') diff --git a/start/home.js b/start/home.js new file mode 100644 index 0000000..0ace136 --- /dev/null +++ b/start/home.js @@ -0,0 +1,35 @@ +var money; + +/** @param {NS} ns */ +export async function main(ns) { + getmoney(ns); + + ns.tail(); + ns.moveTail(1050, 525); + ns.resizeTail(250, 100); + + let factions = ns.getPlayer().factions; + ns.disableLog("disableLog"); + ns.disableLog("clearLog"); + ns.disableLog("sleep"); + ns.disableLog("singularity.getUpgradeHomeRamCost"); + ns.disableLog("singularity.getUpgradeHomeCoresCost"); + ns.disableLog("getServerMoneyAvailable"); + ns.clearLog(); + while (true) { + getmoney(ns); + if (money > ns.singularity.getUpgradeHomeRamCost()) { + ns.singularity.upgradeHomeRam(); + } else if (money > ns.singularity.getUpgradeHomeCoresCost()) { + ns.singularity.upgradeHomeCores(); + } else if (ns.singularity.checkFactionInvitations().length > 0) { + ns.singularity.joinFaction(ns.singularity.checkFactionInvitations()[0]); + } + await ns.sleep(1000); + } +} + + +function getmoney(ns) { + money = ns.getServerMoneyAvailable("home"); +} \ No newline at end of file -- cgit v1.2.3