objectdef TestController
{
    method Initialize()
    {
        echo "TestController::Initialize"
        LGUI2:LoadPackageFile["Test.json"]
        RunScript "${LavishScript.HomeDirectory}/Scripts/mr/common/Navigation/Movement"
    }

    method Shutdown()
    {
        echo "TestController::Shutdown"
        LGUI2:UnloadPackageFile["Test.json"]
        EndScript Movement
    }

    method OnClose()
    {
        echo "TestController::OnClose"
        Script:End
    }

    method Test()
    {
        variable jsonvalue relayObj
        relayObj:SetValue["$$>{
            "target": "all",
            "object": "MRRelayApi",
            "method": "SetMoveSpot",
            "parameters": {
                "ForWho": "Dasteg",
                "minDistance": 1,
                "location": {
                    "X": ${Me.Target.Loc.X},
                    "Y": ${Me.Target.Loc.Y},
                    "Z": ${Me.Target.Loc.Z},
                }
            }
        }<$$"]


        innerspace:Relay["${relayObj.AsJSON~}"]
    }
}

variable(global) TestController MRTestController
function main()
{
    
    while 1
    {
        wait 5
    }
}