mg_01 Cheater Reputation: 0
Joined: 28 Jan 2018 Posts: 41
|
Posted: Fri May 28, 2021 7:14 pm Post subject: |
|
|
Something like this, maybe? It updates the values every time a Total-Frame counter changes.
Code: |
addresslist = getAddressList()
myform= createForm()
myform.width = 800
myform.height = 400
label1= createLabel(myform)
label2= createLabel(myform)
value1 = nil
value2 = nil
description1=[[Frame_Counter]]
local memrec1=addresslist_getMemoryRecordByDescription(addresslist, description1)
description2=[[P1_A_Health_Big]]
local memrec2=addresslist_getMemoryRecordByDescription(addresslist, description2)
local t=createTimer(nil)
-- function changing()
function changing()
value1=description1..": "..memoryrecord_getValue(memrec1)
control_setPosition(label1, 10,10)
control_setCaption(label1,value1)
value2=description2..": "..memoryrecord_getValue(memrec2)
control_setPosition(label2, 10,30)
control_setCaption(label2,value2)
return true
end
function start(memoryrecord, before, currentstate)
timer_onTimer(t, changing)
timer_setInterval(t,100)
timer_setEnabled(t, true)
return true
end
memoryrecord_onActivate(memrec1, start)
memoryrecord_onActivate(memrec2, start)
button1 = createButton(myform)
button1.setName( "Stop" )
function toggle()
timer_setEnabled(t,not timer_getEnabled(t))
end
control_onClick(button1, toggle)
control_setPosition(button1, 800-75,0) -- minus 75 from the width
|
|
|