mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-27 16:37:33 +01:00
Merge pull request #362 from hydroflame/max-servers-func
Max servers func
This commit is contained in:
commit
54ec0110e2
@ -69,8 +69,9 @@ let NetscriptFunctions =
|
||||
"getServerGrowth|getServerSecurityLevel|getServerBaseSecurityLevel|" +
|
||||
"getServerMinSecurityLevel|" +
|
||||
"getServerRequiredHackingLevel|getServerNumPortsRequired|getServerRam|" +
|
||||
"serverExists|fileExists|isRunning|" +
|
||||
"deleteServer|getPurchasedServers|" +
|
||||
"serverExists|fileExists|isRunning|" +
|
||||
"deleteServer|getPurchasedServers|" +
|
||||
"getPurchasedServerLimit|getPurchasedServerMaxRam|" +
|
||||
"purchaseServer|round|write|read|peek|clear|rm|getPortHandle|" +
|
||||
"scriptRunning|scriptKill|getScriptName|getScriptRam|" +
|
||||
"getHackTime|getGrowTime|getWeakenTime|getScriptIncome|getScriptExpGain|" +
|
||||
|
@ -71,6 +71,8 @@ let CONSTANTS = {
|
||||
ScriptGetStockRamCost: 2.0,
|
||||
ScriptBuySellStockRamCost: 2.5,
|
||||
ScriptPurchaseServerRamCost: 2.25,
|
||||
ScriptGetPurchasedServerLimit: 0.05,
|
||||
ScriptGetPurchasedServerMaxRam: 0.05,
|
||||
ScriptRoundRamCost: 0.05,
|
||||
ScriptReadWriteRamCost: 1.0,
|
||||
ScriptArbScriptRamCost: 1.0, //Functions that apply to all scripts regardless of args
|
||||
|
@ -1575,6 +1575,22 @@ function NetscriptFunctions(workerScript) {
|
||||
};
|
||||
return cancelOrder(params, workerScript);
|
||||
},
|
||||
getPurchasedServerLimit : function() {
|
||||
if (workerScript.checkingRam) {
|
||||
return updateStaticRam("getPurchasedServerLimit", CONSTANTS.ScriptGetPurchasedServerLimit);
|
||||
}
|
||||
updateDynamicRam("getPurchasedServerLimit", CONSTANTS.ScriptGetPurchasedServerLimit);
|
||||
|
||||
return CONSTANTS.PurchasedServerLimit;
|
||||
},
|
||||
getPurchasedServerMaxRam: function() {
|
||||
if (workerScript.checkingRam) {
|
||||
return updateStaticRam("getPurchasedServerMaxRam", CONSTANTS.ScriptGetPurchasedServerMaxRam);
|
||||
}
|
||||
updateDynamicRam("getPurchasedServerMaxRam", CONSTANTS.ScriptGetPurchasedServerMaxRam);
|
||||
|
||||
return CONSTANTS.PurchasedServerMaxRam;
|
||||
},
|
||||
purchaseServer : function(hostname, ram) {
|
||||
if (workerScript.checkingRam) {
|
||||
return updateStaticRam("purchaseServer", CONSTANTS.ScriptPurchaseServerRamCost);
|
||||
|
Loading…
Reference in New Issue
Block a user