Skip to content

Conversation

@samohtGTO
Copy link

A fix to that we cant liquedate stock when whe have no tix api so autopilot wont ascend.

@samohtGTO
Copy link
Author

we might want to tweak some values that will allow it thru but i dont know what is usefull to when to let it thru or not.

@samohtGTO samohtGTO changed the title Samohtgto/issue311 implemention of #311 tix api liquidation error fix Jul 1, 2023
const hasTixApiAccess = await getNsDataThroughFile(ns, 'ns.stock.hasTIXAPIAccess()');
if(!hasTixApiAccess) {
return false; //We cant liquidate
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be a bit aggressive - for example if we don't have TIXAPIAccess, but the user also just doesn't have any stocks, then we should be able to ascend normally because there's no fear of leaving stocks unsold / money unspent.

I think there's a separate API method that checks if we even have access to the stock market, so this could instead be something like:

if( hasStockMarketAccess && !hasTixApiAccess )
        setStatus(ns, `You have access to the stock market, but not the stock API! We will not ascend automatically, just in case you have some stock to sell...`);
        return false;

Also, the indentation is off here

@alainbryden alainbryden added bug Something isn't working work-in-progress not ready for merge labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working work-in-progress not ready for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants