Code: Select all
#SingleInstance,Force
CoordMode,Pixel,Screen
CoordMode,Mouse,Screen
^z::
IfWinActive, ahk_class
Stop=0
While Stop=0
{
Send {w down}
Sleep 3000
Send {w up}
Send {a down}
Sleep 3000
Send {a up}
Send {s down}
Sleep 3000
Send {s up}
Send {d down}
Sleep 3000
Send {d up}
PixelSearch,ax,ay,0,0,700,700,000000,0,RGB Fast
if !ErrorLevel
{
Sleep 5000
Send {f 20}
}
return
^a::ExitApp
I want it to walk in a square/rectangle and when it detects a black screen it presses f 20 times, I want the whole thing to keep looping until I manually stop it. I just dont know how to make it check if theres a black screen all the time.
also how would i add ifwinactive in this so it only runs on my emulator
Thanks for the help