This commit is contained in:
Olivier Gagnon 2021-10-27 15:16:16 -04:00
parent b255318a20
commit 8f097ebb32
25 changed files with 508 additions and 413 deletions

@ -3,6 +3,60 @@
Changelog Changelog
========= =========
v0.58.0 - 2021-10-27 Road to Steam (hydroflame & community)
-------------------------------------------
** Announcement **
* To prepare for Steam we will fix some inconsistencies in the Netscript API. Ideally we can also write a
save file migration that will automatically convert all breaking changes in your scripts without any
player input.
** BREAKING (kindof) **
* All stock market functions are now under the 'stock' namespace, like 'hacknet'
However when you load your game with v0.58.0 for the first time it should automatically convert everything.
** Gang **
* Ascension formula now better
* Karma requirement now much lower in most nodes
* Territory heavily penalizes gains
* T.R.P. not available outside BN2.
** Netscript **
* It is no longer possible to send anything but strings or numbers to other scripts. (prevents exploits)
* Improve code for some netscript functions (@omuretsu)
** Script Editor **
* Added Solarized light/dark as theme (@CalvinTrops)
* Fixed sleeve namespace smart autocomplete.
** Hacknet Servers **
* Cores affect grow/weaken like they do on home computer
** Infiltration **
* Slash game modified to be easier.
** Misc. **
* Fix typo in corp (@Saynt_Garmo)
* Fixed a bug where corp wouldn't let you buyback shares. (@Saynt_Garmo)
* Fixed a bug where sleeves couldn't perform some crimes. (@Saynt_Garmo)
* Hospitalization and Eating noodles are now toasts (@Saynt_Garmo)
* Fixed some repeated code (@omuretsu)
* Fixed Character Overview preventing clicks underneath it even when hidden. (@omuretsu)
* Fixed typo in tutorial. (@omuretsu)
* Create Programs and Factions invitation badges now dissapear when you open their respective pages.
* Add killall script in character overview.
* Fixed bug in corp that made last city production be the production for all cities for newly created product.
* Fix bug that allowed reputation to transfer to new jobs.
* nerf noodle bar
v0.57.0 - 2021-10-16 It was too cheap! (hydroflame & community) v0.57.0 - 2021-10-16 It was too cheap! (hydroflame & community)
------------------------------------------- -------------------------------------------

@ -64,9 +64,9 @@ documentation_title = '{0} Documentation'.format(project)
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.57' version = '0.58'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.57.0' release = '0.58.0'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

@ -13,25 +13,27 @@ TIX API can be purchased by visiting the World Stock Exchange in-game.
Access to the TIX API currently costs $5 billion. After you purchase it, you will retain this Access to the TIX API currently costs $5 billion. After you purchase it, you will retain this
access even after you 'reset' by installing Augmentations access even after you 'reset' by installing Augmentations
**TIX API functions must be accessed through the stock namespace**
.. toctree:: .. toctree::
:caption: API Functions: :caption: API Functions:
getStockSymbols() <tixapi/getStockSymbols> getSymbols() <tixapi/getSymbols>
getStockPrice() <tixapi/getStockPrice> getPrice() <tixapi/getPrice>
getStockAskPrice() <tixapi/getStockAskPrice> getAskPrice() <tixapi/getAskPrice>
getStockBidPrice() <tixapi/getStockBidPrice> getBidPrice() <tixapi/getBidPrice>
getStockPosition() <tixapi/getStockPosition> getPosition() <tixapi/getPosition>
getStockMaxShares() <tixapi/getStockMaxShares> getMaxShares() <tixapi/getMaxShares>
getStockPurchaseCost() <tixapi/getStockPurchaseCost> getPurchaseCost() <tixapi/getPurchaseCost>
getStockSaleGain() <tixapi/getStockSaleGain> getSaleGain() <tixapi/getSaleGain>
buyStock() <tixapi/buyStock> buy() <tixapi/buy>
sellStock() <tixapi/sellStock> sell() <tixapi/sell>
shortStock() <tixapi/shortStock> short() <tixapi/short>
sellShort() <tixapi/sellShort> sellShort() <tixapi/sellShort>
placeOrder() <tixapi/placeOrder> placeOrder() <tixapi/placeOrder>
cancelOrder() <tixapi/cancelOrder> cancelOrder() <tixapi/cancelOrder>
getOrders() <tixapi/getOrders> getOrders() <tixapi/getOrders>
getStockVolatility() <tixapi/getStockVolatility> getVolatility() <tixapi/getVolatility>
getStockForecast() <tixapi/getStockForecast> getForecast() <tixapi/getForecast>
purchase4SMarketData() <tixapi/purchase4SMarketData> purchase4SMarketData() <tixapi/purchase4SMarketData>
purchase4SMarketDataTixApi() <tixapi/purchase4SMarketDataTixApi> purchase4SMarketDataTixApi() <tixapi/purchase4SMarketDataTixApi>

@ -1,7 +1,7 @@
buyStock() Netscript Function buy() Netscript Function
============================= =============================
.. js:function:: buyStock(sym, shares) .. js:function:: buy(sym, shares)
:RAM cost: 2.5 GB :RAM cost: 2.5 GB
:param string sym: Symbol of stock to purchase :param string sym: Symbol of stock to purchase

@ -1,7 +1,7 @@
getStockAskPrice() Netscript Function getAskPrice() Netscript Function
===================================== =====================================
.. js:function:: getStockAskPrice(sym) .. js:function:: getAskPrice(sym)
:RAM cost: 2 GB :RAM cost: 2 GB
:param string sym: Stock symbol :param string sym: Stock symbol

@ -1,7 +1,7 @@
getStockBidPrice() Netscript Function getBidPrice() Netscript Function
===================================== =====================================
.. js:function:: getStockBidPrice(sym) .. js:function:: getBidPrice(sym)
:RAM cost: 2 GB :RAM cost: 2 GB
:param string sym: Stock symbol :param string sym: Stock symbol

@ -1,7 +1,7 @@
getStockForecast() Netscript Function getForecast() Netscript Function
===================================== =====================================
.. js:function:: getStockForecast(sym) .. js:function:: getForecast(sym)
:RAM cost: 2.5 GB :RAM cost: 2.5 GB
:param string sym: Symbol of stock :param string sym: Symbol of stock

@ -1,7 +1,7 @@
getStockMaxShares() Netscript Function getMaxShares() Netscript Function
====================================== ======================================
.. js:function:: getStockMaxShares(sym) .. js:function:: getMaxShares(sym)
:RAM cost: 2 GB :RAM cost: 2 GB
:param string sym: Stock symbol :param string sym: Stock symbol

@ -1,7 +1,7 @@
getStockPosition() Netscript Function getPosition() Netscript Function
===================================== =====================================
.. js:function:: getStockPosition(sym) .. js:function:: getPosition(sym)
:RAM cost: 2 GB :RAM cost: 2 GB
:param string sym: Stock symbol :param string sym: Stock symbol
@ -21,7 +21,7 @@ getStockPosition() Netscript Function
Example:: Example::
pos = getStockPosition("ECP"); pos = getPosition("ECP");
shares = pos[0]; shares = pos[0];
avgPx = pos[1]; avgPx = pos[1];
sharesShort = pos[2]; sharesShort = pos[2];

@ -1,7 +1,7 @@
getStockPrice() Netscript Function getPrice() Netscript Function
================================== ==================================
.. js:function:: getStockPrice(sym) .. js:function:: getPrice(sym)
:RAM cost: 2 GB :RAM cost: 2 GB
:param string sym: Stock symbol :param string sym: Stock symbol
@ -15,4 +15,4 @@ getStockPrice() Netscript Function
Example:: Example::
getStockPrice("FSIG"); getPrice("FSIG");

@ -1,7 +1,7 @@
getStockPurchaseCost() Netscript Function getPurchaseCost() Netscript Function
========================================= =========================================
.. js:function:: getStockPurchaseCost(sym, shares, posType) .. js:function:: getPurchaseCost(sym, shares, posType)
:RAM cost: 2 GB :RAM cost: 2 GB
:param string sym: Stock symbol :param string sym: Stock symbol

@ -1,7 +1,7 @@
getStockSaleGain() Netscript Function getSaleGain() Netscript Function
===================================== =====================================
.. js:function:: getStockSaleGain(sym, shares, posType) .. js:function:: getSaleGain(sym, shares, posType)
:RAM cost: 2 GB :RAM cost: 2 GB
:param string sym: Stock symbol :param string sym: Stock symbol

@ -1,7 +1,7 @@
getStockSymbols() Netscript Function() getSymbols() Netscript Function()
====================================== ======================================
.. js:function:: getStockSymbols() .. js:function:: getSymbols()
:RAM cost: 2 GB :RAM cost: 2 GB

@ -1,7 +1,7 @@
sellStock() Netscript Function sell() Netscript Function
============================== ==============================
.. js:function:: sellStock(sym, shares) .. js:function:: sell(sym, shares)
:RAM cost: 2.5 GB :RAM cost: 2.5 GB
:param string sym: Symbol of stock to sell :param string sym: Symbol of stock to sell

