I made a script to match the time of day to 3 user variables I get the user variables and convert them to an INT using VAR(), but when I use m.userVariables.Lookup("test").GetCurrentValue() for all 3 variables it works only works once and then the player gets stuck or crashes shortly after that.
So I do this:
-----------------------------------
' Get System time
t = CreateObject("roSystemTime")
gedat = t.GetLocalDateTime()
sDate = gedat.ToIsoString()
sHour = Mid(sDate, 10, 2)
sMin = Mid(sDate, 12, 2)
sTime = sHour+sMin
tTime = VAL(sTime)
' Get uservariables
isplaying = m.userVariables.Lookup("myclip").GetCurrentValue()
userMorn = VAR(m.userVariables.Lookup("uvmorn").GetCurrentValue())
userAftr = VAR(m.userVariables.Lookup("uvafter").GetCurrentValue())
userEven = VAR(m.userVariables.Lookup("uveven").GetCurrentValue())
theText = sTime + "/" + userMorn + "/" + userAftr + "/" + userEven
' Set dynamic textfield variable
m.userVariables.Lookup("mytext").SetCurrentValue(theText,true)
-----------------------------------------
and then use send plugin commands later to play the correct video. For instance:
-------------------------------------
if tTime >= userMorn AND tTime < userAftr AND isplaying <> "morning" then 'Morning
' send Plugin message
pluginMessageCmd = CreateObject("roAssociativeArray")
pluginMessageCmd["EventType"] = "EVENT_PLUGIN_MESSAGE"
pluginMessageCmd["PluginName"] = "Timeday"
pluginMessageCmd["PluginMessage"] = "morning"
m.msgPort.PostMessage(pluginMessageCmd)
endif
-------------------------------------
If I only get the value of 1 variable it works fine, and if use just static INT values in the IF statement instead of the variables in the script it also works fine.
Any clue what might be going wrong here?