I have a def that looks for a pixel match color if this is true it looks for an image can i replace this with locateonscreen? becorse the image position change over time
this is my def and it works but i want to use locateonscreen instead of match color for the yellowbell i changed this to the code below can this work?
i = 0
#while pyautogui.pixelMatchesColor(YellowBellX , YellowBellY , (YellowR,YellowG,YellowB), tolerance = 20) == True and pyautogui.pixelMatchesColor(firstTaskX , firstTaskY , (NoOrdersAviableBannerR ,NoOrdersAviableBannerG ,NoOrdersAviableBannerB ), tolerance = 20) == False:
while pyautogui.locateOnScreen("YellowBell.png",region=(19,116,900,60), confidence=0.8) == True and pyautogui.pixelMatchesColor(firstTaskX , firstTaskY , (NoOrdersAviableBannerR ,NoOrdersAviableBannerG ,NoOrdersAviableBannerB ), tolerance = 20) == False:
if pyautogui.pixelMatchesColor(firstTaskX , firstTaskY , (blueR,blueG,blueB), tolerance = 20) == True:
break