test adjusting the the checkMainScreen() code to increase the delay
Func checkMainScreen() ;Checks if in main screen
SetLog("Trying to locate Main Screen")
_CaptureRegion()
While _ColorCheckVariation(_PixelGetColor_GetPixel(284, 2, Hex(0x41B1CD, 6), 20) = False
$HWnD = WinGetHandle("BlueStacks App Player")
If _Sleep(1000) Then Return
Func checkMainScreen() ;Checks if in main screen
SetLog("Trying to locate Main Screen")
_CaptureRegion()
While _ColorCheckVariation(_PixelGetColor_GetPixel(284, 2, Hex(0x41B1CD, 6), 20) = False
$HWnD = WinGetHandle("BlueStacks App Player")
If _Sleep(1000) Then Return