Code: Select all
SetDefaultMouseSpeed, 0
CoordMode, Pixel, window
*MButton::
SoundBeep, 2000, 500
PixelGetColor, OutputVar1, 836, 521, slow
PixelGetColor, OutputVar2, 836, 529, slow
PixelGetColor, OutputVar3, 844, 521, slow
PixelGetColor, OutputVar4, 844, 529, slow
Loop
{
if not GetKeyState("MButton","P")
break
PixelGetColor, OutputVar1_, 836, 521, slow
PixelGetColor, OutputVar2_, 836, 529, slow
PixelGetColor, OutputVar3_, 844, 521, slow
PixelGetColor, OutputVar4_, 844, 529, slow
if not (OutputVar1_ = %OutputVar1%) and (OutputVar2_ = %OutputVar2%) and (OutputVar3_ = %OutputVar3%) and (OutputVar4_ = %OutputVar4%)
{
SendInput {Lbutton Down}
SendInput {Lbutton Up}
}
}
return
!z::ExitApp
But, when the last four pixel change , the code including If couldn`t work.
Code: Select all
if not (OutputVar1_ = %OutputVar1%) and (OutputVar2_ = %OutputVar2%) and (OutputVar3_ = %OutputVar3%) and (OutputVar4_ = %OutputVar4%)
{
SendInput {Lbutton Down}
SendInput {Lbutton Up}
}