Posted: Wed Mar 22, 2017 8:22 am Post subject: Help Lua Scrip
Hello . Please take some time to watch this code for me.
Code:
local recordId = 4
local elapsed = 20000
local duration = 1000
local original = 1
local changeTo = 0
myrecord = getAddressList().getMemoryRecordByID(recordId)
if mytimer == nil then
mytimer = createTimer(nil, false)
end
mytimer.OnTimer = function(timer)
if mytimer.Interval == elapsed then
mytimer.Interval = duration
myrecord.Value = changeTo
else
mytimer.Interval = elapsed
myrecord.Value = original
end
end
mytimer.Interval = elapsed
MYTIMER_INTERVAL = 50000
mytimer.OnTimer = function(timer)
if mytimer.Interval == MYTIMER_INTERVAL then
mytimer.Interval = duration
myrecord.Value = changeTo
else
mytimer.Interval = MYTIMER_INTERVAL
myrecord.Value = original
end
end
function CECheckbox3Change(sender)
function CETrackBar1Change(sender)
MYTIMER_INTERVAL = sender.Position * 1000
end
mytimer.Enabled = sender.Checked
end
I think it does not work. Or was acting wrong.
If it's wrong then edit it for me.
Min if dragging out the trackbar it will return to 0. I want it to work is 10 and Max is 50
Posted: Wed Mar 22, 2017 9:18 am Post subject: Re: Help Lua Scrip
Although it has little information, perhaps the error is in the end.
Code:
function CECheckbox3Change(sender)
function CETrackBar1Change(sender)
MYTIMER_INTERVAL = sender.Position * 1000
end
mytimer.Enabled = sender.Checked
end
for:
Code:
function CECheckbox3Change(sender)
mytimer.Enabled = sender.Checked
end
function CETrackBar1Change(sender)
MYTIMER_INTERVAL = sender.Position * 1000
end
And if you want to limit the track bar between 10 and 50. Go to the properties of the trackbar that has options to change this. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum