[Lua] Timer

Section's for general approaches on hacking various options in games. No online-related discussions/posts OR warez!
Post Reply
User avatar
TheyCallMeTim13
Administration
Administration
Posts: 980
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 154
Contact:

[Lua] Timer

Post by TheyCallMeTim13 » Tue Apr 17, 2018 3:46 am

https://wiki.cheatengine.org/index.php? ... lass:Timer

Code: Select all

--------
-------- 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

Code: Select all

--------
-------- 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

Code: Select all

{$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 by TheyCallMeTim13 on Sat May 12, 2018 5:05 am, edited 4 times in total.

Post Reply

Who is online

Users browsing this forum: No registered users