@ -1,7 +1,7 @@
shortStock() Netscript Function short() Netscript Function
=============================== ===============================
.. js:function:: shortStock(sym, shares) .. js:function:: short(sym, shares)
:RAM cost: 2.5 GB :RAM cost: 2.5 GB
:param string sym: Symbol of stock to short :param string sym: Symbol of stock to short

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
{ {
"name": "bitburner", "name": "bitburner",
"license": "SEE LICENSE IN license.txt", "license": "SEE LICENSE IN license.txt",
"version": "0.56.0", "version": "0.58.0",
"main": "electron-main.js", "main": "electron-main.js",
"author": { "author": {
"name": "Daniel Xie" "name": "Daniel Xie"

@ -114,7 +114,7 @@ export const CONSTANTS: {
TotalNumBitNodes: number; TotalNumBitNodes: number;
LatestUpdate: string; LatestUpdate: string;
} = { } = {
Version: "0.57.0", Version: "0.58.0",
// Speed (in ms) at which the main loop is updated // Speed (in ms) at which the main loop is updated
_idleSpeed: 200, _idleSpeed: 200,
@ -281,55 +281,58 @@ export const CONSTANTS: {
TotalNumBitNodes: 24, TotalNumBitNodes: 24,
LatestUpdate: ` LatestUpdate: `
v0.57.0 - 2021-10-16 It was too cheap! (hydroflame & community) v0.58.0 - 2021-10-27 Road to Steam (hydroflame & community)
------------------------------------------- -------------------------------------------
** Announcement **
* To prepare for Steam we will fix some inconsistencies in the Netscript API. Ideally we can also write a
save file migration that will automatically convert all breaking changes in your scripts without any
player input.
** BREAKING (kindof) ** ** BREAKING (kindof) **
* purchased server cost now scales exponentially past 2^10. * All stock market functions are now under the 'stock' namespace, like 'hacknet'
I'm going to actually explain this one: Currently the cost of a 2^20GB server is 57b However when you load your game with v0.58.0 for the first time it should automatically convert everything.
Most players can get that before their first install. In an effort to nerf good players
a softcap was added. This softcap is different for every BN.
** Script Editor ** ** Gang **
* Added a theme that is close to monokai. Unfortunately a full monokai is impossible because * Ascension formula now better
Monaco doesn't have a very good tokenizer. * Karma requirement now much lower in most nodes
* Opening a file and connecting to a new server will still save the file on the server that the file * Territory heavily penalizes gains
was opened. * T.R.P. not available outside BN2.
** Netscript ** ** Netscript **
* New function: alert, which creates a textbox. * It is no longer possible to send anything but strings or numbers to other scripts. (prevents exploits)
* New function: toast, creates a notification in the bottom right. * Improve code for some netscript functions (@omuretsu)
* New function: upgradeHomeCores (@Saynt_Garmo)
* New function: atExit, allows you to set a callback for when the script closes.
* New kindof function: autocomplete, this allows you to tell the game what it should
autocomplete on the terminal.
** Augmentation ** ** Script Editor **
* ENM Core (the Augmentation from The Black Hand with the highest rep cost) rep cost * Added Solarized light/dark as theme (@CalvinTrops)
reduced from 250 to 175. This will help new players transition from TBH to BitRunners more easily. * Fixed sleeve namespace smart autocomplete.
** Bladeburner ** ** Hacknet Servers **
* New general action: Incite Violence. This action adds other action counts but increases chaos. * Cores affect grow/weaken like they do on home computer
** Infiltration **
* Slash game modified to be easier.
** Misc. ** ** Misc. **
* Current bladeburner action is shown on the character overview. * Fix typo in corp (@Saynt_Garmo)
* Fix blackop being #000 on #000. * Fixed a bug where corp wouldn't let you buyback shares. (@Saynt_Garmo)
* The last clicked Tail Box goes in front of the others. * Fixed a bug where sleeves couldn't perform some crimes. (@Saynt_Garmo)
* Fixed an issue where some values were loaded as 0 when they should be null. * Hospitalization and Eating noodles are now toasts (@Saynt_Garmo)
* Implemented toasts. * Fixed some repeated code (@omuretsu)
* .msg are no longer saved in the text file. * Fixed Character Overview preventing clicks underneath it even when hidden. (@omuretsu)
* Tail boxes no longer display all the args, they use "..." after 30 characters. * Fixed typo in tutorial. (@omuretsu)
* Fixed cancelation penalty bonus not being properly applied after the IP <-> hostname switch. * Create Programs and Factions invitation badges now dissapear when you open their respective pages.
* Fixed an exploit where you could send non-strings or numbers to other scripts. * Add killall script in character overview.
* Fixed issue when trying to work for a faction with a work type that doesn't exist while * Fixed bug in corp that made last city production be the production for all cities for newly created product.
already working for that faction. * Fix bug that allowed reputation to transfer to new jobs.
* Fixed not being able to work for the CIA. (Don't ask)
* nerf noodle bar * nerf noodle bar
`, `,
}; };

@ -58,264 +58,266 @@ export const RamCostConstants: IMap<number> = {
export const RamCosts: IMap<any> = { export const RamCosts: IMap<any> = {
hacknet: { hacknet: {
numNodes: () => 0, numNodes: 0,
purchaseNode: () => 0, purchaseNode: 0,
getPurchaseNodeCost: () => 0, getPurchaseNodeCost: 0,
getNodeStats: () => 0, getNodeStats: 0,
upgradeLevel: () => 0, upgradeLevel: 0,
upgradeRam: () => 0, upgradeRam: 0,
upgradeCore: () => 0, upgradeCore: 0,
upgradeCache: () => 0, upgradeCache: 0,
getLevelUpgradeCost: () => 0, getLevelUpgradeCost: 0,
getRamUpgradeCost: () => 0, getRamUpgradeCost: 0,
getCoreUpgradeCost: () => 0, getCoreUpgradeCost: 0,
getCacheUpgradeCost: () => 0, getCacheUpgradeCost: 0,
numHashes: () => 0, numHashes: 0,
hashCost: () => 0, hashCost: 0,
spendHashes: () => 0, spendHashes: 0,
}, },
sprintf: () => 0, sprintf: 0,
vsprintf: () => 0, vsprintf: 0,
scan: () => RamCostConstants.ScriptScanRamCost, scan: RamCostConstants.ScriptScanRamCost,
hack: () => RamCostConstants.ScriptHackRamCost, hack: RamCostConstants.ScriptHackRamCost,
hackAnalyzeThreads: () => RamCostConstants.ScriptHackAnalyzeRamCost, hackAnalyzeThreads: RamCostConstants.ScriptHackAnalyzeRamCost,
hackAnalyzePercent: () => RamCostConstants.ScriptHackAnalyzeRamCost, hackAnalyzePercent: RamCostConstants.ScriptHackAnalyzeRamCost,
hackChance: () => RamCostConstants.ScriptHackAnalyzeRamCost, hackChance: RamCostConstants.ScriptHackAnalyzeRamCost,
sleep: () => 0, sleep: 0,
grow: () => RamCostConstants.ScriptGrowRamCost, grow: RamCostConstants.ScriptGrowRamCost,
growthAnalyze: () => RamCostConstants.ScriptGrowthAnalyzeRamCost, growthAnalyze: RamCostConstants.ScriptGrowthAnalyzeRamCost,
weaken: () => RamCostConstants.ScriptWeakenRamCost, weaken: RamCostConstants.ScriptWeakenRamCost,
print: () => 0, print: 0,
tprint: () => 0, tprint: 0,
clearLog: () => 0, clearLog: 0,
disableLog: () => 0, disableLog: 0,
enableLog: () => 0, enableLog: 0,
isLogEnabled: () => 0, isLogEnabled: 0,
getScriptLogs: () => 0, getScriptLogs: 0,
nuke: () => RamCostConstants.ScriptPortProgramRamCost, nuke: RamCostConstants.ScriptPortProgramRamCost,
brutessh: () => RamCostConstants.ScriptPortProgramRamCost, brutessh: RamCostConstants.ScriptPortProgramRamCost,
ftpcrack: () => RamCostConstants.ScriptPortProgramRamCost, ftpcrack: RamCostConstants.ScriptPortProgramRamCost,
relaysmtp: () => RamCostConstants.ScriptPortProgramRamCost, relaysmtp: RamCostConstants.ScriptPortProgramRamCost,
httpworm: () => RamCostConstants.ScriptPortProgramRamCost, httpworm: RamCostConstants.ScriptPortProgramRamCost,
sqlinject: () => RamCostConstants.ScriptPortProgramRamCost, sqlinject: RamCostConstants.ScriptPortProgramRamCost,
run: () => RamCostConstants.ScriptRunRamCost, run: RamCostConstants.ScriptRunRamCost,
exec: () => RamCostConstants.ScriptExecRamCost, exec: RamCostConstants.ScriptExecRamCost,
spawn: () => RamCostConstants.ScriptSpawnRamCost, spawn: RamCostConstants.ScriptSpawnRamCost,
kill: () => RamCostConstants.ScriptKillRamCost, kill: RamCostConstants.ScriptKillRamCost,
killall: () => RamCostConstants.ScriptKillRamCost, killall: RamCostConstants.ScriptKillRamCost,
exit: () => 0, exit: 0,
scp: () => RamCostConstants.ScriptScpRamCost, scp: RamCostConstants.ScriptScpRamCost,
ls: () => RamCostConstants.ScriptScanRamCost, ls: RamCostConstants.ScriptScanRamCost,
ps: () => RamCostConstants.ScriptScanRamCost, ps: RamCostConstants.ScriptScanRamCost,
hasRootAccess: () => RamCostConstants.ScriptHasRootAccessRamCost, hasRootAccess: RamCostConstants.ScriptHasRootAccessRamCost,
getIp: () => RamCostConstants.ScriptGetHostnameRamCost, getIp: RamCostConstants.ScriptGetHostnameRamCost,
getHostname: () => RamCostConstants.ScriptGetHostnameRamCost, getHostname: RamCostConstants.ScriptGetHostnameRamCost,
getHackingLevel: () => RamCostConstants.ScriptGetHackingLevelRamCost, getHackingLevel: RamCostConstants.ScriptGetHackingLevelRamCost,
getHackingMultipliers: () => RamCostConstants.ScriptGetMultipliersRamCost, getHackingMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,
getHacknetMultipliers: () => RamCostConstants.ScriptGetMultipliersRamCost, getHacknetMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,
getBitNodeMultipliers: () => RamCostConstants.ScriptGetMultipliersRamCost, getBitNodeMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,
getServer: () => RamCostConstants.ScriptGetMultipliersRamCost / 2, getServer: RamCostConstants.ScriptGetMultipliersRamCost / 2,
getServerMoneyAvailable: () => RamCostConstants.ScriptGetServerRamCost, getServerMoneyAvailable: RamCostConstants.ScriptGetServerRamCost,
getServerSecurityLevel: () => RamCostConstants.ScriptGetServerRamCost, getServerSecurityLevel: RamCostConstants.ScriptGetServerRamCost,
getServerBaseSecurityLevel: () => RamCostConstants.ScriptGetServerRamCost, getServerBaseSecurityLevel: RamCostConstants.ScriptGetServerRamCost,
getServerMinSecurityLevel: () => RamCostConstants.ScriptGetServerRamCost, getServerMinSecurityLevel: RamCostConstants.ScriptGetServerRamCost,
getServerRequiredHackingLevel: () => RamCostConstants.ScriptGetServerRamCost, getServerRequiredHackingLevel: RamCostConstants.ScriptGetServerRamCost,
getServerMaxMoney: () => RamCostConstants.ScriptGetServerRamCost, getServerMaxMoney: RamCostConstants.ScriptGetServerRamCost,
getServerGrowth: () => RamCostConstants.ScriptGetServerRamCost, getServerGrowth: RamCostConstants.ScriptGetServerRamCost,
getServerNumPortsRequired: () => RamCostConstants.ScriptGetServerRamCost, getServerNumPortsRequired: RamCostConstants.ScriptGetServerRamCost,
getServerRam: () => RamCostConstants.ScriptGetServerRamCost, getServerRam: RamCostConstants.ScriptGetServerRamCost,
getServerMaxRam: () => RamCostConstants.ScriptGetServerMaxRam, getServerMaxRam: RamCostConstants.ScriptGetServerMaxRam,
getServerUsedRam: () => RamCostConstants.ScriptGetServerUsedRam, getServerUsedRam: RamCostConstants.ScriptGetServerUsedRam,
serverExists: () => RamCostConstants.ScriptGetServerRamCost, serverExists: RamCostConstants.ScriptGetServerRamCost,
fileExists: () => RamCostConstants.ScriptFileExistsRamCost, fileExists: RamCostConstants.ScriptFileExistsRamCost,
isRunning: () => RamCostConstants.ScriptIsRunningRamCost, isRunning: RamCostConstants.ScriptIsRunningRamCost,
getStockSymbols: () => RamCostConstants.ScriptGetStockRamCost, stock: {
getStockPrice: () => RamCostConstants.ScriptGetStockRamCost, getSymbols: RamCostConstants.ScriptGetStockRamCost,
getStockAskPrice: () => RamCostConstants.ScriptGetStockRamCost, getPrice: RamCostConstants.ScriptGetStockRamCost,
getStockBidPrice: () => RamCostConstants.ScriptGetStockRamCost, getAskPrice: RamCostConstants.ScriptGetStockRamCost,
getStockPosition: () => RamCostConstants.ScriptGetStockRamCost, getBidPrice: RamCostConstants.ScriptGetStockRamCost,
getStockMaxShares: () => RamCostConstants.ScriptGetStockRamCost, getPosition: RamCostConstants.ScriptGetStockRamCost,
getStockPurchaseCost: () => RamCostConstants.ScriptGetStockRamCost, getMaxShares: RamCostConstants.ScriptGetStockRamCost,
getStockSaleGain: () => RamCostConstants.ScriptGetStockRamCost, getPurchaseCost: RamCostConstants.ScriptGetStockRamCost,
buyStock: () => RamCostConstants.ScriptBuySellStockRamCost, getSaleGain: RamCostConstants.ScriptGetStockRamCost,
sellStock: () => RamCostConstants.ScriptBuySellStockRamCost, buy: RamCostConstants.ScriptBuySellStockRamCost,
shortStock: () => RamCostConstants.ScriptBuySellStockRamCost, sell: RamCostConstants.ScriptBuySellStockRamCost,
sellShort: () => RamCostConstants.ScriptBuySellStockRamCost, short: RamCostConstants.ScriptBuySellStockRamCost,
placeOrder: () => RamCostConstants.ScriptBuySellStockRamCost, sellShort: RamCostConstants.ScriptBuySellStockRamCost,
cancelOrder: () => RamCostConstants.ScriptBuySellStockRamCost, placeOrder: RamCostConstants.ScriptBuySellStockRamCost,
getOrders: () => RamCostConstants.ScriptBuySellStockRamCost, cancelOrder: RamCostConstants.ScriptBuySellStockRamCost,
getStockVolatility: () => RamCostConstants.ScriptBuySellStockRamCost, getOrders: RamCostConstants.ScriptBuySellStockRamCost,
getStockForecast: () => RamCostConstants.ScriptBuySellStockRamCost, getVolatility: RamCostConstants.ScriptBuySellStockRamCost,
purchase4SMarketData: () => RamCostConstants.ScriptBuySellStockRamCost, getForecast: RamCostConstants.ScriptBuySellStockRamCost,
purchase4SMarketDataTixApi: () => RamCostConstants.ScriptBuySellStockRamCost, purchase4SMarketData: RamCostConstants.ScriptBuySellStockRamCost,
getPurchasedServerLimit: () => RamCostConstants.ScriptGetPurchasedServerLimit, purchase4SMarketDataTixApi: RamCostConstants.ScriptBuySellStockRamCost,
getPurchasedServerMaxRam: () => RamCostConstants.ScriptGetPurchasedServerMaxRam, },
getPurchasedServerCost: () => RamCostConstants.ScriptGetPurchaseServerRamCost, getPurchasedServerLimit: RamCostConstants.ScriptGetPurchasedServerLimit,
purchaseServer: () => RamCostConstants.ScriptPurchaseServerRamCost, getPurchasedServerMaxRam: RamCostConstants.ScriptGetPurchasedServerMaxRam,
deleteServer: () => RamCostConstants.ScriptPurchaseServerRamCost, getPurchasedServerCost: RamCostConstants.ScriptGetPurchaseServerRamCost,
getPurchasedServers: () => RamCostConstants.ScriptPurchaseServerRamCost, purchaseServer: RamCostConstants.ScriptPurchaseServerRamCost,
write: () => RamCostConstants.ScriptReadWriteRamCost, deleteServer: RamCostConstants.ScriptPurchaseServerRamCost,
tryWrite: () => RamCostConstants.ScriptReadWriteRamCost, getPurchasedServers: RamCostConstants.ScriptPurchaseServerRamCost,
read: () => RamCostConstants.ScriptReadWriteRamCost, write: RamCostConstants.ScriptReadWriteRamCost,
peek: () => RamCostConstants.ScriptReadWriteRamCost, tryWrite: RamCostConstants.ScriptReadWriteRamCost,
clear: () => RamCostConstants.ScriptReadWriteRamCost, read: RamCostConstants.ScriptReadWriteRamCost,
getPortHandle: () => RamCostConstants.ScriptReadWriteRamCost * 10, peek: RamCostConstants.ScriptReadWriteRamCost,
rm: () => RamCostConstants.ScriptReadWriteRamCost, clear: RamCostConstants.ScriptReadWriteRamCost,
scriptRunning: () => RamCostConstants.ScriptArbScriptRamCost, getPortHandle: RamCostConstants.ScriptReadWriteRamCost * 10,
scriptKill: () => RamCostConstants.ScriptArbScriptRamCost, rm: RamCostConstants.ScriptReadWriteRamCost,
getScriptName: () => 0, scriptRunning: RamCostConstants.ScriptArbScriptRamCost,
getScriptRam: () => RamCostConstants.ScriptGetScriptRamCost, scriptKill: RamCostConstants.ScriptArbScriptRamCost,
getHackTime: () => RamCostConstants.ScriptGetHackTimeRamCost, getScriptName: 0,
getGrowTime: () => RamCostConstants.ScriptGetHackTimeRamCost, getScriptRam: RamCostConstants.ScriptGetScriptRamCost,
getWeakenTime: () => RamCostConstants.ScriptGetHackTimeRamCost, getHackTime: RamCostConstants.ScriptGetHackTimeRamCost,
getScriptIncome: () => RamCostConstants.ScriptGetScriptRamCost, getGrowTime: RamCostConstants.ScriptGetHackTimeRamCost,
getScriptExpGain: () => RamCostConstants.ScriptGetScriptRamCost, getWeakenTime: RamCostConstants.ScriptGetHackTimeRamCost,
getRunningScript: () => RamCostConstants.ScriptGetRunningScriptRamCost, getScriptIncome: RamCostConstants.ScriptGetScriptRamCost,
nFormat: () => 0, getScriptExpGain: RamCostConstants.ScriptGetScriptRamCost,
getTimeSinceLastAug: () => RamCostConstants.ScriptGetHackTimeRamCost, getRunningScript: RamCostConstants.ScriptGetRunningScriptRamCost,
prompt: () => 0, nFormat: 0,
wget: () => 0, getTimeSinceLastAug: RamCostConstants.ScriptGetHackTimeRamCost,
getFavorToDonate: () => RamCostConstants.ScriptGetFavorToDonate, prompt: 0,
wget: 0,
getFavorToDonate: RamCostConstants.ScriptGetFavorToDonate,
// Singularity Functions // Singularity Functions
universityCourse: () => RamCostConstants.ScriptSingularityFn1RamCost, universityCourse: RamCostConstants.ScriptSingularityFn1RamCost,
gymWorkout: () => RamCostConstants.ScriptSingularityFn1RamCost, gymWorkout: RamCostConstants.ScriptSingularityFn1RamCost,
travelToCity: () => RamCostConstants.ScriptSingularityFn1RamCost, travelToCity: RamCostConstants.ScriptSingularityFn1RamCost,
purchaseTor: () => RamCostConstants.ScriptSingularityFn1RamCost, purchaseTor: RamCostConstants.ScriptSingularityFn1RamCost,
purchaseProgram: () => RamCostConstants.ScriptSingularityFn1RamCost, purchaseProgram: RamCostConstants.ScriptSingularityFn1RamCost,
getCurrentServer: () => RamCostConstants.ScriptSingularityFn1RamCost, getCurrentServer: RamCostConstants.ScriptSingularityFn1RamCost,
connect: () => RamCostConstants.ScriptSingularityFn1RamCost, connect: RamCostConstants.ScriptSingularityFn1RamCost,
manualHack: () => RamCostConstants.ScriptSingularityFn1RamCost, manualHack: RamCostConstants.ScriptSingularityFn1RamCost,
installBackdoor: () => RamCostConstants.ScriptSingularityFn1RamCost, installBackdoor: RamCostConstants.ScriptSingularityFn1RamCost,
getStats: () => RamCostConstants.ScriptSingularityFn1RamCost / 4, getStats: RamCostConstants.ScriptSingularityFn1RamCost / 4,
getCharacterInformation: () => RamCostConstants.ScriptSingularityFn1RamCost / 4, getCharacterInformation: RamCostConstants.ScriptSingularityFn1RamCost / 4,
getPlayer: () => RamCostConstants.ScriptSingularityFn1RamCost / 4, getPlayer: RamCostConstants.ScriptSingularityFn1RamCost / 4,
hospitalize: () => RamCostConstants.ScriptSingularityFn1RamCost / 4, hospitalize: RamCostConstants.ScriptSingularityFn1RamCost / 4,
isBusy: () => RamCostConstants.ScriptSingularityFn1RamCost / 4, isBusy: RamCostConstants.ScriptSingularityFn1RamCost / 4,
stopAction: () => RamCostConstants.ScriptSingularityFn1RamCost / 2, stopAction: RamCostConstants.ScriptSingularityFn1RamCost / 2,
upgradeHomeRam: () => RamCostConstants.ScriptSingularityFn2RamCost, upgradeHomeRam: RamCostConstants.ScriptSingularityFn2RamCost,
getUpgradeHomeRamCost: () => RamCostConstants.ScriptSingularityFn2RamCost / 2, getUpgradeHomeRamCost: RamCostConstants.ScriptSingularityFn2RamCost / 2,
workForCompany: () => RamCostConstants.ScriptSingularityFn2RamCost, workForCompany: RamCostConstants.ScriptSingularityFn2RamCost,
applyToCompany: () => RamCostConstants.ScriptSingularityFn2RamCost, applyToCompany: RamCostConstants.ScriptSingularityFn2RamCost,
getCompanyRep: () => RamCostConstants.ScriptSingularityFn2RamCost / 3, getCompanyRep: RamCostConstants.ScriptSingularityFn2RamCost / 3,
getCompanyFavor: () => RamCostConstants.ScriptSingularityFn2RamCost / 3, getCompanyFavor: RamCostConstants.ScriptSingularityFn2RamCost / 3,
getCompanyFavorGain: () => RamCostConstants.ScriptSingularityFn2RamCost / 4, getCompanyFavorGain: RamCostConstants.ScriptSingularityFn2RamCost / 4,
checkFactionInvitations: () => RamCostConstants.ScriptSingularityFn2RamCost, checkFactionInvitations: RamCostConstants.ScriptSingularityFn2RamCost,
joinFaction: () => RamCostConstants.ScriptSingularityFn2RamCost, joinFaction: RamCostConstants.ScriptSingularityFn2RamCost,
workForFaction: () => RamCostConstants.ScriptSingularityFn2RamCost, workForFaction: RamCostConstants.ScriptSingularityFn2RamCost,
getFactionRep: () => RamCostConstants.ScriptSingularityFn2RamCost / 3, getFactionRep: RamCostConstants.ScriptSingularityFn2RamCost / 3,
getFactionFavor: () => RamCostConstants.ScriptSingularityFn2RamCost / 3, getFactionFavor: RamCostConstants.ScriptSingularityFn2RamCost / 3,
getFactionFavorGain: () => RamCostConstants.ScriptSingularityFn2RamCost / 4, getFactionFavorGain: RamCostConstants.ScriptSingularityFn2RamCost / 4,
donateToFaction: () => RamCostConstants.ScriptSingularityFn3RamCost, donateToFaction: RamCostConstants.ScriptSingularityFn3RamCost,
createProgram: () => RamCostConstants.ScriptSingularityFn3RamCost, createProgram: RamCostConstants.ScriptSingularityFn3RamCost,
commitCrime: () => RamCostConstants.ScriptSingularityFn3RamCost, commitCrime: RamCostConstants.ScriptSingularityFn3RamCost,
getCrimeChance: () => RamCostConstants.ScriptSingularityFn3RamCost, getCrimeChance: RamCostConstants.ScriptSingularityFn3RamCost,
getCrimeStats: () => RamCostConstants.ScriptSingularityFn3RamCost, getCrimeStats: RamCostConstants.ScriptSingularityFn3RamCost,
getOwnedAugmentations: () => RamCostConstants.ScriptSingularityFn3RamCost, getOwnedAugmentations: RamCostConstants.ScriptSingularityFn3RamCost,
getOwnedSourceFiles: () => RamCostConstants.ScriptSingularityFn3RamCost, getOwnedSourceFiles: RamCostConstants.ScriptSingularityFn3RamCost,
getAugmentationsFromFaction: () => RamCostConstants.ScriptSingularityFn3RamCost, getAugmentationsFromFaction: RamCostConstants.ScriptSingularityFn3RamCost,
getAugmentationCost: () => RamCostConstants.ScriptSingularityFn3RamCost, getAugmentationCost: RamCostConstants.ScriptSingularityFn3RamCost,
getAugmentationPrereq: () => RamCostConstants.ScriptSingularityFn3RamCost, getAugmentationPrereq: RamCostConstants.ScriptSingularityFn3RamCost,
getAugmentationPrice: () => RamCostConstants.ScriptSingularityFn3RamCost / 2, getAugmentationPrice: RamCostConstants.ScriptSingularityFn3RamCost / 2,
getAugmentationRepReq: () => RamCostConstants.ScriptSingularityFn3RamCost / 2, getAugmentationRepReq: RamCostConstants.ScriptSingularityFn3RamCost / 2,
getAugmentationStats: () => RamCostConstants.ScriptSingularityFn3RamCost, getAugmentationStats: RamCostConstants.ScriptSingularityFn3RamCost,
purchaseAugmentation: () => RamCostConstants.ScriptSingularityFn3RamCost, purchaseAugmentation: RamCostConstants.ScriptSingularityFn3RamCost,
softReset: () => RamCostConstants.ScriptSingularityFn3RamCost, softReset: RamCostConstants.ScriptSingularityFn3RamCost,
installAugmentations: () => RamCostConstants.ScriptSingularityFn3RamCost, installAugmentations: RamCostConstants.ScriptSingularityFn3RamCost,
// Gang API // Gang API
gang: { gang: {
createGang: () => RamCostConstants.ScriptGangApiBaseRamCost / 4, createGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,
inGang: () => RamCostConstants.ScriptGangApiBaseRamCost / 4, inGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,
getMemberNames: () => RamCostConstants.ScriptGangApiBaseRamCost / 4, getMemberNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,
getGangInformation: () => RamCostConstants.ScriptGangApiBaseRamCost / 2, getGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,
getOtherGangInformation: () => RamCostConstants.ScriptGangApiBaseRamCost / 2, getOtherGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,
getMemberInformation: () => RamCostConstants.ScriptGangApiBaseRamCost / 2, getMemberInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,
canRecruitMember: () => RamCostConstants.ScriptGangApiBaseRamCost / 4, canRecruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 4,
recruitMember: () => RamCostConstants.ScriptGangApiBaseRamCost / 2, recruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 2,
getTaskNames: () => RamCostConstants.ScriptGangApiBaseRamCost / 4, getTaskNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,
getTaskStats: () => RamCostConstants.ScriptGangApiBaseRamCost / 4, getTaskStats: RamCostConstants.ScriptGangApiBaseRamCost / 4,
setMemberTask: () => RamCostConstants.ScriptGangApiBaseRamCost / 2, setMemberTask: RamCostConstants.ScriptGangApiBaseRamCost / 2,
getEquipmentNames: () => RamCostConstants.ScriptGangApiBaseRamCost / 4, getEquipmentNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,
getEquipmentCost: () => RamCostConstants.ScriptGangApiBaseRamCost / 2, getEquipmentCost: RamCostConstants.ScriptGangApiBaseRamCost / 2,
getEquipmentType: () => RamCostConstants.ScriptGangApiBaseRamCost / 2, getEquipmentType: RamCostConstants.ScriptGangApiBaseRamCost / 2,
getEquipmentStats: () => RamCostConstants.ScriptGangApiBaseRamCost / 2, getEquipmentStats: RamCostConstants.ScriptGangApiBaseRamCost / 2,
purchaseEquipment: () => RamCostConstants.ScriptGangApiBaseRamCost, purchaseEquipment: RamCostConstants.ScriptGangApiBaseRamCost,
ascendMember: () => RamCostConstants.ScriptGangApiBaseRamCost, ascendMember: RamCostConstants.ScriptGangApiBaseRamCost,
setTerritoryWarfare: () => RamCostConstants.ScriptGangApiBaseRamCost / 2, setTerritoryWarfare: RamCostConstants.ScriptGangApiBaseRamCost / 2,
getChanceToWinClash: () => RamCostConstants.ScriptGangApiBaseRamCost, getChanceToWinClash: RamCostConstants.ScriptGangApiBaseRamCost,
getBonusTime: () => 0, getBonusTime: 0,
}, },
// Bladeburner API // Bladeburner API
bladeburner: { bladeburner: {
getContractNames: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10, getContractNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
getOperationNames: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10, getOperationNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
getBlackOpNames: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10, getBlackOpNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
getBlackOpRank: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2, getBlackOpRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,
getGeneralActionNames: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10, getGeneralActionNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
getSkillNames: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10, getSkillNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
startAction: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, startAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
stopBladeburnerAction: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2, stopBladeburnerAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,
getCurrentAction: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 4, getCurrentAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 4,
getActionTime: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getActionTime: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getActionEstimatedSuccessChance: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getActionEstimatedSuccessChance: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getActionRepGain: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getActionRepGain: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getActionCountRemaining: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getActionCountRemaining: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getActionMaxLevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getActionMaxLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getActionCurrentLevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getActionCurrentLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getActionAutolevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
setActionAutolevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, setActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
setActionLevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, setActionLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getRank: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getSkillPoints: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getSkillPoints: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getSkillLevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getSkillLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getSkillUpgradeCost: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getSkillUpgradeCost: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
upgradeSkill: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, upgradeSkill: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getTeamSize: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
setTeamSize: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, setTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getCityEstimatedPopulation: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getCityEstimatedPopulation: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getCityEstimatedCommunities: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getCityEstimatedCommunities: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getCityChaos: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getCityChaos: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getCity: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
switchCity: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, switchCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getStamina: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, getStamina: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
joinBladeburnerFaction: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, joinBladeburnerFaction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
joinBladeburnerDivision: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost, joinBladeburnerDivision: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
getBonusTime: () => 0, getBonusTime: 0,
}, },
// Coding Contract API // Coding Contract API
codingcontract: { codingcontract: {
attempt: () => RamCostConstants.ScriptCodingContractBaseRamCost, attempt: RamCostConstants.ScriptCodingContractBaseRamCost,
getContractType: () => RamCostConstants.ScriptCodingContractBaseRamCost / 2, getContractType: RamCostConstants.ScriptCodingContractBaseRamCost / 2,
getData: () => RamCostConstants.ScriptCodingContractBaseRamCost / 2, getData: RamCostConstants.ScriptCodingContractBaseRamCost / 2,
getDescription: () => RamCostConstants.ScriptCodingContractBaseRamCost / 2, getDescription: RamCostConstants.ScriptCodingContractBaseRamCost / 2,
getNumTriesRemaining: () => RamCostConstants.ScriptCodingContractBaseRamCost / 5, getNumTriesRemaining: RamCostConstants.ScriptCodingContractBaseRamCost / 5,
}, },
// Duplicate Sleeve API // Duplicate Sleeve API
sleeve: { sleeve: {
getNumSleeves: () => RamCostConstants.ScriptSleeveBaseRamCost, getNumSleeves: RamCostConstants.ScriptSleeveBaseRamCost,
setToShockRecovery: () => RamCostConstants.ScriptSleeveBaseRamCost, setToShockRecovery: RamCostConstants.ScriptSleeveBaseRamCost,
setToSynchronize: () => RamCostConstants.ScriptSleeveBaseRamCost, setToSynchronize: RamCostConstants.ScriptSleeveBaseRamCost,
setToCommitCrime: () => RamCostConstants.ScriptSleeveBaseRamCost, setToCommitCrime: RamCostConstants.ScriptSleeveBaseRamCost,
setToUniversityCourse: () => RamCostConstants.ScriptSleeveBaseRamCost, setToUniversityCourse: RamCostConstants.ScriptSleeveBaseRamCost,
travel: () => RamCostConstants.ScriptSleeveBaseRamCost, travel: RamCostConstants.ScriptSleeveBaseRamCost,
setToCompanyWork: () => RamCostConstants.ScriptSleeveBaseRamCost, setToCompanyWork: RamCostConstants.ScriptSleeveBaseRamCost,
setToFactionWork: () => RamCostConstants.ScriptSleeveBaseRamCost, setToFactionWork: RamCostConstants.ScriptSleeveBaseRamCost,
setToGymWorkout: () => RamCostConstants.ScriptSleeveBaseRamCost, setToGymWorkout: RamCostConstants.ScriptSleeveBaseRamCost,
getSleeveStats: () => RamCostConstants.ScriptSleeveBaseRamCost, getSleeveStats: RamCostConstants.ScriptSleeveBaseRamCost,
getTask: () => RamCostConstants.ScriptSleeveBaseRamCost, getTask: RamCostConstants.ScriptSleeveBaseRamCost,
getInformation: () => RamCostConstants.ScriptSleeveBaseRamCost, getInformation: RamCostConstants.ScriptSleeveBaseRamCost,
getSleeveAugmentations: () => RamCostConstants.ScriptSleeveBaseRamCost, getSleeveAugmentations: RamCostConstants.ScriptSleeveBaseRamCost,
getSleevePurchasableAugs: () => RamCostConstants.ScriptSleeveBaseRamCost, getSleevePurchasableAugs: RamCostConstants.ScriptSleeveBaseRamCost,
purchaseSleeveAug: () => RamCostConstants.ScriptSleeveBaseRamCost, purchaseSleeveAug: RamCostConstants.ScriptSleeveBaseRamCost,
}, },
heart: { heart: {
// Easter egg function // Easter egg function
break: () => 0, break: 0,
}, },
}; };
@ -340,15 +342,10 @@ export function getRamCost(...args: string[]): number {
curr = curr[args[i]]; curr = curr[args[i]];
} }
const currType = typeof curr; if (typeof curr === "number") {
if (currType === "function") {
return curr();
}
if (currType === "number") {
return curr; return curr;
} }
console.warn(`Unexpected type (${currType}) for value [${args}]`); console.warn(`Unexpected type (${curr}) for value [${args}]`);
return 0; return 0;
} }

@ -89,7 +89,7 @@ import { SnackbarEvents } from "./ui/React/Snackbar";
import { Locations } from "./Locations/Locations"; import { Locations } from "./Locations/Locations";
import { Flags } from "./NetscriptFunctions/Flags"; import { Flags } from "./NetscriptFunctions/Flags";
interface NS extends INetscriptExtra, INetscriptAugmentations, INetscriptStockMarket { interface NS extends INetscriptExtra, INetscriptAugmentations {
[key: string]: any; [key: string]: any;
hacknet: INetscriptHacknet; hacknet: INetscriptHacknet;
gang: INetscriptGang; gang: INetscriptGang;
@ -98,6 +98,7 @@ interface NS extends INetscriptExtra, INetscriptAugmentations, INetscriptStockMa
codingcontract: INetscriptCodingContract; codingcontract: INetscriptCodingContract;
corporation: INetscriptCorporation; corporation: INetscriptCorporation;
formulas: INetscriptFormulas; formulas: INetscriptFormulas;
stock: INetscriptStockMarket;
} }
function NetscriptFunctions(workerScript: WorkerScript): NS { function NetscriptFunctions(workerScript: WorkerScript): NS {
@ -1482,7 +1483,7 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
return getRunningScript(fn, hostname, "isRunning", scriptArgs) != null; return getRunningScript(fn, hostname, "isRunning", scriptArgs) != null;
} }
}, },
...stockmarket, stock: stockmarket,
getPurchasedServerLimit: function (): any { getPurchasedServerLimit: function (): any {
updateDynamicRam("getPurchasedServerLimit", getRamCost("getPurchasedServerLimit")); updateDynamicRam("getPurchasedServerLimit", getRamCost("getPurchasedServerLimit"));

@ -12,23 +12,23 @@ import { getStockMarket4SDataCost, getStockMarket4STixApiCost } from "../StockMa
import { Stock } from "../StockMarket/Stock"; import { Stock } from "../StockMarket/Stock";
export interface INetscriptStockMarket { export interface INetscriptStockMarket {
getStockSymbols(): any; getSymbols(): any;
getStockPrice(symbol: any): any; getPrice(symbol: any): any;
getStockAskPrice(symbol: any): any; getAskPrice(symbol: any): any;
getStockBidPrice(symbol: any): any; getBidPrice(symbol: any): any;
getStockPosition(symbol: any): any; getPosition(symbol: any): any;
getStockMaxShares(symbol: any): any; getMaxShares(symbol: any): any;
getStockPurchaseCost(symbol: any, shares: any, posType: any): any; getPurchaseCost(symbol: any, shares: any, posType: any): any;
getStockSaleGain(symbol: any, shares: any, posType: any): any; getSaleGain(symbol: any, shares: any, posType: any): any;
buyStock(symbol: any, shares: any): any; buy(symbol: any, shares: any): any;
sellStock(symbol: any, shares: any): any; sell(symbol: any, shares: any): any;
shortStock(symbol: any, shares: any): any; short(symbol: any, shares: any): any;
sellShort(symbol: any, shares: any): any; sellShort(symbol: any, shares: any): any;
placeOrder(symbol: any, shares: any, price: any, type: any, pos: any): any; placeOrder(symbol: any, shares: any, price: any, type: any, pos: any): any;
cancelOrder(symbol: any, shares: any, price: any, type: any, pos: any): any; cancelOrder(symbol: any, shares: any, price: any, type: any, pos: any): any;
getOrders(): any; getOrders(): any;
getStockVolatility(symbol: any): any; getVolatility(symbol: any): any;
getStockForecast(symbol: any): any; getForecast(symbol: any): any;
purchase4SMarketData(): void; purchase4SMarketData(): void;
purchase4SMarketDataTixApi(): void; purchase4SMarketDataTixApi(): void;
} }
@ -59,52 +59,52 @@ export function NetscriptStockMarket(
return stock; return stock;
}; };
return { return {
getStockSymbols: function (): any { getSymbols: function (): any {
helper.updateDynamicRam("getStockSymbols", getRamCost("getStockSymbols")); helper.updateDynamicRam("getSymbols", getRamCost("stock", "getSymbols"));
checkTixApiAccess("getStockSymbols"); checkTixApiAccess("getSymbols");
return Object.values(StockSymbols); return Object.values(StockSymbols);
}, },
getStockPrice: function (symbol: any): any { getPrice: function (symbol: any): any {
helper.updateDynamicRam("getStockPrice", getRamCost("getStockPrice")); helper.updateDynamicRam("getPrice", getRamCost("stock", "getPrice"));
checkTixApiAccess("getStockPrice"); checkTixApiAccess("getPrice");
const stock = getStockFromSymbol(symbol, "getStockPrice"); const stock = getStockFromSymbol(symbol, "getPrice");
return stock.price; return stock.price;
}, },
getStockAskPrice: function (symbol: any): any { getAskPrice: function (symbol: any): any {
helper.updateDynamicRam("getStockAskPrice", getRamCost("getStockAskPrice")); helper.updateDynamicRam("getAskPrice", getRamCost("stock", "getAskPrice"));
checkTixApiAccess("getStockAskPrice"); checkTixApiAccess("getAskPrice");
const stock = getStockFromSymbol(symbol, "getStockAskPrice"); const stock = getStockFromSymbol(symbol, "getAskPrice");
return stock.getAskPrice(); return stock.getAskPrice();
}, },
getStockBidPrice: function (symbol: any): any { getBidPrice: function (symbol: any): any {
helper.updateDynamicRam("getStockBidPrice", getRamCost("getStockBidPrice")); helper.updateDynamicRam("getBidPrice", getRamCost("stock", "getBidPrice"));
checkTixApiAccess("getStockBidPrice"); checkTixApiAccess("getBidPrice");
const stock = getStockFromSymbol(symbol, "getStockBidPrice"); const stock = getStockFromSymbol(symbol, "getBidPrice");
return stock.getBidPrice(); return stock.getBidPrice();
}, },
getStockPosition: function (symbol: any): any { getPosition: function (symbol: any): any {
helper.updateDynamicRam("getStockPosition", getRamCost("getStockPosition")); helper.updateDynamicRam("getPosition", getRamCost("stock", "getPosition"));
checkTixApiAccess("getStockPosition"); checkTixApiAccess("getPosition");
const stock = SymbolToStockMap[symbol]; const stock = SymbolToStockMap[symbol];
if (stock == null) { if (stock == null) {
throw helper.makeRuntimeErrorMsg("getStockPosition", `Invalid stock symbol: ${symbol}`); throw helper.makeRuntimeErrorMsg("getPosition", `Invalid stock symbol: ${symbol}`);
} }
return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx]; return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];
}, },
getStockMaxShares: function (symbol: any): any { getMaxShares: function (symbol: any): any {
helper.updateDynamicRam("getStockMaxShares", getRamCost("getStockMaxShares")); helper.updateDynamicRam("getMaxShares", getRamCost("stock", "getMaxShares"));
checkTixApiAccess("getStockMaxShares"); checkTixApiAccess("getMaxShares");
const stock = getStockFromSymbol(symbol, "getStockMaxShares"); const stock = getStockFromSymbol(symbol, "getMaxShares");
return stock.maxShares; return stock.maxShares;
}, },
getStockPurchaseCost: function (symbol: any, shares: any, posType: any): any { getPurchaseCost: function (symbol: any, shares: any, posType: any): any {
helper.updateDynamicRam("getStockPurchaseCost", getRamCost("getStockPurchaseCost")); helper.updateDynamicRam("getPurchaseCost", getRamCost("stock", "getPurchaseCost"));
checkTixApiAccess("getStockPurchaseCost"); checkTixApiAccess("getPurchaseCost");
const stock = getStockFromSymbol(symbol, "getStockPurchaseCost"); const stock = getStockFromSymbol(symbol, "getPurchaseCost");
shares = Math.round(shares); shares = Math.round(shares);
let pos; let pos;
@ -124,10 +124,10 @@ export function NetscriptStockMarket(
return res; return res;
}, },
getStockSaleGain: function (symbol: any, shares: any, posType: any): any { getSaleGain: function (symbol: any, shares: any, posType: any): any {
helper.updateDynamicRam("getStockSaleGain", getRamCost("getStockSaleGain")); helper.updateDynamicRam("getSaleGain", getRamCost("stock", "getSaleGain"));
checkTixApiAccess("getStockSaleGain"); checkTixApiAccess("getSaleGain");
const stock = getStockFromSymbol(symbol, "getStockSaleGain"); const stock = getStockFromSymbol(symbol, "getSaleGain");
shares = Math.round(shares); shares = Math.round(shares);
let pos; let pos;
@ -147,39 +147,39 @@ export function NetscriptStockMarket(
return res; return res;
}, },
buyStock: function (symbol: any, shares: any): any { buy: function (symbol: any, shares: any): any {
helper.updateDynamicRam("buyStock", getRamCost("buyStock")); helper.updateDynamicRam("buy", getRamCost("stock", "buy"));
checkTixApiAccess("buyStock"); checkTixApiAccess("buy");
const stock = getStockFromSymbol(symbol, "buyStock"); const stock = getStockFromSymbol(symbol, "buy");
const res = buyStock(stock, shares, workerScript, {}); const res = buyStock(stock, shares, workerScript, {});
return res ? stock.price : 0; return res ? stock.price : 0;
}, },
sellStock: function (symbol: any, shares: any): any { sell: function (symbol: any, shares: any): any {
helper.updateDynamicRam("sellStock", getRamCost("sellStock")); helper.updateDynamicRam("sell", getRamCost("stock", "sell"));
checkTixApiAccess("sellStock"); checkTixApiAccess("sell");
const stock = getStockFromSymbol(symbol, "sellStock"); const stock = getStockFromSymbol(symbol, "sell");
const res = sellStock(stock, shares, workerScript, {}); const res = sellStock(stock, shares, workerScript, {});
return res ? stock.price : 0; return res ? stock.price : 0;
}, },
shortStock: function (symbol: any, shares: any): any { short: function (symbol: any, shares: any): any {
helper.updateDynamicRam("shortStock", getRamCost("shortStock")); helper.updateDynamicRam("short", getRamCost("stock", "short"));
checkTixApiAccess("shortStock"); checkTixApiAccess("short");
if (player.bitNodeN !== 8) { if (player.bitNodeN !== 8) {
if (player.sourceFileLvl(8) <= 1) { if (player.sourceFileLvl(8) <= 1) {
throw helper.makeRuntimeErrorMsg( throw helper.makeRuntimeErrorMsg(
"shortStock", "short",
"You must either be in BitNode-8 or you must have Source-File 8 Level 2.", "You must either be in BitNode-8 or you must have Source-File 8 Level 2.",
); );
} }
} }
const stock = getStockFromSymbol(symbol, "shortStock"); const stock = getStockFromSymbol(symbol, "short");
const res = shortStock(stock, shares, workerScript, {}); const res = shortStock(stock, shares, workerScript, {});
return res ? stock.price : 0; return res ? stock.price : 0;
}, },
sellShort: function (symbol: any, shares: any): any { sellShort: function (symbol: any, shares: any): any {
helper.updateDynamicRam("sellShort", getRamCost("sellShort")); helper.updateDynamicRam("sellShort", getRamCost("stock", "sellShort"));
checkTixApiAccess("sellShort"); checkTixApiAccess("sellShort");
if (player.bitNodeN !== 8) { if (player.bitNodeN !== 8) {
if (player.sourceFileLvl(8) <= 1) { if (player.sourceFileLvl(8) <= 1) {
@ -195,7 +195,7 @@ export function NetscriptStockMarket(
return res ? stock.price : 0; return res ? stock.price : 0;
}, },
placeOrder: function (symbol: any, shares: any, price: any, type: any, pos: any): any { placeOrder: function (symbol: any, shares: any, price: any, type: any, pos: any): any {
helper.updateDynamicRam("placeOrder", getRamCost("placeOrder")); helper.updateDynamicRam("placeOrder", getRamCost("stock", "placeOrder"));
checkTixApiAccess("placeOrder"); checkTixApiAccess("placeOrder");
if (player.bitNodeN !== 8) { if (player.bitNodeN !== 8) {
if (player.sourceFileLvl(8) <= 2) { if (player.sourceFileLvl(8) <= 2) {
@ -234,7 +234,7 @@ export function NetscriptStockMarket(
return placeOrder(stock, shares, price, orderType, orderPos, workerScript); return placeOrder(stock, shares, price, orderType, orderPos, workerScript);
}, },
cancelOrder: function (symbol: any, shares: any, price: any, type: any, pos: any): any { cancelOrder: function (symbol: any, shares: any, price: any, type: any, pos: any): any {
helper.updateDynamicRam("cancelOrder", getRamCost("cancelOrder")); helper.updateDynamicRam("cancelOrder", getRamCost("stock", "cancelOrder"));
checkTixApiAccess("cancelOrder"); checkTixApiAccess("cancelOrder");
if (player.bitNodeN !== 8) { if (player.bitNodeN !== 8) {
if (player.sourceFileLvl(8) <= 2) { if (player.sourceFileLvl(8) <= 2) {
@ -284,7 +284,7 @@ export function NetscriptStockMarket(
return cancelOrder(params, workerScript); return cancelOrder(params, workerScript);
}, },
getOrders: function (): any { getOrders: function (): any {
helper.updateDynamicRam("getOrders", getRamCost("getOrders")); helper.updateDynamicRam("getOrders", getRamCost("stock", "getOrders"));
checkTixApiAccess("getOrders"); checkTixApiAccess("getOrders");
if (player.bitNodeN !== 8) { if (player.bitNodeN !== 8) {
if (player.sourceFileLvl(8) <= 2) { if (player.sourceFileLvl(8) <= 2) {
@ -315,28 +315,28 @@ export function NetscriptStockMarket(
return orders; return orders;
}, },
getStockVolatility: function (symbol: any): any { getVolatility: function (symbol: any): any {
helper.updateDynamicRam("getStockVolatility", getRamCost("getStockVolatility")); helper.updateDynamicRam("getVolatility", getRamCost("stock", "getVolatility"));
if (!player.has4SDataTixApi) { if (!player.has4SDataTixApi) {
throw helper.makeRuntimeErrorMsg("getStockVolatility", "You don't have 4S Market Data TIX API Access!"); throw helper.makeRuntimeErrorMsg("getVolatility", "You don't have 4S Market Data TIX API Access!");
} }
const stock = getStockFromSymbol(symbol, "getStockVolatility"); const stock = getStockFromSymbol(symbol, "getVolatility");
return stock.mv / 100; // Convert from percentage to decimal return stock.mv / 100; // Convert from percentage to decimal
}, },
getStockForecast: function (symbol: any): any { getForecast: function (symbol: any): any {
helper.updateDynamicRam("getStockForecast", getRamCost("getStockForecast")); helper.updateDynamicRam("getForecast", getRamCost("stock", "getForecast"));
if (!player.has4SDataTixApi) { if (!player.has4SDataTixApi) {
throw helper.makeRuntimeErrorMsg("getStockForecast", "You don't have 4S Market Data TIX API Access!"); throw helper.makeRuntimeErrorMsg("getForecast", "You don't have 4S Market Data TIX API Access!");
} }
const stock = getStockFromSymbol(symbol, "getStockForecast"); const stock = getStockFromSymbol(symbol, "getForecast");
let forecast = 50; let forecast = 50;
stock.b ? (forecast += stock.otlkMag) : (forecast -= stock.otlkMag); stock.b ? (forecast += stock.otlkMag) : (forecast -= stock.otlkMag);
return forecast / 100; // Convert from percentage to decimal return forecast / 100; // Convert from percentage to decimal
}, },
purchase4SMarketData: function () { purchase4SMarketData: function () {
helper.updateDynamicRam("purchase4SMarketData", getRamCost("purchase4SMarketData")); helper.updateDynamicRam("purchase4SMarketData", getRamCost("stock", "purchase4SMarketData"));
checkTixApiAccess("purchase4SMarketData"); checkTixApiAccess("purchase4SMarketData");
if (player.has4SData) { if (player.has4SData) {
@ -355,7 +355,7 @@ export function NetscriptStockMarket(
return true; return true;
}, },
purchase4SMarketDataTixApi: function () { purchase4SMarketDataTixApi: function () {
helper.updateDynamicRam("purchase4SMarketDataTixApi", getRamCost("purchase4SMarketDataTixApi")); helper.updateDynamicRam("purchase4SMarketDataTixApi", getRamCost("stock", "purchase4SMarketDataTixApi"));
checkTixApiAccess("purchase4SMarketDataTixApi"); checkTixApiAccess("purchase4SMarketDataTixApi");
if (player.has4SDataTixApi) { if (player.has4SDataTixApi) {

@ -5,7 +5,7 @@ import { Factions, loadFactions } from "./Faction/Factions";
import { loadAllGangs, AllGangs } from "./Gang/AllGangs"; import { loadAllGangs, AllGangs } from "./Gang/AllGangs";
import { loadMessages, initMessages, Messages } from "./Message/MessageHelpers"; import { loadMessages, initMessages, Messages } from "./Message/MessageHelpers";
import { Player, loadPlayer } from "./Player"; import { Player, loadPlayer } from "./Player";
import { saveAllServers, loadAllServers } from "./Server/AllServers"; import { saveAllServers, loadAllServers, GetAllServers } from "./Server/AllServers";
import { Settings } from "./Settings/Settings"; import { Settings } from "./Settings/Settings";
import { SourceFileFlags } from "./SourceFile/SourceFileFlags"; import { SourceFileFlags } from "./SourceFile/SourceFileFlags";
import { loadStockMarket, StockMarket } from "./StockMarket/StockMarket"; import { loadStockMarket, StockMarket } from "./StockMarket/StockMarket";
@ -172,6 +172,40 @@ function evaluateVersionCompatibility(ver: string): void {
} }
} }
} }
if (ver < "0.58.0") {
const changes: [RegExp, string][] = [
[/getStockSymbols/g, "stock.getSymbols"],
[/getStockPrice/g, "stock.getPrice"],
[/getStockAskPrice/g, "stock.getAskPrice"],
[/getStockBidPrice/g, "stock.getBidPrice"],
[/getStockPosition/g, "stock.getPosition"],
[/getStockMaxShares/g, "stock.getMaxShares"],
[/getStockPurchaseCost/g, "stock.getPurchaseCost"],
[/getStockSaleGain/g, "stock.getSaleGain"],
[/buyStock/g, "stock.buy"],
[/sellStock/g, "stock.sell"],
[/shortStock/g, "stock.short"],
[/sellShort/g, "stock.sellShort"],
[/placeOrder/g, "stock.placeOrder"],
[/cancelOrder/g, "stock.cancelOrder"],
[/getOrders/g, "stock.getOrders"],
[/getStockVolatility/g, "stock.getVolatility"],
[/getStockForecast/g, "stock.getForecast"],
[/purchase4SMarketData/g, "stock.purchase4SMarketData"],
[/purchase4SMarketDataTixApi/g, "stock.purchase4SMarketDataTixApi"],
];
function convert(code: string): string {
for (const change of changes) {
code = code.replace(change[0], change[1]);
}
return code;
}
for (const server of GetAllServers()) {
for (const script of server.scripts) {
script.code = convert(script.code);
}
}
}
} }
function loadGame(saveString: string): boolean { function loadGame(saveString: string): boolean {

@ -1096,7 +1096,7 @@ interface TIX {
* @ramCost 2 GB * @ramCost 2 GB
* @returns {string[]} Array of the symbols of the tradable stocks. * @returns {string[]} Array of the symbols of the tradable stocks.
*/ */
getStockSymbols (): StockSymbol[]; getSymbols (): StockSymbol[];
/** /**
* Returns the price of a stock, given its symbol (NOT the company name). * Returns the price of a stock, given its symbol (NOT the company name).
@ -1106,13 +1106,13 @@ interface TIX {
* *
* @example * @example
* \`\`\`js * \`\`\`js
* getStockPrice("FISG"); * getPrice("FISG");
* \`\`\` * \`\`\`
* @ramCost 2 GB * @ramCost 2 GB
* @param {string} sym Stock symbol. * @param {string} sym Stock symbol.
* @returns {number} The price of a stock. * @returns {number} The price of a stock.
*/ */
getStockPrice (sym: StockSymbol): number; getPrice (sym: StockSymbol): number;
/** /**
* Given a stocks symbol (NOT the company name), returns the ask price of that stock. * Given a stocks symbol (NOT the company name), returns the ask price of that stock.
@ -1122,7 +1122,7 @@ interface TIX {
* @param {string} sym Stock symbol. * @param {string} sym Stock symbol.
* @returns {number} The ask price of a stock. * @returns {number} The ask price of a stock.
*/ */
getStockAskPrice (sym: StockSymbol): number; getAskPrice (sym: StockSymbol): number;
/** /**
* Given a stocks symbol (NOT the company name), returns the bid price of that stock. * Given a stocks symbol (NOT the company name), returns the bid price of that stock.
@ -1132,7 +1132,7 @@ interface TIX {
* @param {string} sym Stock symbol. * @param {string} sym Stock symbol.
* @returns {number} The bid price of a stock. * @returns {number} The bid price of a stock.
*/ */
getStockBidPrice (sym: StockSymbol): number; getBidPrice (sym: StockSymbol): number;
/** /**
* Returns an array of four elements that represents the players position in a stock. * Returns an array of four elements that represents the players position in a stock.
@ -1149,7 +1149,7 @@ interface TIX {
* *
* @example * @example
* \`\`\`js * \`\`\`js
* pos = getStockPosition("ECP"); * pos = getPosition("ECP");
* shares = pos[0]; * shares = pos[0];
* avgPx = pos[1]; * avgPx = pos[1];
* sharesShort = pos[2]; * sharesShort = pos[2];
@ -1159,7 +1159,7 @@ interface TIX {
* @param {string} sym Stock symbol. * @param {string} sym Stock symbol.
* @returns {[number,number,number,number]} Array of four elements that represents the players position in a stock. * @returns {[number,number,number,number]} Array of four elements that represents the players position in a stock.
*/ */
getStockPosition (sym: StockSymbol): [number, number, number, number]; getPosition (sym: StockSymbol): [number, number, number, number];
/** /**
* Returns the maximum number of shares that the stock has. * Returns the maximum number of shares that the stock has.
@ -1170,7 +1170,7 @@ interface TIX {
* @param {string} sym Stock symbol. * @param {string} sym Stock symbol.
* @returns {number} Maximum number of shares that the stock has. * @returns {number} Maximum number of shares that the stock has.
*/ */
getStockMaxShares (sym: StockSymbol): number; getMaxShares (sym: StockSymbol): number;
/** /**
* Calculates and returns how much it would cost to buy a given number of shares of a stock. * Calculates and returns how much it would cost to buy a given number of shares of a stock.
@ -1182,7 +1182,7 @@ interface TIX {
* @param {string} posType Specifies whether the order is a Long or Short position. * @param {string} posType Specifies whether the order is a Long or Short position.
* @returns {number} Cost to buy a given number of shares of a stock. * @returns {number} Cost to buy a given number of shares of a stock.
*/ */
getStockPurchaseCost (sym: StockSymbol, shares: Number, posType: OrderPos): number; getPurchaseCost (sym: StockSymbol, shares: Number, posType: OrderPos): number;
/** /**
* Calculates and returns how much you would gain from selling a given number of shares of a stock. * Calculates and returns how much you would gain from selling a given number of shares of a stock.
@ -1194,7 +1194,7 @@ interface TIX {
* @param {string} posType Specifies whether the order is a Long or Short position. * @param {string} posType Specifies whether the order is a Long or Short position.
* @returns {number} Gain from selling a given number of shares of a stock. * @returns {number} Gain from selling a given number of shares of a stock.
*/ */
getStockSaleGain (sym: StockSymbol, shares: Number, posType: OrderPos): number; getSaleGain (sym: StockSymbol, shares: Number, posType: OrderPos): number;
/** /**
@ -1212,7 +1212,7 @@ interface TIX {
* @param {number} shares Number of shares to purchased. Must be positive. Will be rounded to nearest integer. * @param {number} shares Number of shares to purchased. Must be positive. Will be rounded to nearest integer.
* @returns {number} The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased. * @returns {number} The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.
*/ */
buyStock (sym: StockSymbol, shares: number): number; buy (sym: StockSymbol, shares: number): number;
/** /**
* Attempts to sell shares of a stock using a Market Order. * Attempts to sell shares of a stock using a Market Order.
@ -1234,7 +1234,7 @@ interface TIX {
* @param {number} shares Number of shares to sell. Must be positive. Will be rounded to nearest integer. * @param {number} shares Number of shares to sell. Must be positive. Will be rounded to nearest integer.
* @returns {number} The stock price at which each share was sold, otherwise 0 if the shares weren't sold. * @returns {number} The stock price at which each share was sold, otherwise 0 if the shares weren't sold.
*/ */
sellStock (sym: StockSymbol, shares: number): number; sell (sym: StockSymbol, shares: number): number;
/** /**
* Attempts to purchase a short position of a stock using a Market Order. * Attempts to purchase a short position of a stock using a Market Order.
@ -1254,7 +1254,7 @@ interface TIX {
* @param {number} shares Number of shares to short. Must be positive. Will be rounded to nearest integer. * @param {number} shares Number of shares to short. Must be positive. Will be rounded to nearest integer.
* @returns {number} The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased. * @returns {number} The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.
*/ */
shortStock (sym: StockSymbol, shares: number): number; short (sym: StockSymbol, shares: number): number;
/** /**
* Attempts to sell a short position of a stock using a Market Order. * Attempts to sell a short position of a stock using a Market Order.
@ -1400,7 +1400,7 @@ interface TIX {
* @param {string} sym Stock symbol. * @param {string} sym Stock symbol.
* @returns {number} Volatility of the specified stock. * @returns {number} Volatility of the specified stock.
*/ */
getStockVolatility (sym: StockSymbol): number; getVolatility (sym: StockSymbol): number;
/** /**
* Returns the probability that the specified stocks price will increase (as opposed to decrease) during the next tick. * Returns the probability that the specified stocks price will increase (as opposed to decrease) during the next tick.
@ -1417,7 +1417,7 @@ interface TIX {
* @param {string} sym Stock symbol. * @param {string} sym Stock symbol.
* @returns {number} Probability that the specified stocks price will increase (as opposed to decrease) during the next tick. * @returns {number} Probability that the specified stocks price will increase (as opposed to decrease) during the next tick.
*/ */
getStockForecast (sym: StockSymbol): number; getForecast (sym: StockSymbol): number;
/** /**
* Purchase 4S Market Data Access. * Purchase 4S Market Data Access.
@ -3187,7 +3187,7 @@ interface Sleeve {
purchaseSleeveAug (sleeveNumber: number, augName: AugmentName): boolean; purchaseSleeveAug (sleeveNumber: number, augName: AugmentName): boolean;
} }
interface NS extends TIX, Singularity { interface NS extends Singularity {
/** /**
* Not all functions in the Hacknet Node API are immediately available. * Not all functions in the Hacknet Node API are immediately available.
@ -3215,6 +3215,10 @@ interface NS extends TIX, Singularity {
* @ramCost 0 GB * @ramCost 0 GB
*/ */
readonly sleeve: Sleeve; readonly sleeve: Sleeve;
/**
* @ramCost 0 GB
*/
readonly stock: TIX;
/** /**
* Arguments passed into a script can be accessed using a normal * Arguments passed into a script can be accessed using a normal

@ -53,7 +53,7 @@ export function SetupTextEditor(): void {
} }
symbols = populate(ns); symbols = populate(ns);
const exclude = ["heart", "break", "exploit", "bypass", "corporation"]; const exclude = ["heart", "break", "exploit", "bypass", "corporation", "alterReality"];
symbols = symbols.filter((symbol: string) => !exclude.includes(symbol)).sort(); symbols = symbols.filter((symbol: string) => !exclude.includes(symbol)).sort();
} }