Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autopilot.js: mainloop stocksvalue not set to getStocksValue #229

Closed
otto-kirchheim opened this issue Sep 3, 2022 · 4 comments
Closed
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@otto-kirchheim
Copy link

autopilot.js - mainloop
row 155: try { stocksValue = await getStocksValue(ns); } catch { /* Assume if this fails (insufficient ram) we also have no stocks */ }

@alainbryden
Copy link
Owner

Code looks fine to me. What's the problem?

@alainbryden alainbryden added the question Further information is requested label Sep 3, 2022
@otto-kirchheim
Copy link
Author

"stocksValue" is set to 0 and after "getStocksValue", is still 0.
but the value is required for "manageReservedMoney" and "checkOnDaedalusStatus".

Incidentally, "checkOnDaedalusStatus" is only called once at startup, regardless of whether Daedalus is available or not

@davidakachaos
Copy link

The code Otto shared the code that should be there in autopilot.js, but at a quick glance the code there is:

let stocksValue = 0;
try { await getStocksValue(ns); } catch { /* Assume if this fails (insufficient ram) we also have no stocks */ }

So the value never gets set currently.

@alainbryden
Copy link
Owner

Ooh jeeze. Okay, thanks for translating!

@alainbryden alainbryden added the bug Something isn't working label Jan 5, 2023
@alainbryden alainbryden self-assigned this Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants