JDuffy135 / Minesweeper-Bot-Python

Python script that plays games on minesweeper.one and minesweeper.online
2 stars 0 forks source link

error #1

Open Noirgluk opened 1 week ago

Noirgluk commented 1 week ago

Hi, interesting project, I try to use for minesweeper.online and get an error, the bot clicks in the left corner and then stops and does nothing.

NEW ITERATION Traceback (most recent call last): File "C:\Users\user\Downloads\Minesweeper-Bot-Python-master (2)\Minesweeper-Bot-Python-master\main.py", line 110, in results = fullAlgorithm.run_algorithm(gameboard, col_x_coords, row_y_coords, responses) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\Downloads\Minesweeper-Bot-Python-master (2)\Minesweeper-Bot-Python-master\fullAlgorithm.py", line 182, in run_algorithm LS_RESULT = LS.local_search(gameboard, col_x_coords, row_y_coords, unfinished_numbers, bombs_remaining) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\Downloads\Minesweeper-Bot-Python-master (2)\Minesweeper-Bot-Python-master\localSearch.py", line 333, in local_search return [len(mine_tiles), click_tiles, aggregations, mine_combinations, subset_elimination_ran] ^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'aggregations' where it is not associated with a value

JDuffy135 commented 1 week ago

Thank you for catching this! I believe this occurs because I pushed my code without fully implementing an additional feature I was attempting to add. I'll push my most recent code ASAP, and the error should be fixed.

Noirgluk commented 1 week ago

Now it takes two clicks and stops unfortunately(

JDuffy135 commented 1 week ago

Hmm, were you using light mode on minesweeper.online? I can't remember if I wrote this in the terminal prompts or not, but it's important that you do this because of the way the tile detection works.

The way it works is that it detects the tile types based on the presence of specific colors within a small radius of your cursor. This works fine once the colors are being detected properly, but the issue is that these color values are hard-coded, so it could potentially work on some machines and not work on some others. I want to rewrite this system at some point for this reason, but I don't really have the time at the moment sadly :(

By the way, if there were any new error messages you encountered, feel free to let me know. I appreciate criticisms and insights!