Code: Select all
#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
#Persistent
#MaxThreadsPerHotkey 2
ListLines Off
Process, Priority, , A
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1
SendMode Input
CoordMode, pixel,screen
CoordMode, mouse,screen
#include CGdipSnapshot.ahk
#include SendMouse.ahk
wwr:=0x003244
;wwe:=0x007098
;wwq:=0x0085b5
zz:= 11
;; луп сравнения 2 и 1 зоны
f2::
loop
{
snap2 := new CGdipSnapshot(SNAPSHOT_X-zz,SNAPSHOT_Y,SNAPSHOT_WIDTH,SNAPSHOT_HEIGHT)
tooltip % snap.Compare(snap2,1)
if (snap.Compare(snap2) == 0)
{
SendMouse_LeftClick()
SetTimer, RemoveToolTip, -1000
break
}
}
return
RemoveToolTip:
ToolTip
return
;; скринкап первой рабочей зоны
f1::
mousegetpos, xw1,yw1
xw2:= xw1+520
yw2:= yw1+70
snapreg := new CGdipSnapshot(xw1,yw1,xw2-xw1,yw2-yw1)
;out := " "
;out .= "RGB Values: (" snap.PixelSnap[0,0].rgb ") = {r: " snap.PixelSnap[0,0].r ", g: " snap.PixelSnap[0,0].g ", b: " snap.PixelSnap[0,0].b "}"
;tooltip % out
;return
;Create A Gui
;w := xw2-xw1+5
;h := yw2-yw1+5
; GUI item to hold Snapshot Preview. Store HWND in SnapshotPreview so we can send image to it later
;Gui, Add, Text, 0xE x5 y5 w%w% h%h% hwndSnapshotPreview
;w := w + 5
;h := h + 5
;Gui, Show, W%w% H%h%
; Show the Snapshot in the Preview box
;snapreg.ShowSnapshot(SnapshotPreview)
return
;; поиск нужного пикселя в рабочей зоне
f3::
PixelSearch, Px, Py, xw2, yw2, xw1, yw1, wwr, 5, Fast
if !ErrorLevel
Mousemove,% Px+2 ,% Py+12
else
;PixelSearch, Px, Py, xw2, yw2,xw1, yw1, wwe, 2, Fast
;if !ErrorLevel
; Mousemove,% Px+2 ,% Py+12
; else
;; снятие 2 рабочей зоны для сравнения
f4::
MouseGetPos, SNAPSHOT_X, SNAPSHOT_Y
SNAPSHOT_WIDTH := 5
SNAPSHOT_HEIGHT := 2
snap := new CGdipSnapshot(SNAPSHOT_X-zz,SNAPSHOT_Y,SNAPSHOT_WIDTH,SNAPSHOT_HEIGHT)
;Create A Gui
;w := SNAPSHOT_WIDTH
;h := SNAPSHOT_HEIGHT
; GUI item to hold Snapshot Preview. Store HWND in SnapshotPreview so we can send image to it later
;Gui, Add, Text, 0xE x5 y5 w%w% h%h% hwndSnapshotPreview
;w := w + 5
;h := h + 5
;Gui, Show, W%w% H%h%
; Show the Snapshot in the Preview box
;snap.ShowSnapshot(SnapshotPreview)
return