I am trying to make an aimbot for diep. I am trying to locate all enemies on the screen, but with 1 confidence it returns None
and with 0.9999 confidence it returns every single position on the screen.
I am using PyCharm, and when I run the code, it returns every location on the screen even though there isn't anything red. Then when I set confidence to 1, it doesn't even return locations that are red.
I have even tried opening the file and seeing if it could find the color. It didn't work, same results.
My Code
# https://pyautogui.readthedocs.io/en/latest/screenshot.html
from pyautogui import locateAllOnScreen, moveTo
while True:
"""
try:
coords = list(locateAllOnScreen('enemycolordiep.png'))
except 'ImageNotFoundException':
coords = []
"""
coords = locateAllOnScreen('enemycolordiep.png', confidence=X)
if coords is None:
coords = []
else:
coords = list(coords)
print(coords)
for coord in coords:
centerCoord = (coord[0] + (coord[2] / 2), coord[1] + (coord[3] / 2))
print(centerCoord)
# moveTo(centerCoord[0], centerCoord[1], duration=0)
I expected to get the red locations on the screen, but this is not working. I have pyautogui
, pyobjc-core
, pyobjc-framework-quartz
, Pillow
, opencv-python
, and a bunch of other stuff that those packages were dependent on. I am using MacOS Mojave. Thanks for the help!