Hi!
I'm having trouble figuring this out... On a website I'm using, I need AHK to click a button called print labels, then another redundant button comes out after the click that also says print labels and needs me to click it as well. I'm using an extension that highlights the word "print labels" in orange. So AHK clicks the orange color on print labels correctly, but now the problem is getting it to click the second one. Because they're the same text, I can't make it colored something different. Is there a way to make AHK click on a second instant of the same color? Another solution, this one less precise, is I know the second button is about 25 pixels below the first button.
I tried making the code click on px, py for the first button, then px, py+25 but ends up clicking the same spot a second time. Here's my code:
PixelSearch, Px, Py, 0, 0, 1062, 1062, 0x3399ff, 0, Fast
If(ErrorLevel == 0){
Click, %Px%, %Py%
Sleep 500
Click, %Px%, y+25
}else{
MsgBox, Printlabels not found.
exit
}
Thank you all so much for the help
Click mouse relative to x,y variable from color search
-
- Posts: 4
- Joined: 15 Aug 2018, 10:58
Re: Click mouse relative to x,y variable from color search
u need to do ur calculation prior to using the variable with ClickClick, %x%, %y% Since click does not support expressions, variables should be enclosed in percent signs.
-
- Posts: 4
- Joined: 15 Aug 2018, 10:58
Re: Click mouse relative to x,y variable from color search
I'm still doing something wrong. This one doesn't work neither
PixelSearch, Px, Py, 0, 0, 1062, 1062, 0x3399ff, 0, Fast
If(ErrorLevel == 0){
Wa:= %Px% + 10
Hb:= %Py% + 10
Click, %Wa%,%Hb%
}else{
MsgBox, Printlabels not found.
exit
}
Any help would be really awesome
PixelSearch, Px, Py, 0, 0, 1062, 1062, 0x3399ff, 0, Fast
If(ErrorLevel == 0){
Wa:= %Px% + 10
Hb:= %Py% + 10
Click, %Wa%,%Hb%
}else{
MsgBox, Printlabels not found.
exit
}
Any help would be really awesome
Re: Click mouse relative to x,y variable from color search
Code: Select all
PixelSearch, Px, Py, 0, 0, 1062, 1062, 0x3399ff, 0, Fast
if (ErrorLevel == 0) {
Wa := Px + 10
Hb := Py + 10
Click, %Wa%,%Hb%
} else {
MsgBox, Printlabels not found.
exit
}
Who is online
Users browsing this forum: just me, roysubs, scriptor2016, zerox and 271 guests