[LUA] Auto close message box, without freezing CE

Upload *YOUR* gamehacking tools/helpers here
Post Reply
User avatar
YoucefHam
Expert Cheater
Expert Cheater
Posts: 92
Joined: Sun Jan 21, 2018 10:21 pm
Reputation: 209

[LUA] Auto close message box, without freezing CE

Post by YoucefHam »

Auto close message box after amount of time, without freezing CE

Code: Select all

local function ShowAutoMessage(TXT,DELAY)
	local DELAY = DELAY or 2 --Default Delay
	local StartTime = os.clock()
	local function Thread(thread,DELAY)
		while os.clock() - StartTime < DELAY do sleep(0) end
		doKeyPress(VK_ESCAPE)
		thread.terminate()
	end
	createThread(Thread,DELAY)
	ShowMessage(TXT)
end
ShowAutoMessage('Close after 2 seconds')
ShowAutoMessage('Close after 5 seconds',5)

Post Reply

Who is online

Users browsing this forum: No registered users