From 4cf270138d2c1b73a0333abf8b43d46a250d814c Mon Sep 17 00:00:00 2001 From: Duck McSouls Date: Sat, 1 Oct 2022 10:07:20 +1000 Subject: [PATCH] DOC: `stock.getPrice()`: typo fix in examples Fixes #4184. The hard-coded stock symbol `"FISG"` should be `"FSIG"`. The updated examples do not use a hard-coded stock symbol. The documentation is updated to explain under which circumstances a player can run the function `stock.getPrice()`. --- src/ScriptEditor/NetscriptDefinitions.d.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index ff935814c..4a502871a 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -1094,17 +1094,26 @@ export interface TIX { * @remarks * RAM cost: 2 GB * - * The stock’s price is the average of its bid and ask prices. + * The stock’s price is the average of its bid and ask prices. This function requires + * that you have the following: + * + * 1. WSE Account + * + * 1. TIX API Access * * @example * ```ts * // NS1 - * stock.getPrice("FISG"); + * var sym = stock.getSymbols()[0]; + * tprint("Stock symbol: " + sym); + * tprint("Stock price: " + stock.getPrice(sym)); * ``` * @example * ```ts * // NS2 - * ns.stock.getPrice("FISG"); + * const sym = ns.stock.getSymbols()[0]; + * ns.tprint("Stock symbol: " + sym); + * ns.tprint("Stock price: " + ns.stock.getPrice(sym)); * ``` * @param sym - Stock symbol. * @returns The price of a stock.