I have this script I made:
HotKeySet("{ESC}", "quit")
$color = 0x7B5585
$game = 0
(GUI WENT HERE, I TOOK OUT TO SAVE SPACE)
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Button_1
Exit
EndSelect
If $game = 1 Then
If _IsPressed("04") Then
; ( radiius, color, ?, ?, shade)
$aSearch = _PixToMouse( GuiCtrlRead($Input_1), 0x7B5585, 0, GUICtrlRead($Input_2) )
If Not @error Then
MouseClick('right', $aSearch[0], $aSearch[1], 1, 0)
Sleep(500)
EndIf
EndIf
EndIf
WEnd
Func _PixToMouse($iVariant, $iColor, $iWinCoord = 2, $iShade = 0, $iStep = 1)
$OptPCM = Opt('PixelCoordMode', $iWinCoord)
$OptMCM = Opt('MouseCoordMode', $iWinCoord)
Local $aMpos = MouseGetPos(), $aPix
If IsArray($aMpos) Then
$aPix = PixelSearch($aMpos[0] - $iVariant, $aMpos[1] - $iVariant, _
$aMpos[0] + $iVariant, $aMpos[1] + $iVariant, $iShade, $iStep)
Opt('PixelCoordMode', $OptPCM)
Opt('MouseCoordMode', $OptMCM)
If IsArray($aPix) Then
Return $aPix
EndIf
EndIf
Return SetError(1, 0, 0)
EndFunc
Func _IsPressed($v_R, $v_dll = 'user32.dll')
$v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R)
Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1
EndFunc ;==>_IsPressed
Func Play()
If $game < 1 Then
$game = $game + 1
Else
$game = 0
EndIf
EndFunc
Func quit()
Exit
EndFunc
The main line I am having trouble with is this:
$aSearch = _PixToMouse( GuiCtrlRead($Input_1), 0x7B5585, 0, GUICtrlRead($Input_2) )
because even thoguh I set color afriation to 0, it will still click on ixes xlose to this color..maybe I messed up somewhere?
I believe it is (radius to search, color, color variation?, step)
if this is wrong, pelase correct, thanks!