Mam coś takiego:
<config name='happyHoursConf'>
<![CDATA[
HH_STORAGE = 2327
DAYS = {
['Monday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Tuesday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Sunday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Wednesday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Thursday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Friday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Saturday'] = {
{from = '16:00:00', to = '20:00:00'}
},
['Sunday'] = {
{from = '16:00:00', to = '20:00:00'}
}
}
]]>
</config>
<globalevent name="happyHoursStop" interval="1000" event="script">
<![CDATA[
domodlib('happyHoursConf')
domodlib('happyHoursLib')
local daysOpen = {}
for k, v in pairs(DAYS) do
table.insert(daysOpen, k)
end
function onThink(interval)
if isInArray(daysOpen, os.date('%A')) then
for k, v in pairs(DAYS[os.date('%A')]) do
if isInArray(v.to, os.date('%X', os.time())) then
stopNewWorld()
break
end
end
end
return true
end
]]>
</globalevent>
i nie chce mi wywolac funkcji stopNewWorld()
<config name='happyHoursConf'>
<![CDATA[
HH_STORAGE = 2327
DAYS = {
['Monday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Tuesday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Sunday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Wednesday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Thursday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Friday'] = {
{from = '16:00:00', to = '17:00:00'}
},
['Saturday'] = {
{from = '16:00:00', to = '20:00:00'}
},
['Sunday'] = {
{from = '16:00:00', to = '20:00:00'}
}
}
]]>
</config>
<globalevent name="happyHoursStop" interval="1000" event="script">
<![CDATA[
domodlib('happyHoursConf')
domodlib('happyHoursLib')
local daysOpen = {}
for k, v in pairs(DAYS) do
table.insert(daysOpen, k)
end
function onThink(interval)
if isInArray(daysOpen, os.date('%A')) then
for k, v in pairs(DAYS[os.date('%A')]) do
if isInArray(v.to, os.date('%X', os.time())) then
stopNewWorld()
break
end
end
end
return true
end
]]>
</globalevent>
i nie chce mi wywolac funkcji stopNewWorld()