Async able Countdown

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
S1N74X
Cheater
Cheater
Posts: 40
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Async able Countdown

Post by S1N74X »

For my current Project i have fiddlet togehter a callable Countdown which can be launched async.
Maybe it is usefull for someone.

Thanks @ShyTwig16 for the idea of a threaded approach

Code: Select all

{$lua}
if syntaxcheck then return end
[ENABLE]

local function asyncTimer(count,text)
    local start = os.clock()
    local current = 0
    while current < count do
    current = os.clock() - start
    --print(current)
    end
    speakEnglish(text)
	return true
end

function countDown(count,text)
 createThread(function(thread)
	if asyncTimer(count,text) then
    thread.Destroy()
	end
end)
end

countDown(30,'expired')

[DISABLE]

User avatar
LeFiXER
LeFixer
LeFixer
Posts: 489
Joined: Wed Mar 24, 2021 9:35 am
Reputation: 251

Re: Async able Countdown

Post by LeFiXER »

Good work! Although this should be in the Lua section.

S1N74X
Cheater
Cheater
Posts: 40
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Re: Async able Countdown

Post by S1N74X »

LeFiXER wrote:
Wed Jan 12, 2022 5:32 pm
Good work! Although this should be in the Lua section.
Thank you.
Oh ok, i read "Helpers" so i thought this will be the right Section :)
If it disturbs here an Admin can move the Topic maybe.

User avatar
LeFiXER
LeFixer
LeFixer
Posts: 489
Joined: Wed Mar 24, 2021 9:35 am
Reputation: 251

Re: Async able Countdown

Post by LeFiXER »

No harm done :)

Post Reply

Who is online

Users browsing this forum: No registered users