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

12
main.py
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,11 +22,14 @@ 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]))
# Move and click # If we find a burger
moveTo(locations[0], locations[1]) if len(locations):
click() coordinates = locations[0]
# Move and click
moveTo(coordinates[0], coordinates[1])
click()
# Wait a second every loop # Wait a second every loop
sleep(1) sleep(1)