After knowing my game suddenly disconnects me for no reason, I would like to learn a code where I can set say, a tracker to check said thing a few times before assuming the games been disconnected.
Since I know how long it takes for me to load in and stuff, I can safely assume the timings.
Example:
Code: Select all
Loop
{
WinActivate ahk_exe Game.EXE
#WinActivateForce
Send {q Down}
sleep 10
Send {q Up}
sleep 100
Send {w Down}
sleep 10
Send {w Up}
sleep 200
Send {s Down}
sleep 10
Send {s Up}
sleep 200
Send {v Down}
sleep 10
Send {v Up}
sleep 100
Send {F3 Down}
sleep 10
Send {F3 Up}
sleep 100
Click 1111, 450
sleep 10
Click 1111, 450
sleep 100
PixelGetColor, color, 1196, 705
}Until color = 0x000000
sleep 1000
Loop
{
WinActivate ahk_exe CW.EXE
#WinActivateForce
Send {ESC Down}
sleep 10
Send {ESC Up}
sleep 1000
Send {ESC Down}
sleep 10
Send {ESC Up}
sleep 1000
Send {ESC Down}
sleep 10
Send {ESC Up}
sleep 1000
Send {I Down}
sleep 10
Send {I Up}
sleep 1000
PixelGetColor, color, 965, 619
}Until color = 0x1A4B9F
About Break function as well, I also have some problems understanding it.
Example:
Code: Select all
outer:
Loop, 5
{
sleep 1000
Click 641, 324
WinActivate ahk_exe firefox.exe
#WinActivateForce
if WinExist ahk_exe firefox.exe
Msgbox, test 1
else
break outer
}
break_outer:
MsgBox, test 2
Do tell me if I actually did anything wrong for these.