oops!
This commit is contained in:
parent
6c94de6ff7
commit
9b494cc014
1 changed files with 8 additions and 4 deletions
8
main.py
8
main.py
|
@ -6,6 +6,7 @@ from PIL import ImageGrab
|
|||
from pyautogui import click, moveTo
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Running...")
|
||||
while True:
|
||||
# Screenshot
|
||||
screenshot = ImageGrab.grab()
|
||||
|
@ -21,10 +22,13 @@ if __name__ == "__main__":
|
|||
locations = where(result >= threshold)
|
||||
|
||||
# Fetch coordinates
|
||||
locations = list(zip(*locations[::-1]))[0]
|
||||
locations = list(zip(*locations[::-1]))
|
||||
|
||||
# If we find a burger
|
||||
if len(locations):
|
||||
coordinates = locations[0]
|
||||
# Move and click
|
||||
moveTo(locations[0], locations[1])
|
||||
moveTo(coordinates[0], coordinates[1])
|
||||
click()
|
||||
|
||||
# Wait a second every loop
|
||||
|
|
Reference in a new issue