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 / casino.js: Avoid going into debt and getting stuck at the casino with no money #436

Open
alainbryden opened this issue Nov 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@alainbryden
Copy link
Owner

Two issues to look at here:

  1. One morning I woke up to a message that casino.js failed to run because we are out of money. This happened because we were studying while heading to the casino. I could have sworn I had code which stopped any player actions before heading to the casino, but I might have missed something. so we should double check.

image

  1. If casino.js runs into this scenario (or any error scenario after having killed all scripts) and cannot proceed, it should be running the "on completion" scripts to restart autopilot.js so we can recover from debt and try again later.
@alainbryden alainbryden added bug Something isn't working enhancement New feature or request labels Nov 8, 2024
@alainbryden alainbryden self-assigned this Nov 8, 2024
@alainbryden alainbryden changed the title autopilot.js: Deal with massive debt autopilot.js / casino.js: Avoid going into debt and getting stuck at the casino with no money Nov 8, 2024
@alainbryden
Copy link
Owner Author

Simple problem caused by an unfortunate sequence of events:

  • autopilot.js launches daemon.js
  • autopilot.js launches casino.js once it has 250K
  • daemon.js starts studying for hack exp
  • casino.js kills all other scripts to avoid being interrupted (autopilot, daemon,...)
  • player is still studying, money goes below 200K
  • casino.js cant travel anymore and fails
  • no more scripts are running, player is still studying

alainbryden added a commit that referenced this issue Nov 24, 2024
- I believe the current source of this bug is a race condition with daemon.js choosing to study just after autopilot runs stopAction. Hopefully killing it prevents this situation.
- Also increased the buffer slightly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant