How to create a timer ?

Blayde

Expert Cheater
Aug 25, 2017
220
1
16
#1
Help. I feel stuck and stupid. :lol:

I need a timer to read value (constantly).

al = getAddressList()
mr = al.getMemoryRecordByDescription("Description here")
CEEditBox.Text = mr.Value
 

TheyCallMeTim13

Wiki Monster
Talents
Fearless Donors
Mar 3, 2017
410
45
28
#2
Code:
--------
-------- Timer
--------
local aTimer = nil
local aTimerInterval = 10
local aTimerTicks = 0
local aTimerTickMax = 0
local function aTimer_tick(timer)
	if aTimerTickMax > 0 and aTimerTicks >= aTimerTickMax then
		timer.destroy()
	end
	aTimerTicks = aTimerTicks + 1
	-- body
end
aTimer = createTimer(getMainForm(), false)
aTimer.Interval = aTimerInterval
aTimer.OnTimer = aTimer_tick
aTimer.Enabled = true
Generated with: I2 CE Lua Script Template Generator
 

FreeER

RCE Fanatics
Talents
Mar 10, 2017
82
2
8
#3
A simpler option might be to let CE handle it whenever it updates the memory record using OnGetDisplayValue
Code:
al = getAddressList()
mr = al.getMemoryRecordByDescription("Description here")

mr.OnGetDisplayValue = function(mr,valuestring)
  --CETrainer.CEEdit1.Text = valuestring -- testing
  CEEditBox.Text = valuestring
end
 

Blayde

Expert Cheater
Aug 25, 2017
220
1
16
#4
FreeER post_id=29651 time=1515338452 user_id=980 said:
A simpler option might be to let CE handle it whenever it updates the memory record using OnGetDisplayValue
Code:
al = getAddressList()
mr = al.getMemoryRecordByDescription("Description here")

mr.OnGetDisplayValue = function(mr,valuestring)
  --CETrainer.CEEdit1.Text = valuestring -- testing
  CEEditBox.Text = valuestring
end
Thanks.
I'll do some tests and report.


Edit:
Error
Code:
al = getAddressList()
mr = al.getMemoryRecordByDescription("Description here")
mr.OnGetDisplayValue = function(mr,valuestring)
  --CETrainer.CEEdit1.Text = valuestring -- testing
  CEEditBox.Text = valuestring
end
Working
Code:
al = getAddressList()
mr = al.getMemoryRecordByDescription("Description here")
mr.OnGetDisplayValue = function(mr,valuestring)
  CETrainer.CEEdit1.Text = valuestring -- testing
  --CEEditBox.Text = valuestring
end
Thank you
 
Top Bottom