Python Forum
Is it possible to use a tuple to click on a pixel with a bgr code?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to use a tuple to click on a pixel with a bgr code?
#1
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?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020