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

Auto battle (for real this time I hope) #117

Merged
merged 22 commits into from
Dec 16, 2023

Conversation

Mowlawner
Copy link
Contributor

Updated auto-battle code to work with new backend and design philosophy. Also introduced menu navigation functions (hopefully they help with more stuff!)

…fit in with main loop more easily

updated moves to learnedmoves in certain spots to make sure accessors were called properly
updated config to allow for battle config options
added menu wrapper to prepare for pickup handling and lead rotation handling
fixed a rogue PressButton to fit into the proper conventions of press_button
- updated some navigators to properly exit
- fixed faint handling I think
- formatting
- added handling for null moves
- added battler rotation method
- added cheat option for pickup farming
- incorporated pickup/rotate into main loop
- added wait to `confirm_desired_option` to ensure it works right (still only takes 5 frames vroom vroom)
- added some subnavigation to party menu navigator class
- implemented item checking properly
- updated readme to include battle config options and added pickup to cheats dropdown
- introduced a pause to allow a graceful return from move learning
- added an argument (party length) to get_party_menu_cursor_pos to reduce calls to get_party and stop breakage :(
-  removed unused code
- updated some messaging to be clearer/more explicit (not in the fun way)
- more handling for null moves
- set default values for battle config according to cakes
- added gamestate for evolution
- added additional help for battlepartymenunavigator to differentiate between switching order and switching out
- skipped checking for pickup if no pickup mons are in party
- more formatting
- updated conditional to work with the code the damn way I wrote it
modules/main.py Outdated
from modules.config import config, load_config_from_directory
from modules.console import console
from modules.context import context
from modules.memory import get_game_state, GameState
from modules.menuing import MenuWrapper, CheckForPickup, should_check_for_pickup
from modules.pokemon import opponent_changed, get_opponent
from modules.temp import temp_run_from_battle
Copy link

@nunorbrito18 nunorbrito18 Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to have the temp_run_from_battle import, right?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm testing on emerald. So far so good 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey thanks for catching this! I've gone ahead and removed that import because you are correct- temp_run_from_battle no longer gets called in this file. Thanks for pointing this out!

@nunorbrito18
Copy link

Screenshot_9

Did you had this issue? it says it can't find the option TAKE_ITEM. but the Pokemon have an item

@Mowlawner
Copy link
Contributor Author

@nunorbrito18 I didn't get this issue, but I'd like to try to reproduce it. Is this Ruby, Sapphire, or Emerald, and can you post the savestate that this is from? I suspect it's an issue with handling field moves properly, but I'm not too sure yet.

@nunorbrito18
Copy link

nunorbrito18 commented Nov 8, 2023

N.zip
This zip contains all the savestates, if you start the bot in the spin mode it will give that message.
emerald
Didn't had time to look at it.

@Mowlawner
Copy link
Contributor Author

Thanks! I'll get to debugging this as soon as I can!

@nunorbrito18
Copy link

nunorbrito18 commented Nov 9, 2023

The bag is full. That is why is giving this message.
For me its fine this PR and we can open an issue to improve that or if you prefer you can update the message to 'the bag is full' in this case.
I only had time now to check the issue.

@Mowlawner
Copy link
Contributor Author

@nunorbrito18 sorry for taking so long to respond, thanks for the update. since it's due to the bag being full i think we're going to try and have it just avoid taking any items that there isn't space in the bag for, and when the bag doesn't have space for any items just stop doing pickup farming. thanks for letting me know about this!

@40Cakes 40Cakes mentioned this pull request Dec 2, 2023
@40Cakes
Copy link
Owner

40Cakes commented Dec 15, 2023

@40Cakes 40Cakes merged commit b4bac6e into 40Cakes:main Dec 16, 2023
1 check passed
@40Cakes 40Cakes mentioned this pull request Dec 17, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants