LUA Timer

TheyCallMeTim13

Wiki Monster
Talents
Fearless Donors
Mar 3, 2017
418
46
28
#1
https://wiki.cheatengine.org/index.php?title=Lua:Class:Timer
Lua:
--------
-------- Timer
--------
local aTimer = nil
local aTimerInterval = 100
local function aTimer_tick(timer)
    timer.destroy()
    -- body
end
aTimer = createTimer(MainForm)
aTimer.Interval = aTimerInterval
aTimer.OnTimer = aTimer_tick
Lua:
--------
-------- Timer
--------
local aTimer = nil
local aTimerInterval = 100
local aTimerTickMax = 5000
local aTimerTicks = 0
local function aTimer_tick(timer)
    if aTimerTickMax > 0 and aTimerTicks >= aTimerTickMax then
        timer.destroy()
    end
    aTimerTicks = aTimerTicks + 1
    -- body
end
aTimer = createTimer(MainForm, false)
aTimer.Interval = aTimerInterval
aTimer.OnTimer = aTimer_tick
aTimer.Enabled = true
CEA:
{$lua}
------------------------------ ENABLE ------------------------------
[ENABLE]
local aTimer = nil
local aTimerInterval = 100
local function aTimer_tick(timer)
    -- body
end
----------------------------------
if syntaxcheck then return end
aTimer = createTimer(MainForm)
aTimer.Interval = aTimerInterval
aTimer.OnTimer = aTimer_tick
------------------------------ DISABLE ------------------------------
[DISABLE]
if syntaxcheck then return end
aTimer.destroy()
 
Last edited:
Top Bottom