better?
This commit is contained in:
parent
9b494cc014
commit
bbb323a278
1 changed files with 2 additions and 1 deletions
3
main.py
3
main.py
|
@ -18,7 +18,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
# Find the burger
|
# Find the burger
|
||||||
result = matchTemplate(main_image, template_image, TM_CCOEFF_NORMED)
|
result = matchTemplate(main_image, template_image, TM_CCOEFF_NORMED)
|
||||||
threshold = 0.8
|
threshold = 0.6
|
||||||
locations = where(result >= threshold)
|
locations = where(result >= threshold)
|
||||||
|
|
||||||
# Fetch coordinates
|
# Fetch coordinates
|
||||||
|
@ -27,6 +27,7 @@ if __name__ == "__main__":
|
||||||
# If we find a burger
|
# If we find a burger
|
||||||
if len(locations):
|
if len(locations):
|
||||||
coordinates = locations[0]
|
coordinates = locations[0]
|
||||||
|
print(f"Find a golden burger at {coordinates[0]}x{coordinates[1]}")
|
||||||
# Move and click
|
# Move and click
|
||||||
moveTo(coordinates[0], coordinates[1])
|
moveTo(coordinates[0], coordinates[1])
|
||||||
click()
|
click()
|
||||||
|
|
Reference in a new issue