mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-14 03:33:52 +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|" +
|
"getServerGrowth|getServerSecurityLevel|getServerBaseSecurityLevel|" +
|
||||||
"getServerMinSecurityLevel|" +
|
"getServerMinSecurityLevel|" +
|
||||||
"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