Context:
I have been working on a script to look at a web page and using ImageSearch find all check boxes and click them. when I was looking around at what people do for fining multiple images, I found this forum post here https://autohotkey.com/board/topic/4603 ... -question/, the wonderful code provided by 'jethrow' works ridiculously fast, finding all the coordinates of the check boxes in a fraction the time of any other solution I have seen yet. However aside from displaying them in a message box I have no idea how to get at said coordinates for mouse move commands, and despite spending a couple hours trying to understand his code i am just too far out of my elements to figure it out.
Never the less I have a few questions:
-First, is anyone able to explain just what each part of this code actually does?? I really want to understand it, but I am just so confused by it.
-Second, after all the points are saved into the array, is it possible to take the first set of coordinates, save it to a variable, do a couple tasks off with those points as variables, then delete it from the array before moving on to the next set of coordinates, and repeating until the array is empty?
Hope you can help me.
Code In Question, \/ *Not made by me, all credit goes to jethrow for this.* \/
Code: Select all
CoordMode, Mouse, screen
CoordMode, Pixel, screen
Xo:=Yo:=0, list:=""
Loop, {
ImageSearch, x, y, %Xo%, %Yo%, %A_ScreenWidth%, %A_ScreenHeight%, % A_Desktop "\box.bmp"
If InStr(list, x "," y "`n") {
Xo := x+1
Continue
}
If(x="" || y="")
If Xo {
Xo := 0, Yo := Yo+1
Continue
} Else Break
list .= x "," y "`n", Yo := y
}
MsgBox, %list%