This bot automates playing Match-3 style games by constantly looking for matches and making moves until it either can't find any more moves or you stop it.
- Find board: Locate the game board on the screen.
- Locate objects: Identify the objects on the board using template matching.
- Find the best match: Analyze the board to find the best possible match.
- Make the swap: Perform the swapping action to make the match.
- Wait for board stability: Wait for the board to settle after the move.
- Repeat: Continue from step 2 until no more moves are found or the bot is stopped.
-
Install the necessary dependencies:
pip install -r requirements.txt
-
Get the board coordinates:
- Run the
match3-getBoardPos.py
script. - Click the top-left and bottom-right corners of the game board.
- Update the
detect_game_board()
function inmatch3-solver.py
with the obtained coordinates.
- Run the
-
Add template images:
- Take screenshots of the individual objects in your specific game.
- Save them as
object1_template.png
,object2_template.png
, etc.
-
Adjust the grid size:
- The bot assumes a 6x7 game board grid by default.
- Modify the grid size in the code to match your game's layout.
-
Run the bot:
python match3-solver.py
-
To stop the bot, press '0'.
- The current method for waiting for board stability is primitive and could be improved.
- If objects are incorrectly detected, the solver may make invalid moves.
- The solver doesn't currently check if a move was successful or if the game has ended.
Feel free to contribute to the project and help address these limitations!