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
|
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
|
||||||
|
|
Reference in a new issue