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
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2dae66f
ported over old code mostly
Mowlawner Nov 4, 2023
43864fb
added battle handler as a wrapper for battle opponent to allow it to …
Mowlawner Nov 4, 2023
95166ed
- removed old encounter class from old code, whoops-a-doodle
Mowlawner Nov 4, 2023
7206162
removed outdated rotate method
Mowlawner Nov 4, 2023
84b34e2
- updated navigator for move learning to work properly
Mowlawner Nov 4, 2023
1c75954
Merge remote-tracking branch 'origin/main' into auto-battle-refactor-…
Mowlawner Nov 4, 2023
cba986c
- fixed bug where bot would crash on learning a new move if `new_move…
Mowlawner Nov 5, 2023
b049b30
- disabled auto-battle by default
Mowlawner Nov 5, 2023
793bebe
- removed temp_run_from_battle import since it's no longer used
Mowlawner Nov 7, 2023
c48f513
Merge branch 'main' into auto-battle-refactor-again
40Cakes Dec 3, 2023
837268b
Merge branch 'main' into auto-battle-refactor-again
40Cakes Dec 10, 2023
0099622
Fix auto-battle-refactor-again to work with latest main base
40Cakes Dec 10, 2023
7e9b1c1
Merge branch 'main' into auto-battle-refactor-again
40Cakes Dec 10, 2023
3b2a25d
Formatting
40Cakes Dec 10, 2023
c60c9d0
Check for full item bag and add a warning when doing pickup farming
hanzi Dec 12, 2023
6dd8f51
Merge branch 'main' into auto-battle-refactor-again
hanzi Dec 13, 2023
21c602e
Merge branch 'main' into auto-battle-refactor-again
40Cakes Dec 14, 2023
36ef18d
Merge branch 'main' into auto-battle-refactor-again
40Cakes Dec 15, 2023
efdd931
Add auto-battling wiki page
40Cakes Dec 15, 2023
dce1a0f
Update default
40Cakes Dec 15, 2023
0acf918
Change pickup cheat name
40Cakes Dec 16, 2023
1fcc354
Fix formatting
40Cakes Dec 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,43 @@ If space is available in the PC, and the Pokémon was successfully imported, the

</details>

## `battle.yml` - Battle settings and config
<details>
<summary>Click to expand</summary>

### Battle
`battle` - Set this to true to have the bot automatically battle Pokémon that don't meet catch criteria, if possible. If set to false, the bot will instead run away from encounters that don't meet catch criteria.

`batle_method` - Placeholder for future functionality for a more intelligent battle engine.

`pickup` - Set this to true to enable pickup farming. With pickup farming on, the bot will attempt to take advantage of the mechanics of the ability Pickup by taking items from pokemon who have picked up items.

`pickup_threshold` - This is the number of pickup pokemon in the party that should have an item before the bot tries to take items from them. If you have fewer pokemon with Pickup in your party than this number, the bot will use that number instead. I.e. if this is set to 3, but you only have 1 zigzagoon with pickup in your party, it'll use the number 1 instead.

`pickup_check_frequency` - This is how many encounters to get before checking for pickup items.
- If `pickup` is enabled in `cheats.yml`, this is ignored.
- Otherwise, the bot will open the party menu to look at the party icons for items every X encounters, as denoted by this value.

`faint_action` - This represents what the bot should do if the lead pokemon faints.
- If set to `stop`, the bot will go into manual mode.
- If set to `flee`, the bot will attempt to run from the encounter.
- If set to `rotate`, the bot will send out the next pokemon in the party that has at least 20% of its health and at least 1 usable move.

`new_move` - This represents what the bot should do if a pokemon attempts to learn a new move.
- If set to `stop`, the bot will go into manual mode.
- If set to `cancel`, the bot will stop the pokemon from learning a new move.
- If set to `learn_best`, the bot will calculate the weakest move from the pokemon's current movepool and, provided the new move is better, replace that move with the new move. If the pokemon knows more than one move of a certain type, the bot will attempt to delete the weakest move with redundant typing in order to maximize coverage.

`stop_evolution` - Set this to true to ensure that the bot will prevent pokemon from evolving.

`replace_lead_battler` - If true, the bot will switch the order of pokemon in the party to replace a lead pokemon that runs out of pp or runs low on hp. Helpful for leveling the whole team.

`switch_strategy` - Placeholder for future functionality for more intelligent switching in battle.

`banned_moves` - List of moves for the battle engine to never select. Moves that are banned will not be selected in combat, and are likely to be forgotten if `new_move` is set to `learn_best`.

</details>

## `discord.yml` - Discord integration config

<details>
Expand Down Expand Up @@ -454,6 +491,10 @@ RNG manipulation options may be added to the bot in the future, all cheats are d
- Gen3 Pokémon games use predictable methods to seed RNG, this can cause the bot to find identical PID Pokémon repeatedly after every reset (which is why RNG manipulation is possible), see [here](https://blisy.net/g3/frlg-starter.html) and [here](https://www.smogon.com/forums/threads/rng-manipulation-in-firered-leafgreen-wild-pok%C3%A9mon-supported-in-rng-reporter-9-93.62357/) for more technical information
- Uses Python's built-in [`random`](https://docs.python.org/3/library/random.html) library to generate and inject a 'more random' (still pseudo-random) 32-bit integer into the `gRngValue` memory address, essentially re-seeding the game's RNG

`pickup` - detect through memory when the number of Pokémon with pickup in the party is sufficient to take items.
- if enabled, the bot won't actively open the party menu to pretend that it's actually checking whether enough pickup Pokémon have items.
- if disabled, every x encounters (specified by `pickup_check_frequency` in `battle.yml`) the bot will open the party menu from the field and "check" whether the requisite number of Pokémon (specified by `pickup_threshold` in `battle.yml`) with pickup as their ability have items.

</details>

## `obs.yml` - OBS config
Expand Down
Loading