Do While True
consent.RequestInfoUpdate(Array("pub-xxxx"))
Wait For consent_InfoUpdated (Success As Boolean)
If Success = False Then
Log($"Error getting consent state: ${LastException}"$)
Sleep(10000) '<-- try again in 10 seconds
Else
Exit
End If
Loop
Log($"Consent state: ${consent.ConsentState}"$)
Do While IsPaused(Main)
Sleep(100)
Loop
CallSubDelayed(Main, "ConsentStateAvailable")