Code:
#region HotKeySet
HotKeySet("{F4}","PIXELREAD")
HotKeySet("{F2}","PIXELFIND")
HotKeySet("{f3}","ExitProg")
#ENDREGION
#region variables
dim $pos[2]
dim $color
Global $counter=0
Global $searchfor = 12059395
Global $on=0
#ENDREGION
Func ExitProg()
Exit
EndFunc
#region Functions
Func PIXELREAD()
$pos = MouseGetPos()
$color = PixelGetColor($pos[0],$pos[1])
MsgBox(0,"Color",$color&@CRLF&$pos[0]&","&$pos[1])
EndFunc
Func PIXELFIND()
$on=1
While $on=1
$pos = PixelSearch(133,231,1155,936,$searchfor)
if not @error Then
MouseMove($pos[0],$pos[1],0)
Sleep(500)
MouseClick("left")
EndIf
If @error Then
$counter=$counter+1
EndIf
if $counter>5 Then
$on=0
EndIf
WEnd
MouseUp("left")
MsgBox(0,"It's Colored","We colored it.")
EndFunc
#ENDREGION
While 1
Sleep(100)
WEnd
I want to search pixels in a small area in the center of the screen (200 x 200 px)
If no pixel find then make area larger and larger until pixel is find and left click on it,
then sleep 4 sec and make area small again instant (200 x 200 px)
thank you
how to make to search from center of the screen?