Is it possible to have AHK check the color of a very specific spot every 2 seconds. (800, 150 are the X & Y coordinates). Then If the color changes, I'd like to initiate 1 mouse click on that exact same spot (see the spot marked as X in the screenshot). Mouse click opens up the email.
Then copy the digit passcode contained in the second screenshot.
I was able to obtain the HEX value of the two different colors:
Read Email: Grey background (e7ebf1)
Unread Email: White background (ffffff)
6-digit passcode:
Check the color of a certain area and initiate mouse click if color changes
Re: Check the color of a certain area and initiate mouse click if color changes
Here is a start for you on the first part.
Code: Select all
#Persistent
x := 800, y := 150
SetTimer, Check, 2000
Check:
SoundBeep, 1500
last := color
PixelGetColor, color, x, y
If (last = "" || color = last)
Return
MouseClick,, x, y
SoundBeep, 500
ExitApp
Re: Check the color of a certain area and initiate mouse click if color changes
Sorry Mikeww, your code does not work. It is not detecting the color change at all.
Re: Check the color of a certain area and initiate mouse click if color changes
Is your target window active when the script is first run?
You can issue a MouseMove to the coordinate.
What is the initial color that this script detects?
What is the color that this script detects there after your color changes?
You can issue a MouseMove to the coordinate.
What is the initial color that this script detects?
What is the color that this script detects there after your color changes?