chrisrabe / bitburner-automation

Automation scripts I use for my Bitburner gameplay videos.
125 stars 40 forks source link

fix crash when can not purchase server #2

Closed RickyGenz closed 2 years ago

RickyGenz commented 2 years ago

I was having the same issue as Simon Garza and bdavi485 on Automatically purchase and upgrade servers - Bitburner #2. I believe the issue is due to the autoUpgradeServers function not considering what to do when the player is unable to purchase a new server. This can be tested by hard setting canPurchaseServer to return false. I believe I have addressed the issue by waiting 10 seconds when unable to purchase (following the same pattern as upgradeServer). This same issue arises in a later episode with aps-lite.js.