Click at the end of a line 2 colors near mousecursor

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
maxkill
Posts: 158
Joined: 11 Apr 2016, 13:03

Click at the end of a line 2 colors near mousecursor

11 Nov 2018, 10:46

Hello!

I'm looking for a script that clicks at the end of a line that has a particular color right or left of the line. I'm thinking it could be a
1x3 rectangle (ideally about 4mm height*1.2cm width) that searches around the mousepointer position and then clicks once it finds the end of the line of either color.

These are the colors of lines:

green 0x139011

red 0x10288A

Not sure if needed but these are the colors of surrounding background of the lines:

0x01FA15 grey
0x383532 lighter grey

I found this script while searching but it did not seem to work for me unfortunately.

Code: Select all

PixelSearch, Px, Py, 280, 300, 1740, 1000, 0x3296FF, 0, Fast
   MouseMove, %Px%, %Py%

Sleep, 50
{

Label9000:
MouseMove, 1, 0, 0, R	; Move the mouse to next pixel and check its color again.
MouseGetPos X, Y 
PixelGetColor, Color, %X%, %Y%, RGB
{
If (Color = 0xE0E0E0, 1, Fast)
{
	MouseClick, left
}
If (Color = 0xE7E7E7, 1, Fast)
{
	MouseClick, left
}
Else
{
	Goto, Label9000
}
}
}
Return	; Stop execution of this thread.
maxkill
Posts: 158
Joined: 11 Apr 2016, 13:03

Re: Click at the end of a line 2 colors near mousecursor

15 Nov 2018, 17:12

So, to cearify I'm asking how to make ahk click where a colored line stops in a defined area. These are horizontal lines.
I'm thinking it searches for a pixel or pixels where the background color meets the end of the line color, if it could do such a thing.. Would probably be easiest?
I have no clue how to do this however and would greatly appreciate any help!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 141 guests