Philipp committed 2024-10-07 09:49:11 +02:00
commit 880860b5de
7 files changed
+14 -14

No files matched your search

+5 -5
View File
@@ -163,22 +163,22 @@ export async function purchaseAndUpgradeServers(ns) {
ns.disableLog("getServerMaxRam");
let maxPurchasedServers = ns.getPurchasedServerLimit();
let purchasedServers = [];
let count = listPurchasedServers(ns).length;
let pServcount = listPurchasedServers(ns).length;
let currentMoney = 0;
let serverList = {};
while (count < maxPurchasedServers) {
while (pServcount < maxPurchasedServers) {
purchasedServers = listPurchasedServers(ns);
currentMoney = ns.getServerMoneyAvailable("home");
let targetRamInitial = 16;
if (ns.getPurchasedServerCost(targetRamInitial) < currentMoney) {
let sFrontZero = "0";
if (nServers >= 9) {
if (pServcount > 9) {
sFrontZero = "";
}
let hostname = ns.purchaseServer("pserv-" + sFrontZero + (aServers.length), targetRamInitial);
let hostname = ns.purchaseServer("pserv-" + sFrontZero + pServcount, targetRamInitial);
ns.tprint("Purchased " + cCyan + hostname + cReset);
ns.toast("Purchased " + hostname, "info", 10000);
count = listPurchasedServers(ns).length;
pServcount = listPurchasedServers(ns).length;
serverList = JSON.parse(ns.read("serverList.txt"));
serverList[hostname] = {
serverName: hostname,
+1 -1
View File
@@ -1 +1 @@
{"home":{"n00dles":{},"foodnstuff":{},"sigma-cosmetics":{"nectar-net":{"neo-net":{"the-hub":{"syscore":{}}},"omega-net":{"computek":{"rothman-uni":{},"catalyst":{"alpha-ent":{"global-pharm":{}},"aevum-police":{"galactic-cyber":{"omnia":{"defcomm":{"infocomm":{}},"solaris":{"taiyang-digital":{"titan-labs":{},"applied-energetics":{"stormtech":{"omnitek":{"nwo":{},"clarkinc":{}},"4sigma":{"powerhouse-fitness":{"ecorp":{},"megacorp":{},"The-Cave":{}}}}}}},"zeus-med":{"nova-med":{"microdyne":{"helios":{"kuai-gong":{"b-and-a":{"fulcrumassets":{}}},".":{"blade":{}}}},"run4theh111z":{"fulcrumtech":{},"vitalife":{}}}}}}},"millenium-fitness":{"snap-fitness":{"deltaone":{"icarus":{"zb-def":{}},"univ-energy":{}}}}}},"netlink":{"zb-institute":{}}}}},"joesguns":{"zer0":{}},"hong-fang-tea":{"max-hardware":{"silver-helix":{"johnson-ortho":{"summit-uni":{"lexo-corp":{"aerocorp":{"unitalife":{}}},"rho-construction":{}},"I.I.I.I":{}},"crush-fitness":{},"avmnite-02h":{}},"phantasy":{}}},"harakiri-sushi":{},"iron-gym":{"CSEC":{}},"darkweb":{}}}
{"home":{"n00dles":{"nectar-net":{"phantasy":{"netlink":{},"crush-fitness":{},"avmnite-02h":{"rothman-uni":{},"summit-uni":{},"syscore":{"lexo-corp":{"global-pharm":{"deltaone":{"defcomm":{"taiyang-digital":{"applied-energetics":{"stormtech":{".":{"nwo":{"ecorp":{},"The-Cave":{}}}}},"run4theh111z":{"fulcrumtech":{"omnitek":{"clarkinc":{}}},"vitalife":{"4sigma":{"b-and-a":{}}}}}},"icarus":{"nova-med":{"microdyne":{"helios":{"kuai-gong":{"blade":{"megacorp":{}},"powerhouse-fitness":{"fulcrumassets":{}}}}}}}}}},"rho-construction":{},"millenium-fitness":{"aerocorp":{"omnia":{"solaris":{}}},"snap-fitness":{"unitalife":{"univ-energy":{"infocomm":{}},"zeus-med":{"zb-def":{"titan-labs":{}}}}}}}}}}},"foodnstuff":{},"sigma-cosmetics":{"zer0":{"omega-net":{"the-hub":{},"johnson-ortho":{}}},"max-hardware":{}},"joesguns":{},"hong-fang-tea":{},"harakiri-sushi":{},"iron-gym":{"CSEC":{"neo-net":{"computek":{"zb-institute":{"alpha-ent":{},"aevum-police":{"galactic-cyber":{}}},"catalyst":{},"I.I.I.I":{}}},"silver-helix":{}}},"darkweb":{}}}
+3 -3
View File
@@ -27,6 +27,7 @@ export async function main(ns) {
const sServerListFile = "serverList.txt";
const sBestServerFile = "bestTarget.txt";
const sBackdoorScript = "backdoor.js";
const sPServScript = "purchaseServers.js";
//settings
const nRefreshFrequency = 1000; //time in ms
@@ -194,10 +195,9 @@ export async function main(ns) {
ns.tprint(cCyan + "Purchased " + oEXE.ds2.name + cReset);
ns.toast("Purchased " + oEXE.ds2.name, "info", 10000);
}
else if (getSetting(ns, "autoPurchaseServers") && nPServs < 25 && nMoney >= 5e+6) { //Purchased Servers
else if (getSetting(ns, "autoPurchaseServers") && nMoney >= 5e+6 && !ns.scriptRunning(sPServScript, sThisRunner)) { //Purchased Servers
ns.tprint("purchasing servers ");
//await purchaseServers(ns);
purchaseAndUpgradeServers(ns);
ns.exec("purchaseServers.js", sThisRunner);
ns.exec(sServerLister, sThisRunner, 1, false, true);
}
/*else if (getSetting(ns, "autoUpgrades") && nLowestRAM < (2 ** 20) && !ns.scriptRunning("upgrade.js", sThisRunner) && nPServs >= 25 && nMoney >= 1e+6) {
+1 -1
View File
@@ -1 +1 @@
{"serverName":"n00dles","maxRam":4,"maxMoney":196875,"minSec":1,"minPorts":0,"minHackLvl":1,"rootAccess":true,"openPorts":0,"serverOrgs":"Noodle Bar","serverCores":1,"serverFiles":[]}
{"serverName":"the-hub","maxRam":64,"maxMoney":440206450.3125,"minSec":13,"minPorts":2,"minHackLvl":298,"rootAccess":true,"openPorts":0,"serverOrgs":"The Hub","serverCores":2,"serverFiles":[]}
+1 -1
View File
@@ -1,4 +1,4 @@
import { getCracks, scanServerList, findBestTarget, crackingAndRooting, copyAndRunScript, purchaseAndUpgradeServers } from "/RamsesUtils.js";
import { getCracks, scanServerList, findBestTarget, crackingAndRooting, copyAndRunScript, purchaseAndUpgradeServers } from "/Library.js";
/** @param {NS} ns */
export async function main(ns) {
await purchaseAndUpgradeServers(ns);
+1 -1
View File
@@ -1 +1 @@
{"home":{"serverName":"home","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"Home PC","serverCores":7,"serverFiles":["AutoLink.exe","BruteSSH.exe","CrackAndRootAll.js","DeepscanV1.exe","DeepscanV2.exe","EveryServerRun.js","FTPCrack.exe","HTTPWorm.exe","Library.js","NUKE.exe","RMgrow.js","RMhack.js","RMweaken.js","Ramses/Backdoor.js","Ramses/ContractSolver.js","Ramses/ContractSolverRamses.js","Ramses/CorpControl.js","Ramses/CrackAndRootAll.js","Ramses/RamsesUtils.js","Ramses/S4controller.js","Ramses/S4logHelper.js","Ramses/S4tGrow.js","Ramses/S4tHack.js","Ramses/S4tWeaken.js","Ramses/S4utils.js","Ramses/Serverlist.js","Ramses/analyzeContract.js","Ramses/corp/Autosell.js","Ramses/corp/HireWorkers.js","Ramses/corp/SetupExport.js","Ramses/corp/Smart.js","Ramses/corp/UpgradeOffice.js","Ramses/killAllScript.js","Ramses/purchaseServers.js","SQLInject.exe","ServerRouteList.txt","Serverlist.js","Updatebesttarget.js","algorithm.js","ascii/detective.txt","ascii/detective2.txt","ascii/detective3.txt","ascii/hacker.txt","ascii/judge.txt","ascii/noir.txt","ascii/sonic.js","autoexec.js","b1t_flum3.exe","backdoor.js","backup/batch2.js","backup/bitnodeStart.js","backup/growrepeater.js","backup/maxGrow.js","backup/myLibrary.js","backup/serverlister.js","backup/upgrade.js","batch.js","bestTarget.txt","breach.js","contract.js","csec-test.msg","factionboost.js","fl1ght.exe","gang/argFunctions.js","gang/auto-gang.js","gang/auto-gang2.js","gang/gangManager.js","hackers-starting-handbook.lit","hacknet/hacknetmanager.js","j0.msg","j1.msg","killAllScripts.js","notes.txt","purchaseServers.js","relaySMTP.exe","serverList.txt","settings.txt","sharePserv.js","singularity/RMroutelist.js","singularity/manualalgo.js","wip/Minimum_Path_Sum_in_a_Triangle.js","wip/RMbreach.js","wip/RMcontroller.js","wip/progress.js","wip/pserv.js","wip/scanFactionAugments.js","wip/test.js","wip/testhackgrow.js"]},"darkweb":{"serverName":"darkweb","maxRam":0,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"darkweb","serverCores":1,"serverFiles":[]},"iron-gym":{"serverName":"iron-gym","maxRam":32,"maxMoney":56250000,"minSec":10,"minPorts":1,"minHackLvl":100,"rootAccess":true,"openPorts":0,"serverOrgs":"Iron Gym Network","serverCores":1,"serverFiles":[]},"CSEC":{"serverName":"CSEC","maxRam":8,"maxMoney":0,"minSec":1,"minPorts":1,"minHackLvl":60,"rootAccess":true,"openPorts":0,"serverOrgs":"CyberSec","serverCores":2,"serverFiles":["democracy-is-dead.lit"]},"harakiri-sushi":{"serverName":"harakiri-sushi","maxRam":16,"maxMoney":11250000,"minSec":5,"minPorts":0,"minHackLvl":40,"rootAccess":true,"openPorts":0,"serverOrgs":"HaraKiri Sushi Bar Network","serverCores":1,"serverFiles":[]},"hong-fang-tea":{"serverName":"hong-fang-tea","maxRam":16,"maxMoney":8437500,"minSec":5,"minPorts":0,"minHackLvl":30,"rootAccess":true,"openPorts":0,"serverOrgs":"HongFang Teahouse","serverCores":1,"serverFiles":["brighter-than-the-sun.lit"]},"max-hardware":{"serverName":"max-hardware","maxRam":32,"maxMoney":28125000,"minSec":5,"minPorts":1,"minHackLvl":80,"rootAccess":true,"openPorts":0,"serverOrgs":"Max Hardware Store","serverCores":1,"serverFiles":[]},"phantasy":{"serverName":"phantasy","maxRam":32,"maxMoney":67500000,"minSec":7,"minPorts":2,"minHackLvl":100,"rootAccess":true,"openPorts":1,"serverOrgs":"Phantasy Club","serverCores":3,"serverFiles":[]},"silver-helix":{"serverName":"silver-helix","maxRam":64,"maxMoney":126562500,"minSec":10,"minPorts":2,"minHackLvl":150,"rootAccess":true,"openPorts":1,"serverOrgs":"Silver Helix","serverCores":3,"serverFiles":["new-triads.lit"]},"avmnite-02h":{"serverName":"avmnite-02h","maxRam":64,"maxMoney":0,"minSec":1,"minPorts":2,"minHackLvl":207,"rootAccess":true,"openPorts":1,"serverOrgs":"NiteSec","serverCores":2,"serverFiles":["democracy-is-dead.lit"]},"crush-fitness":{"serverName":"crush-fitness","maxRam":0,"maxMoney":135391199.0625,"minSec":15,"minPorts":2,"minHackLvl":269,"rootAccess":true,"openPorts":1,"serverOrgs":"Crush Fitness","serverCores":4,"serverFiles":[]},"johnson-ortho":{"serverName":"johnson-ortho","maxRam":0,"maxMoney":238779168.75,"minSec":14,"minPorts":2,"minHackLvl":264,"rootAccess":true,"openPorts":1,"serverOrgs":"Johnson Orthopedics","serverCores":4,"serverFiles":[]},"I.I.I.I":{"serverName":"I.I.I.I","maxRam":16,"maxMoney":0,"minSec":1,"minPorts":3,"minHackLvl":346,"rootAccess":true,"openPorts":2,"serverOrgs":"I.I.I.I","serverCores":4,"serverFiles":["democracy-is-dead.lit"]},"summit-uni":{"serverName":"summit-uni","maxRam":32,"maxMoney":652682145.9375,"minSec":15,"minPorts":3,"minHackLvl":469,"rootAccess":true,"openPorts":2,"serverOrgs":"Summit University","serverCores":3,"serverFiles":["secret-societies.lit","synthetic-muscles.lit","the-failed-frontier.lit"]},"rho-construction":{"serverName":"rho-construction","maxRam":64,"maxMoney":1598746899.375,"minSec":15,"minPorts":3,"minHackLvl":511,"rootAccess":true,"oLine truncated
{"home":{"serverName":"home","maxRam":4194304,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"Home PC","serverCores":7,"serverFiles":["AutoLink.exe","BruteSSH.exe","CrackAndRootAll.js","DeepscanV1.exe","DeepscanV2.exe","EveryServerRun.js","FTPCrack.exe","HTTPWorm.exe","Library.js","NUKE.exe","RMgrow.js","RMhack.js","RMweaken.js","Ramses/Backdoor.js","Ramses/ContractSolver.js","Ramses/ContractSolverRamses.js","Ramses/CorpControl.js","Ramses/CrackAndRootAll.js","Ramses/RamsesUtils.js","Ramses/S4controller.js","Ramses/S4logHelper.js","Ramses/S4tGrow.js","Ramses/S4tHack.js","Ramses/S4tWeaken.js","Ramses/S4utils.js","Ramses/Serverlist.js","Ramses/analyzeContract.js","Ramses/corp/Autosell.js","Ramses/corp/HireWorkers.js","Ramses/corp/SetupExport.js","Ramses/corp/Smart.js","Ramses/corp/UpgradeOffice.js","Ramses/killAllScript.js","Ramses/purchaseServers.js","SQLInject.exe","ServerRouteList.txt","Serverlist.js","Updatebesttarget.js","algorithm.js","ascii/detective.txt","ascii/detective2.txt","ascii/detective3.txt","ascii/hacker.txt","ascii/judge.txt","ascii/noir.txt","ascii/sonic.js","autoexec.js","b1t_flum3.exe","backdoor.js","backup/batch2.js","backup/bitnodeStart.js","backup/growrepeater.js","backup/maxGrow.js","backup/myLibrary.js","backup/serverlister.js","backup/upgrade.js","batch.js","bestTarget.txt","breach.js","contract.js","csec-test.msg","factionboost.js","fl1ght.exe","gang/argFunctions.js","gang/auto-gang.js","gang/auto-gang2.js","gang/gangManager.js","hackers-starting-handbook.lit","hacknet/hacknetmanager.js","j0.msg","j1.msg","j2.msg","j3.msg","killAllScripts.js","nitesec-test.msg","notes.txt","purchaseServers.js","relaySMTP.exe","serverList.txt","settings.txt","sharePserv.js","singularity/RMroutelist.js","singularity/manualalgo.js","wip/Minimum_Path_Sum_in_a_Triangle.js","wip/RMbreach.js","wip/RMcontroller.js","wip/progress.js","wip/pserv.js","wip/scanFactionAugments.js","wip/test.js","wip/testhackgrow.js"]},"pserv-24":{"serverName":"pserv-24","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-23":{"serverName":"pserv-23","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-22":{"serverName":"pserv-22","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-21":{"serverName":"pserv-21","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-20":{"serverName":"pserv-20","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-19":{"serverName":"pserv-19","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-18":{"serverName":"pserv-18","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-17":{"serverName":"pserv-17","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-16":{"serverName":"pserv-16","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-15":{"serverName":"pserv-15","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-14":{"serverName":"pserv-14","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-13":{"serverName":"pserv-13","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-12":{"serverName":"pserv-12","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-11":{"serverName":"pserv-11","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-10":{"serverName":"pserv-10","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-09":{"serverName":"pserv-09","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"openPorts":4,"serverOrgs":"","serverCores":1,"serverFiles":[]},"pserv-08Line truncated
+2 -2
View File
@@ -1,6 +1,6 @@
{"setting":{
"autoUpgrades":true,
"autoPurchaseServers":true,
"batchHacks":100,
"batchFrequency":50
"batchHacks":1,
"batchFrequency":100
}}