This commit is contained in:
Mylloon 2023-09-24 01:29:33 +02:00
parent 6c94de6ff7
commit 9b494cc014
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -6,6 +6,7 @@ from PIL import ImageGrab
from pyautogui import click, moveTo from pyautogui import click, moveTo
if __name__ == "__main__": if __name__ == "__main__":
print("Running...")
while True: while True:
# Screenshot # Screenshot
screenshot = ImageGrab.grab() screenshot = ImageGrab.grab()
@ -21,10 +22,13 @@ if __name__ == "__main__":
locations = where(result >= threshold) locations = where(result >= threshold)
# Fetch coordinates # 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 # Move and click
moveTo(locations[0], locations[1]) moveTo(coordinates[0], coordinates[1])
click() click()
# Wait a second every loop # Wait a second every loop