#include <Array.au3>
iF WinExists("Royal Quest") Then
HotKeySet('{F1}', '_Exit')
$i = 0
While 1
Global $aColors[6]=["0x251146","0x5544AC","0x775ADD","0x5D4A8E","0x28215D","0x0F0622"]
Send("{ALT down}")
For $i=0 To UBound($aColors)-1 Step 0
$aCoord=PixelSearch(0,24,1279,769,$aColors[$i],10)
If Not @error Then
MouseClick('left', $aCoord[0], $aCoord[1], 1,0)
Sleep(2000)
Send("3")
Sleep(5000)
ExitLoop
EndIf
Next
WEnd
Else
MsgBox(0,"!!!!!!","Игра не запусчена")
Exit
EndIf
Func _Exit()
Send("{ALT up}")
Exit
EndFunc ;==>_Exit