diff --git a/doc/source/netscriptixapi.rst b/doc/source/netscriptixapi.rst index 0f767a9ee..469a31082 100644 --- a/doc/source/netscriptixapi.rst +++ b/doc/source/netscriptixapi.rst @@ -24,6 +24,14 @@ getStockPrice getStockPrice("FISG"); +getStockSymbols +------------- + +.. js:function:: getStockSymbols() + + Returns an array of the symbols of the tradable stocks. + + getStockPosition ---------------- diff --git a/netscript.js b/netscript.js index d08757ece..d41521685 100644 --- a/netscript.js +++ b/netscript.js @@ -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 diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index bfabb1703..16b8a8168 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -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);