I am trying to set the X1, Y1, X2, Y2 variables of the PixelSearch to the X and Y coordinates of where the mouse is when 1 is initially pressed. I want to also add to the X2, Y2 so that it creates a rectangle of search area when looking for the designated color. (So X1 Y1 would be the top right point of the search area/rectangle and X2 Y2 would be the bottom right point.)
E.g.
#SingleInstance, Force
SendMode, Input
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir%
1::
MouseGetPos, mX, mY
X1 = mX
Y1 = mY
X2 = mX + 100
Y2 = mY + 100
PixelSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, 0xFAFF00, 1, Fast
if (ErrorLevel = 0) {
MouseMove, OutputVarX, OutputVarY, 1
}
else {
MsgBox, error
Sleep, 500
}
return
2::Reload
3::ExitApp