From 276996b1e17be7d10b1b2ee363c5146efee83499 Mon Sep 17 00:00:00 2001 From: Mizzajl Date: Sun, 6 Oct 2024 12:43:53 +0200 Subject: [PATCH] first try? --- Mizzajl/home/EveryServerRun.js | 7 +++++-- Mizzajl/home/autoexec.js | 2 +- Mizzajl/home/bestTarget.txt | 1 + Mizzajl/home/serverList.txt | 1 + Mizzajl/home/serverlister.js | 24 ++---------------------- 5 files changed, 10 insertions(+), 25 deletions(-) create mode 100644 Mizzajl/home/bestTarget.txt create mode 100644 Mizzajl/home/serverList.txt diff --git a/Mizzajl/home/EveryServerRun.js b/Mizzajl/home/EveryServerRun.js index 455cff7..2b40576 100644 --- a/Mizzajl/home/EveryServerRun.js +++ b/Mizzajl/home/EveryServerRun.js @@ -20,6 +20,8 @@ export async function main(ns) { const sWeakenScript = "RMweaken.js"; const sGrowScript = "RMgrow.js"; const sHackScript = "RMhack.js"; + const sLibraryScript = "myLibrary.js" + const sSettingsFile = "settings.txt" const nWeakenThreads = 1; //5 const nHackThreads = 1; //1 @@ -32,7 +34,7 @@ export async function main(ns) { //ns.tprint("nGrowScriptRAM = " + nGrowScriptRAM); //const nFrequency = 50; - const nFrequency = getSetting("batchFrequency"); + const nFrequency = getSetting(ns, "batchFrequency"); let nScriptsRAM; let nMaxRam; let nScripts; @@ -66,6 +68,8 @@ export async function main(ns) { ns.scp(sWeakenScript, entry.serverName, "home"); ns.scp(sGrowScript, entry.serverName, "home"); ns.scp(sHackScript, entry.serverName, "home"); + ns.scp(sLibraryScript, entry.serverName, "home"); + ns.scp(sSettingsFile, entry.serverName, "home"); ns.exec(sScript, entry.serverName, 1, sTarget, nFrequency, true, false); await ns.sleep(1); } @@ -75,7 +79,6 @@ export async function main(ns) { ns.scriptKill(sWeakenScript, entry.serverName); ns.scriptKill(sGrowScript, entry.serverName); ns.scriptKill(sHackScript, entry.serverName); - ns.scp(sShareScript, entry.serverName); let nShare = Math.floor(((ns.getServerMaxRam(entry.serverName) - ns.getServerUsedRam(entry.serverName)) / ns.getScriptRam(sShareScript))); diff --git a/Mizzajl/home/autoexec.js b/Mizzajl/home/autoexec.js index 18ba375..3e6dd64 100644 --- a/Mizzajl/home/autoexec.js +++ b/Mizzajl/home/autoexec.js @@ -31,7 +31,7 @@ export async function main(ns) { //settings const nRefreshFrequency = 1000; //time in ms - ns.exec(sServerLister, sThisRunner, 1, false, true); + //ns.exec(sServerLister, sThisRunner, 1, false, true); await ns.sleep(100); let oBestTarget = JSON.parse(ns.read("bestTarget.txt")); diff --git a/Mizzajl/home/bestTarget.txt b/Mizzajl/home/bestTarget.txt new file mode 100644 index 0000000..c4d425a --- /dev/null +++ b/Mizzajl/home/bestTarget.txt @@ -0,0 +1 @@ +{"serverName":"rho-construction","maxRam":32,"maxMoney":1749766941.5625,"minSec":13,"minPorts":3,"minHackLvl":516,"rootAccess":true,"factorMoneyPerTime":0.6585689125741893,"openPorts":0,"serverFiles":["factionboost.js"],"hackingChance":0.5840500979124218} \ No newline at end of file diff --git a/Mizzajl/home/serverList.txt b/Mizzajl/home/serverList.txt new file mode 100644 index 0000000..2fca0fe --- /dev/null +++ b/Mizzajl/home/serverList.txt @@ -0,0 +1 @@ +{"home":{"serverName":"home","maxRam":524288,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["19dfj3l1nd.msg","AutoLink.exe","BruteSSH.exe","DeepscanV1.exe","DeepscanV2.exe","EveryServerRun.js","FTPCrack.exe","HTTPWorm.exe","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","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","batch.js","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","j4.msg","killallall.js","myLibrary.js","nitesec-test.msg","notes.txt","progress.js","push.txt","relaySMTP.exe","scanFactionAugments.js","serverList.txt","serverlister.js","settings.txt","sharePserv.js","singularity/RMroutelist.js","singularity/manualalgo.js","upgrade.js","wip/Minimum_Path_Sum_in_a_Triangle.js","wip/RMbreach.js","wip/RMcontroller.js","wip/pserv.js","wip/scanFactionAugments.js","wip/test.js","wip/testhackgrow.js"],"hackingChance":1},"pserv-25":{"serverName":"pserv-25","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-24":{"serverName":"pserv-24","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-23":{"serverName":"pserv-23","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-22":{"serverName":"pserv-22","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-21":{"serverName":"pserv-21","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-20":{"serverName":"pserv-20","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-19":{"serverName":"pserv-19","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-18":{"serverName":"pserv-18","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-17":{"serverName":"pserv-17","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-16":{"serverName":"pserv-16","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-15":{"serverName":"pserv-15","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-14":{"serverName":"pserv-14","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-13":{"serverName":"pserv-13","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-12":{"serverName":"pserv-12","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-11":{"serverName":"pserv-11","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-10":{"serverName":"pserv-10","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-09":{"serverName":"pserv-09","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-08":{"serverName":"pserv-08","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-07":{"serverName":"pserv-07","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-06":{"serverName":"pserv-06","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-05":{"serverName":"pserv-05","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-04":{"serverName":"pserv-04","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-03":{"serverName":"pserv-03","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-02":{"serverName":"pserv-02","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"pserv-01":{"serverName":"pserv-01","maxRam":1048576,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":1},"darkweb":{"serverName":"darkweb","maxRam":0,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":[],"hackingChance":1},"iron-gym":{"serverName":"iron-gym","maxRam":32,"maxMoney":56250000,"minSec":10,"minPorts":1,"minHackLvl":100,"rootAccess":true,"factorMoneyPerTime":0.12187500000000002,"openPorts":0,"serverFiles":["factionboost.js"],"hackingChance":0.8369715827994648},"harakiri-sushi":{"serverName":"harakiri-sushi","maxRam":16,"maxMoney":11250000,"minSec":5,"minPorts":0,"minHackLvl":40,"rootAccess":true,"factorMoneyPerTime":0.073125,"openPorts":0,"serverFiles":["contract-822787.cct","factionboost.js"],"hackingChance":1},"hong-fang-tea":{"serverName":"hong-fang-tea","maxRam":16,"maxMoney":8437500,"minSec":5,"minPorts":0,"minHackLvl":30,"rootAccess":true,"factorMoneyPerTime":0.06267857142857143,"openPorts":0,"serverFiles":["brighter-than-the-sun.lit","factionboost.js"],"hackingChance":1},"joesguns":{"serverName":"joesguns","maxRam":16,"maxMoney":7031250,"minSec":5,"minPorts":0,"minHackLvl":10,"rootAccess":true,"factorMoneyPerTime":0.073125,"openPorts":0,"serverFiles":["factionboost.js"],"hackingChance":1},"sigma-cosmetics":{"serverName":"sigma-cosmetics","maxRam":16,"maxMoney":6468750,"minSec":3,"minPorts":0,"minHackLvl":5,"rootAccess":true,"factorMoneyPerTime":0.07822674418604651,"openPorts":0,"serverFiles":["factionboost.js"],"hackingChance":1},"CSEC":{"serverName":"CSEC","maxRam":8,"maxMoney":0,"minSec":1,"minPorts":1,"minHackLvl":57,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":0,"serverFiles":["democracy-is-dead.lit","factionboost.js"],"hackingChance":1},"foodnstuff":{"serverName":"foodnstuff","maxRam":16,"maxMoney":5625000,"minSec":3,"minPorts":0,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0.07204433497536947,"openPorts":0,"serverFiles":["contract-636046.cct","contract-978574.cct","factionboost.js","sector-12-crime.lit"],"hackingChance":1},"max-hardware":{"serverName":"max-hardware","maxRam":32,"maxMoney":28125000,"minSec":5,"minPorts":1,"minHackLvl":80,"rootAccess":true,"factorMoneyPerTime":0.12187500000000002,"openPorts":0,"serverFiles":["factionboost.js"],"hackingChance":1},"omega-net":{"serverName":"omega-net","maxRam":32,"maxMoney":196514330.625,"minSec":11,"minPorts":2,"minHackLvl":210,"rootAccess":true,"factorMoneyPerTime":0.2035606612051793,"openPorts":1,"serverFiles":["factionboost.js","the-new-god.lit"],"hackingChance":0.9408476854293473},"avmnite-02h":{"serverName":"avmnite-02h","maxRam":32,"maxMoney":0,"minSec":1,"minPorts":2,"minHackLvl":208,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":1,"serverFiles":["contract-597744.cct","democracy-is-dead.lit","factionboost.js"],"hackingChance":1},"I.I.I.I":{"serverName":"I.I.I.I","maxRam":128,"maxMoney":0,"minSec":1,"minPorts":3,"minHackLvl":363,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":2,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","democracy-is-dead.lit","myLibrary.js","settings.txt"],"hackingChance":0.8560142595630075},"lexo-corp":{"serverName":"lexo-corp","maxRam":16,"maxMoney":2069915557.5,"minSec":21,"minPorts":4,"minHackLvl":674,"rootAccess":true,"factorMoneyPerTime":0.37493245433328687,"openPorts":3,"serverFiles":["factionboost.js"],"hackingChance":0.17509697232941585},"snap-fitness":{"serverName":"snap-fitness","maxRam":0,"maxMoney":1265625000,"minSec":17,"minPorts":4,"minHackLvl":720,"rootAccess":true,"factorMoneyPerTime":0.26451969453376206,"openPorts":3,"serverFiles":[],"hackingChance":0.1993628552111808},"aerocorp":{"serverName":"aerocorp","maxRam":0,"maxMoney":2964352080.9375,"minSec":28,"minPorts":5,"minHackLvl":915,"rootAccess":true,"factorMoneyPerTime":0.2985017587311193,"openPorts":4,"serverFiles":["contract-627060.cct","man-and-machine.lit"],"hackingChance":0.028884959135710854},"unitalife":{"serverName":"unitalife","maxRam":64,"maxMoney":2954374959.375,"minSec":23,"minPorts":4,"minHackLvl":799,"rootAccess":true,"factorMoneyPerTime":0.4134884477781665,"openPorts":3,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":0.09477287245834541},"univ-energy":{"serverName":"univ-energy","maxRam":16,"maxMoney":3187267405.3125,"minSec":27,"minPorts":4,"minHackLvl":815,"rootAccess":true,"factorMoneyPerTime":0.3731995160464985,"openPorts":3,"serverFiles":["contract-572028.cct","factionboost.js"],"hackingChance":0.05915438254372159},"nova-med":{"serverName":"nova-med","maxRam":0,"maxMoney":3119127378.75,"minSec":24,"minPorts":4,"minHackLvl":849,"rootAccess":true,"factorMoneyPerTime":0.3941354580457815,"openPorts":3,"serverFiles":[],"hackingChance":0.07336402039305384},"applied-energetics":{"serverName":"applied-energetics","maxRam":0,"maxMoney":2018441970,"minSec":25,"minPorts":4,"minHackLvl":838,"rootAccess":true,"factorMoneyPerTime":0.24812998212765958,"openPorts":3,"serverFiles":[],"hackingChance":0.06403776561328837},"stormtech":{"serverName":"stormtech","maxRam":0,"maxMoney":2971835586.5625,"minSec":31,"minPorts":5,"minHackLvl":1032,"rootAccess":true,"factorMoneyPerTime":0.24002151233419794,"openPorts":4,"serverFiles":["contract-615756-NiteSec.cct"],"hackingChance":0.0018123895928289168},"kuai-gong":{"serverName":"kuai-gong","maxRam":0,"maxMoney":60301613368.125,"minSec":32,"minPorts":5,"minHackLvl":1106,"rootAccess":true,"factorMoneyPerTime":4.405040311225135,"openPorts":4,"serverFiles":[],"hackingChance":0},"clarkinc":{"serverName":"clarkinc","maxRam":0,"maxMoney":45937777148.4375,"minSec":18,"minPorts":5,"minHackLvl":1153,"rootAccess":true,"factorMoneyPerTime":5.700020071868735,"openPorts":4,"serverFiles":["beyond-man.lit","contract-256474.cct","cost-of-immortality.lit"],"hackingChance":0},"megacorp":{"serverName":"megacorp","maxRam":0,"maxMoney":155265627000.9375,"minSec":33,"minPorts":5,"minHackLvl":1130,"rootAccess":true,"factorMoneyPerTime":10.767954926712124,"openPorts":4,"serverFiles":[],"hackingChance":0},"blade":{"serverName":"blade","maxRam":64,"maxMoney":107670895371.5625,"minSec":30,"minPorts":5,"minHackLvl":1177,"rootAccess":true,"factorMoneyPerTime":7.883535003268446,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","beyond-man.lit","myLibrary.js","settings.txt"],"hackingChance":0},"fulcrumtech":{"serverName":"fulcrumtech","maxRam":512,"maxMoney":4090821741.5625,"minSec":29,"minPorts":5,"minHackLvl":977,"rootAccess":true,"factorMoneyPerTime":0.3727661489525287,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt","simulated-reality.lit"],"hackingChance":0.011025370023042576},".":{"serverName":".","maxRam":16,"maxMoney":0,"minSec":1,"minPorts":4,"minHackLvl":514,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":3,"serverFiles":["factionboost.js"],"hackingChance":0.6678655649574557},"b-and-a":{"serverName":"b-and-a","maxRam":0,"maxMoney":79095950848.125,"minSec":27,"minPorts":5,"minHackLvl":1149,"rootAccess":true,"factorMoneyPerTime":6.586473823947891,"openPorts":4,"serverFiles":[],"hackingChance":0},"ecorp":{"serverName":"ecorp","maxRam":0,"maxMoney":167282154509.0625,"minSec":33,"minPorts":5,"minHackLvl":1193,"rootAccess":true,"factorMoneyPerTime":10.991776434167216,"openPorts":4,"serverFiles":[],"hackingChance":0},"4sigma":{"serverName":"4sigma","maxRam":0,"maxMoney":67097355693.75,"minSec":23,"minPorts":5,"minHackLvl":1093,"rootAccess":true,"factorMoneyPerTime":6.88476754424997,"openPorts":4,"serverFiles":["contract-939874.cct"],"hackingChance":0},"deltaone":{"serverName":"deltaone","maxRam":0,"maxMoney":4563772689.375,"minSec":28,"minPorts":5,"minHackLvl":857,"rootAccess":true,"factorMoneyPerTime":0.49040374410543064,"openPorts":4,"serverFiles":[],"hackingChance":0.03643658243916467},"zeus-med":{"serverName":"zeus-med","maxRam":0,"maxMoney":3656464233.75,"minSec":29,"minPorts":5,"minHackLvl":818,"rootAccess":true,"factorMoneyPerTime":0.3974085363995485,"openPorts":4,"serverFiles":[],"hackingChance":0.03795949313869453},"icarus":{"serverName":"icarus","maxRam":0,"maxMoney":2728379078.4375,"minSec":30,"minPorts":5,"minHackLvl":883,"rootAccess":true,"factorMoneyPerTime":0.26578439879870736,"openPorts":4,"serverFiles":[],"hackingChance":0.018916816375151815},"zb-def":{"serverName":"zb-def","maxRam":0,"maxMoney":2635448774.0625,"minSec":20,"minPorts":4,"minHackLvl":794,"rootAccess":true,"factorMoneyPerTime":0.42612977690065296,"openPorts":3,"serverFiles":["contract-817042-CyberSec.cct","synthetic-muscles.lit"],"hackingChance":0.12565901176947156},"microdyne":{"serverName":"microdyne","maxRam":16,"maxMoney":1828178758.125,"minSec":23,"minPorts":5,"minHackLvl":814,"rootAccess":true,"factorMoneyPerTime":0.2512030848285065,"openPorts":4,"serverFiles":["factionboost.js","synthetic-muscles.lit"],"hackingChance":0.09207946014678023},"taiyang-digital":{"serverName":"taiyang-digital","maxRam":0,"maxMoney":2281447456.875,"minSec":24,"minPorts":5,"minHackLvl":880,"rootAccess":true,"factorMoneyPerTime":0.2782252996189024,"openPorts":4,"serverFiles":["A-Green-Tomorrow.lit","brighter-than-the-sun.lit"],"hackingChance":0.05776991827142172},"titan-labs":{"serverName":"titan-labs","maxRam":16,"maxMoney":2374794447.1875,"minSec":25,"minPorts":5,"minHackLvl":812,"rootAccess":true,"factorMoneyPerTime":0.3011934420823171,"openPorts":4,"serverFiles":["coded-intelligence.lit","factionboost.js"],"hackingChance":0.07788240833628704},"vitalife":{"serverName":"vitalife","maxRam":32,"maxMoney":2137470136.875,"minSec":29,"minPorts":5,"minHackLvl":824,"rootAccess":true,"factorMoneyPerTime":0.2306367179562998,"openPorts":4,"serverFiles":["A-Green-Tomorrow.lit","contract-993088-CyberSec.cct","factionboost.js"],"hackingChance":0.03413333733161126},"omnitek":{"serverName":"omnitek","maxRam":512,"maxMoney":54581820887.8125,"minSec":30,"minPorts":5,"minHackLvl":929,"rootAccess":true,"factorMoneyPerTime":5.0556727576883675,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","coded-intelligence.lit","history-of-synthoids.lit","myLibrary.js","settings.txt"],"hackingChance":0.015229106995298535},"powerhouse-fitness":{"serverName":"powerhouse-fitness","maxRam":16,"maxMoney":2531250000,"minSec":21,"minPorts":5,"minHackLvl":1041,"rootAccess":true,"factorMoneyPerTime":0.29832056570418386,"openPorts":4,"serverFiles":["factionboost.js"],"hackingChance":0.0040778765838650624},"The-Cave":{"serverName":"The-Cave","maxRam":0,"maxMoney":0,"minSec":1,"minPorts":5,"minHackLvl":925,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":4,"serverFiles":["alpha-omega.lit"],"hackingChance":0.155752230633735},"fulcrumassets":{"serverName":"fulcrumassets","maxRam":0,"maxMoney":2812500,"minSec":33,"minPorts":5,"minHackLvl":1498,"rootAccess":true,"factorMoneyPerTime":0.00014732844421162913,"openPorts":4,"serverFiles":[],"hackingChance":0},"nwo":{"serverName":"nwo","maxRam":0,"maxMoney":102925863644.0625,"minSec":33,"minPorts":5,"minHackLvl":950,"rootAccess":true,"factorMoneyPerTime":8.482004610921157,"openPorts":4,"serverFiles":["the-hidden-world.lit"],"hackingChance":0.0012586038839089697},"infocomm":{"serverName":"infocomm","maxRam":0,"maxMoney":1815631956.5625,"minSec":29,"minPorts":5,"minHackLvl":902,"rootAccess":true,"factorMoneyPerTime":0.1790971654549852,"openPorts":4,"serverFiles":[],"hackingChance":0.024215538726408577},"run4theh111z":{"serverName":"run4theh111z","maxRam":64,"maxMoney":0,"minSec":1,"minPorts":4,"minHackLvl":518,"rootAccess":true,"factorMoneyPerTime":0,"openPorts":3,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt","simulated-reality.lit","the-new-god.lit"],"hackingChance":0.6628814935771763},"helios":{"serverName":"helios","maxRam":64,"maxMoney":1752766000.3125,"minSec":29,"minPorts":5,"minHackLvl":871,"rootAccess":true,"factorMoneyPerTime":0.179001201964433,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","beyond-man.lit","myLibrary.js","settings.txt"],"hackingChance":0.029287712378561724},"catalyst":{"serverName":"catalyst","maxRam":16,"maxMoney":1409611246.875,"minSec":21,"minPorts":3,"minHackLvl":419,"rootAccess":true,"factorMoneyPerTime":0.40726627868374266,"openPorts":2,"serverFiles":["factionboost.js","tensions-in-tech-race.lit"],"hackingChance":0.29384624877622717},"syscore":{"serverName":"syscore","maxRam":0,"maxMoney":1311487849.6875,"minSec":22,"minPorts":4,"minHackLvl":630,"rootAccess":true,"factorMoneyPerTime":0.24252264645714794,"openPorts":3,"serverFiles":[],"hackingChance":0.18501477093461854},"aevum-police":{"serverName":"aevum-police","maxRam":64,"maxMoney":906136543.125,"minSec":27,"minPorts":4,"minHackLvl":414,"rootAccess":true,"factorMoneyPerTime":0.20706231430172262,"openPorts":3,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":0.16009441403322097},"global-pharm":{"serverName":"global-pharm","maxRam":64,"maxMoney":4779752239.6875,"minSec":27,"minPorts":4,"minHackLvl":832,"rootAccess":true,"factorMoneyPerTime":0.5483302075179801,"openPorts":3,"serverFiles":["A-Green-Tomorrow.lit","RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":0.05487512933843108},"omnia":{"serverName":"omnia","maxRam":16,"maxMoney":2634518927.8125,"minSec":31,"minPorts":5,"minHackLvl":912,"rootAccess":true,"factorMoneyPerTime":0.24057843538608104,"openPorts":4,"serverFiles":["factionboost.js","history-of-synthoids.lit"],"hackingChance":0.013894986878355026},"solaris":{"serverName":"solaris","maxRam":32,"maxMoney":2214169056.5625,"minSec":24,"minPorts":5,"minHackLvl":772,"rootAccess":true,"factorMoneyPerTime":0.30739211592601984,"openPorts":4,"serverFiles":["A-Green-Tomorrow.lit","factionboost.js","the-failed-frontier.lit"],"hackingChance":0.10146864512074112},"defcomm":{"serverName":"defcomm","maxRam":0,"maxMoney":2563498515.9375,"minSec":32,"minPorts":5,"minHackLvl":1032,"rootAccess":true,"factorMoneyPerTime":0.20061088795561943,"openPorts":4,"serverFiles":[],"hackingChance":0.0011327434955180728},"rho-construction":{"serverName":"rho-construction","maxRam":32,"maxMoney":1749766941.5625,"minSec":13,"minPorts":3,"minHackLvl":516,"rootAccess":true,"factorMoneyPerTime":0.6585689125741893,"openPorts":2,"serverFiles":["factionboost.js"],"hackingChance":0.5840500979124218},"phantasy":{"serverName":"phantasy","maxRam":32,"maxMoney":67500000,"minSec":7,"minPorts":2,"minHackLvl":100,"rootAccess":true,"factorMoneyPerTime":0.195,"openPorts":1,"serverFiles":["factionboost.js"],"hackingChance":0.9565389517708172},"zer0":{"serverName":"zer0","maxRam":32,"maxMoney":21093750,"minSec":8,"minPorts":1,"minHackLvl":75,"rootAccess":true,"factorMoneyPerTime":0.0685546875,"openPorts":0,"serverFiles":["contract-471403-TheBlackHand.cct","contract-884690.cct","factionboost.js"],"hackingChance":0.920354090108434},"silver-helix":{"serverName":"silver-helix","maxRam":64,"maxMoney":126562500,"minSec":10,"minPorts":2,"minHackLvl":150,"rootAccess":true,"factorMoneyPerTime":0.1935661764705882,"openPorts":1,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","new-triads.lit","settings.txt"],"hackingChance":0.792920446862651},"crush-fitness":{"serverName":"crush-fitness","maxRam":0,"maxMoney":126678588.75,"minSec":13,"minPorts":2,"minHackLvl":266,"rootAccess":true,"factorMoneyPerTime":0.09003945619190815,"openPorts":1,"serverFiles":[],"hackingChance":0.611782175890472},"johnson-ortho":{"serverName":"johnson-ortho","maxRam":0,"maxMoney":206727837.1875,"minSec":21,"minPorts":2,"minHackLvl":279,"rootAccess":true,"factorMoneyPerTime":0.08870975023725036,"openPorts":1,"serverFiles":[],"hackingChance":0.34933809401777366},"netlink":{"serverName":"netlink","maxRam":32,"maxMoney":773437500,"minSec":20,"minPorts":3,"minHackLvl":401,"rootAccess":true,"factorMoneyPerTime":0.24463959854014597,"openPorts":2,"serverFiles":["contract-803046.cct","factionboost.js","simulated-reality.lit"],"hackingChance":0.3185652290561994},"zb-institute":{"serverName":"zb-institute","maxRam":64,"maxMoney":2995904390.625,"minSec":28,"minPorts":5,"minHackLvl":768,"rootAccess":true,"factorMoneyPerTime":0.35889013157136934,"openPorts":4,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":0.05678820724197271},"alpha-ent":{"serverName":"alpha-ent","maxRam":128,"maxMoney":1837465740,"minSec":19,"minPorts":4,"minHackLvl":505,"rootAccess":true,"factorMoneyPerTime":0.4877397574272589,"openPorts":3,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","sector-12-crime.lit","settings.txt"],"hackingChance":0.30181321136137096},"galactic-cyber":{"serverName":"galactic-cyber","maxRam":0,"maxMoney":2278745147.8125,"minSec":19,"minPorts":5,"minHackLvl":854,"rootAccess":true,"factorMoneyPerTime":0.36069264485038965,"openPorts":4,"serverFiles":[],"hackingChance":0.10854199894830956},"the-hub":{"serverName":"the-hub","maxRam":32,"maxMoney":483168296.25,"minSec":13,"minPorts":2,"minHackLvl":318,"rootAccess":true,"factorMoneyPerTime":0.28985638446008305,"openPorts":1,"serverFiles":["factionboost.js"],"hackingChance":0.8015292974285884},"rothman-uni":{"serverName":"rothman-uni","maxRam":128,"maxMoney":601140065.625,"minSec":16,"minPorts":3,"minHackLvl":371,"rootAccess":true,"factorMoneyPerTime":0.2547203667902542,"openPorts":2,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","secret-societies.lit","settings.txt","tensions-in-tech-race.lit","the-failed-frontier.lit"],"hackingChance":0.44438785933057906},"millenium-fitness":{"serverName":"millenium-fitness","maxRam":128,"maxMoney":703125000,"minSec":16,"minPorts":3,"minHackLvl":486,"rootAccess":true,"factorMoneyPerTime":0.22920323470411233,"openPorts":2,"serverFiles":["RMgrow.js","RMhack.js","RMweaken.js","batch.js","myLibrary.js","settings.txt"],"hackingChance":0.3762218729780693},"n00dles":{"serverName":"n00dles","maxRam":4,"maxMoney":196875,"minSec":1,"minPorts":0,"minHackLvl":1,"rootAccess":true,"factorMoneyPerTime":0.0025466417910447762,"openPorts":0,"serverFiles":["contract-405030-Netburners.cct","factionboost.js"],"hackingChance":1},"nectar-net":{"serverName":"nectar-net","maxRam":16,"maxMoney":7734375,"minSec":7,"minPorts":0,"minHackLvl":20,"rootAccess":true,"factorMoneyPerTime":0.0591452205882353,"openPorts":0,"serverFiles":["factionboost.js"],"hackingChance":1},"neo-net":{"serverName":"neo-net","maxRam":32,"maxMoney":14062500,"minSec":8,"minPorts":1,"minHackLvl":50,"rootAccess":true,"factorMoneyPerTime":0.06093750000000001,"openPorts":0,"serverFiles":["factionboost.js","the-hidden-world.lit"],"hackingChance":0.9439529129317272},"computek":{"serverName":"computek","maxRam":0,"maxMoney":678530463.75,"minSec":19,"minPorts":3,"minHackLvl":311,"rootAccess":true,"factorMoneyPerTime":0.2887836316500246,"openPorts":2,"serverFiles":["contract-545076.cct","contract-622943.cct","man-and-machine.lit"],"hackingChance":0.40924763889184057},"summit-uni":{"serverName":"summit-uni","maxRam":32,"maxMoney":684528077.8125,"minSec":20,"minPorts":3,"minHackLvl":439,"rootAccess":true,"factorMoneyPerTime":0.19819298466731627,"openPorts":2,"serverFiles":["factionboost.js","secret-societies.lit","synthetic-muscles.lit","the-failed-frontier.lit"],"hackingChance":0.30760278922735224}} \ No newline at end of file diff --git a/Mizzajl/home/serverlister.js b/Mizzajl/home/serverlister.js index 7194340..3d5fc7b 100644 --- a/Mizzajl/home/serverlister.js +++ b/Mizzajl/home/serverlister.js @@ -301,29 +301,17 @@ function scanServerList(ns, bSilent) { /** @param {NS} ns */ function findBestTarget(ns, maxSec, maxPorts, currentHackLevel, manualTargetOverride) { - //ns.tprint("start of findBestTarget "); const bSilent = ns.args[1] === true ? true : false; // if true supress feedback - //ns.tprint("bSilent = " +bSilent); - let sCurrentBestTarget = JSON.parse(ns.read("bestTarget.txt")); - //let sCurrentBestTarget = "n00dles"; - //ns.tprint("sCurrentBestTarget = " +JSON.stringify(sCurrentBestTarget)); - //if (!bSilent) ns.tprint("sCurrentBestTarget = " + sCurrentBestTarget.serverName); let serverList = JSON.parse(ns.read("serverList.txt")); let bestEntry = null; - let compareTime = 0; + let nMaxMoneyPerChance = 0; let nBestMoneyPerChance = 0; //ns.tprint("before for loop "); for (const [name, entry] of Object.entries(serverList)) { if (entry.minSec <= maxSec && entry.minPorts <= maxPorts && entry.minHackLvl < currentHackLevel) { + nMaxMoneyPerChance = (entry.maxMoney * entry.hackingChance) / entry.minSec; - //ns.tprint("nMaxMoneyPerChance " + nMaxMoneyPerChance); - /* - if (entry.factorMoneyPerTime > compareTime) { - compareTime = entry.factorMoneyPerTime; - bestEntry = name; - } - */ if (nMaxMoneyPerChance > nBestMoneyPerChance) { nBestMoneyPerChance = nMaxMoneyPerChance; bestEntry = name; @@ -333,17 +321,9 @@ function findBestTarget(ns, maxSec, maxPorts, currentHackLevel, manualTargetOver } } } - if (manualTargetOverride.length > 0) { bestEntry = manualTargetOverride; } - - if (sCurrentBestTarget.serverName === bestEntry) { - if (!bSilent) ns.tprint("Same target = " + bestEntry); - } - else { - ns.tprint("New best target = " + cCyan + bestEntry + cReset); - } ns.write("bestTarget.txt", JSON.stringify(serverList[bestEntry]), "w"); }