JDuffy135 / Minesweeper-Bot-Python

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

I have a issue on minesweeper.online #2

Open Tkhoa64 opened 4 days ago

Tkhoa64 commented 4 days ago

When i start the program, it only clicks the top left corner and top right corner. However, it doesn't play anymore, always stop. Is there any solutions to fix this. Thanks

Also there's an error : Traceback (most recent call last): File "C:\Users\2500\Downloads\Minesweeper-Bot-Python-master\Minesweeper-Bot-Python-master\main.py", line 110, in results = fullAlgorithm.run_algorithm(gameboard, col_x_coords, row_y_coords, responses) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\2500\Downloads\Minesweeper-Bot-Python-master\Minesweeper-Bot-Python-master\fullAlgorithm.py", line 241, in run_algorithm loss_status = td.click_tile_and_update_board(gameboard, col_x_coords, row_y_coords, zoom_size, tile, site) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\2500\Downloads\Minesweeper-Bot-Python-master\Minesweeper-Bot-Python-master\newTileDetection.py", line 269, in click_tile_and_update_board pyautogui.click(col_x_coords.get(col_num), row_y_coords.get(row_num)) File "C:\Users\2500\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui__init.py", line 593, in wrapper failSafeCheck() File "C:\Users\2500\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\init__.py", line 1734, in failSafeCheck raise FailSafeException( pyautogui.FailSafeException: PyAutoGUI fail-safe triggered from mouse moving to a corner of the screen. To disable this fail-safe, set pyautogui.FAILSAFE to False. DISABLING FAIL-SAFE IS NOT RECOMMENDED.

JDuffy135 commented 4 days ago

I read up on this error a little bit, and I found this post on StackOverflow: https://stackoverflow.com/questions/33182221/how-do-i-have-a-fail-safe-command-in-python

Were you playing with the web window in the top left corner by any chance? It seems that PyAutoGUI has a failsafe measure that automatically terminates the program if you move your cursor to the top left corner of your screen (although I've never had issues with this myself).

A possible fix is adding the following line of code to the files that import pyautogui (main.py, newTileDetection.py, fullAlgorithm.py, developerMode.py): "pyautogui.FAILSAFE = False". (make sure to add this line after the import statement)

If you try this out, let me know if it fixes the issue!

Tkhoa64 commented 3 days ago

The error was fixed, but i doesnt play at all. Always stop when click the top left corner and top right corner. Do you have any solutions to fix this. Thanks