Skip to content

Commit

Permalink
Fix #405 stockmaster.js: not purchasing stock market API access
Browse files Browse the repository at this point in the history
  • Loading branch information
alainbryden committed Oct 25, 2024
1 parent ca636b7 commit f5174da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stockmaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ export async function main(ns) {
return log(ns, "ERROR: You do not have stock market API access, and --disable-purchase-tix-api is set.", true);
let success = false;
log(ns, `INFO: You are missing stock market API access. (NOTE: This is granted for free once you have SF8). ` +
`Waiting until we can have the 5b needed to buy it. (Run with --disable-purchase-tix-api to disable this feature.)`, true);
`Waiting until we have the 5b needed to buy it. (Run with --disable-purchase-tix-api to disable this feature.)`, true);
do {
await ns.sleep(sleepInterval);
try {
const reserve = options['reserve'] != null ? options['reserve'] : Number(ns.read("reserve.txt") || 0);
player = await getPlayerInfo(ns);
success = await tryGetStockMarketAccess(ns, player.money - reserve);
} catch (err) {
log(ns, `WARNING: stockmaster.js Caught (and suppressed) an unexpected error while waiting to buy stock market access:\n` +
Expand Down

0 comments on commit f5174da

Please sign in to comment.