Is it possible to use a tuple to click on a pixel with a bgr code? - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: Is it possible to use a tuple to click on a pixel with a bgr code? (/thread-25373.html) |
Is it possible to use a tuple to click on a pixel with a bgr code? - OliverMcC - Mar-28-2020 Hi, I have the following code: import pyautogui #Clicks link pyautogui.moveTo(2240, 733, 0.0) pyautogui.click() #Clicks link and transitions to new page pyautogui.moveTo(2240, 680, 0.20) pyautogui.click() #Clicks SalesQl pyautogui.moveTo(2544, 100, 0.20) pyautogui.click() #Clicks on the + pyautogui.moveTo(2478, 381, 10.0) pyautogui.click() #Clicks on the email pyautogui.moveTo(1816, 533, 12.0) pyautogui.click() #Clicks on the email again in a different location to adjust for moving email pyautogui.moveTo(1816, 600, 0.0) pyautogui.click() #Clicks on empty space in the page to allow for shortcut in order to close page pyautogui.moveTo(115, 600, 0.0) pyautogui.click() #Closes tab pyautogui.hotkey('Ctrl', 'w') #Moves to Original Spreadsheet pyautogui.moveTo(115, 28, 0.0) pyautogui.click() #Right Clicks on Blank Email Cell pyautogui.moveTo(1843, 732, 0.0) pyautogui.rightClick() #Clicks Paste Special pyautogui.moveTo(2020, 683, 0.0) pyautogui.click() #Clicks Paste values only pyautogui.moveTo(2625, 702, 0.0) pyautogui.click() #Clicks the Down Button pyautogui.moveTo(2877, 1800, 0.0) pyautogui.click()I have the following tuple: BoxBox(left=2021, top=646, width=444, height=261)I have the following bgr reference: (220, 13, 153 )Now instead of: #Clicks on the email pyautogui.moveTo(1816, 533, 12.0) pyautogui.click() #Clicks on the email again in a different location to adjust for moving email pyautogui.moveTo(1816, 600, 0.0) pyautogui.click()Can I make it search for the pixel with the bgr value? |