How to Check if Cloud Variables Have a Connection Error

Материал из Поле цифровой дидактики

Шаблон:Cloud DataШаблон:Wiki Standards This tutorial explains how to check if a user is having problems connecting to Cloud Variables.

Variables needed:

(☁ Debug?)
(Debug?)
(☁ Response)
(Old Response)

The code:

define Cloud variable connection check// Run without screen refresh
if <(☁ Response) = [0]> then
set [☁ Response v] to [1]
set [Old Response v] to (☁ Response)
else
if <(☁ Response) = [1]> then
set [☁ Response v] to [0]
set [Old Response v] to (☁ Response)
end
end
wait [0.5] seconds
if <(☁ Response) = (Old Response)> then
set [Debug? v] to (1)
set [☁ Debug? v] to (1)
end
wait [0.5] seconds
if <(☁ Debug?) = (Debug?)> then
set [Debug? v] to (2)
else
set [Debug? v] to (0)
end
when green flag clicked
set [Debug? v] to (0)
forever
if <<(Debug?) = [0]> and <(☁ Debug?) = [1]>> then
set [☁ Debug? v] to (0)
end
end
when green flag clicked
hide
forever
Cloud variable connection check
if <(Debug?) = [2]> then
show
say [Connection error or there are no other players on.]//This notifies you that there are no other players on or your connection isn't working.
else
hide
end
end