after 4 hours i decided i should get help lol
Posted: 24 Feb 2017, 00:24
Hi guys. I'm sort of new to the whole ahk thing. I've been making great progress, but I'm finally at the point where I can't find the answer on the internet
Basically I'm trying to make sure the script doesn't back track on pixels, if its trying to back track to much i'm trying to break the loop. It all works great, except the
"if (oldx =newx and oldy = newy)" I've also tried
if (oldx and oldy = newx and newy)
and so many other varations, i just can't figure it out.
Code: Select all
stuck = 0
while stuck<5
{
PixelSearch, Px, Py, 446, 356, 799, 508, 0x04051E,3 , fast RGB
if ErrorLevel
break
else
;---------------------------------------------------- clicking
MouseGetPos, oldx, oldy
MouseMove, %px%, %py%
Sleep, 200
Send, {Ctrl Down}
Click
Send, {Ctrl up}
MouseGetPos, newx, newy
if (oldx =newx and oldy = newy)
{
stuck++
MsgBox, ,,number of stucks triggered %stuck%,1
}
;---------------------------------------------------done
}
"if (oldx =newx and oldy = newy)" I've also tried
if (oldx and oldy = newx and newy)
and so many other varations, i just can't figure it out.