Added the getStockSymbols method to the TIX API, wich returns an array of the tradable symbols

This commit is contained in:
Santiago Kent 2018-09-29 17:19:24 -03:00 committed by danielyxie
parent 1d20d475f3
commit d39f002b20
3 changed files with 16 additions and 1 deletions

@ -24,6 +24,14 @@ getStockPrice
getStockPrice("FISG");
getStockSymbols
-------------
.. js:function:: getStockSymbols()
Returns an array of the symbols of the tradable stocks.
getStockPosition
----------------

@ -92,7 +92,7 @@ let NetscriptFunctions =
"installAugmentations|" +
// TIX API
"getStockPrice|getStockPosition|buyStock|sellStock|shortStock|sellShort|" +
"getStockPrice|getStockPosition|getStockSymbols|buyStock|sellStock|shortStock|sellShort|" +
"placeOrder|cancelOrder|" +
// Hacknet Node API

@ -1668,6 +1668,13 @@ function NetscriptFunctions(workerScript) {
stock.b ? forecast += stock.otlkMag : forecast -= stock.otlkMag;
return forecast / 100; //Convert from percentage to decimal
},
getStockSymbols : function(){
if (workerScript.checkingRam) {
return updateStaticRam("getStockSymbols", CONSTANTS.ScriptGetStockRamCost);
}
updateDynamicRam("getStockSymbols", CONSTANTS.ScriptGetStockRamCost);
return Object.values(StockSymbols);
},
getPurchasedServerLimit : function() {
if (workerScript.checkingRam) {
return updateStaticRam("getPurchasedServerLimit", CONSTANTS.ScriptGetPurchasedServerLimit);