PokéBot Gen3 is a shiny hunting bot, written in Python that runs libmgba + mGBA Python bindings under the hood. Pokémon Ruby, Sapphire, Emerald, FireRed and LeafGreen are supported.
When doing multiple HTTP API calls to the /items endpoint in particular, there was a good chance for the HTTP thread to hang in an infinite loop.
The reason for this was that the HTTP API would issue an update instruction to the main thread and then wait for the data's age_in_seconds to update -- but this would only change if the underlying value (i.e. the item bag/PC storage) changed.
Instead, we now check age_in_frames which updates every time the value is checked even if it didn't change.
Fixes #325
Checklist
[x] Black Linter has been ran, using --line-length 120 argument
Description
When doing multiple HTTP API calls to the
/items
endpoint in particular, there was a good chance for the HTTP thread to hang in an infinite loop.The reason for this was that the HTTP API would issue an update instruction to the main thread and then wait for the data's
age_in_seconds
to update -- but this would only change if the underlying value (i.e. the item bag/PC storage) changed.Instead, we now check
age_in_frames
which updates every time the value is checked even if it didn't change.Fixes #325
Checklist
--line-length 120
argument