#include <WinAPIEx.au3>
#include <misc.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
Opt("MouseClickDelay")
Opt("MouseClickDownDelay")
Opt("MouseCoordMode", 1)
Global $bPaused, $hDll, $aXY, $iDiff
OnAutoItExitRegister("_OnExit")
HotKeySet("{f5}", "_Start")
HotKeySet("{f6}", "_Pause")
HotKeySet("{0}", "_Exit")
AutoItSetOption("MouseCoordMode", 2)
$hWnd = WinGetHandle("[ACTIVE]")
_Area(945, 500, 950, 350); - показать область поиска пикселя
$hDll = DllOpen("user32.dll")
_Start()
Func _Area($iLeft, $iTop, $iRght, $iBottom, $iTrans=150)
Local $hWin = GUICreate('Win', $iTop, $iBottom, $iLeft, $iBottom, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $WS_EX_TRANSPARENT))
WinSetTrans($hWin, '', $iTrans)
GUISetBkColor(0x0000e, $hWin)
GUISetState(@SW_SHOW, $hWin)
EndFunc
While 1
$hTimer = TimerInit()
$coord =PixelSearch(@DesktopWidth/945,@DesktopHeight/5,@DesktopWidth/950,@DesktopHeight/350, 0x3E5780, 50, 2, $hWnd); указать диапазон поиска и подобрать цвет
If IsArray($coord) = True Then
MouseClick("LEFT")
Endif
$iDiff = TimerDiff($hTimer)
WEnd
Func _Start()
ToolTip("Script _Started... Press F6 to _Pause, 0 Exit", 1, 1);F5- старт, F6 - пауза, 0 - закрывает программу
$bPaused = False
EndFunc ;==>_Start
Func _Pause()
$bPaused = True
$i=0
ToolTip("Script _Paused... Press F5 to _Start, 0 Exit", 1, 1)
While $bPaused
Sleep(100)
WEnd
EndFunc ;==>_Pause
Func _OnExit()
DllClose($hDll)
EndFunc ;==>_OnExit
Func _Exit()
Exit
EndFunc ;==>_Quit