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