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.
The repel listener had an issue where it would close the notification message about repel expiring, but then yield control back to the bot mode for one extra frame before attempting to re-apply another repel.
If that happened in or right next to tall grass, that would mean that the player moved inside the grass and might lead to an unexpected encounter.
The bot would then hang because it would keep spamming Start to open the menu.
Changes
Rather than having to modify the context.controller_stack list, the on_repel_effect_ended() callback of a bot mode can just yield further actions, just like the run() method does. This avoids the 1-frame gap, but also allows using that callback in a more intuitive way as it behaves like the rest of the bot.
Checklist
[x] Black Linter has been ran, using --line-length 120 argument
Description
The repel listener had an issue where it would close the notification message about repel expiring, but then yield control back to the bot mode for one extra frame before attempting to re-apply another repel.
If that happened in or right next to tall grass, that would mean that the player moved inside the grass and might lead to an unexpected encounter.
The bot would then hang because it would keep spamming
Start
to open the menu.Changes
Rather than having to modify the
context.controller_stack
list, theon_repel_effect_ended()
callback of a bot mode can just yield further actions, just like therun()
method does. This avoids the 1-frame gap, but also allows using that callback in a more intuitive way as it behaves like the rest of the bot.Checklist
--line-length 120
argument