Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to close a messagebox in Lua?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Thu Feb 25, 2016 10:17 am    Post subject: How to close a messagebox in Lua? Reply with quote

I would like to close a messagebox in Lua, something like this:
Code:

showMessage("test")
sleep(1000)
closeMessagebox   <-----------something like that, which closes the "test" message box


I couldn't find anything related in the main.lua.
Thanks in advance.

Edit: Does showMessage return a form? I dont think so, but im not sure.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 460

Joined: 09 May 2003
Posts: 25363
Location: The netherlands

PostPosted: Thu Feb 25, 2016 10:42 am    Post subject: Reply with quote

the showMessage function does not return (won't execute the following code) until the dialog is closed.
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Thu Feb 25, 2016 10:44 am    Post subject: Reply with quote

Dark Byte wrote:
the showMessage function does not return (won't execute the following code) until the dialog is closed.


Thanks for the reply. So, are there other ways to make a message just show up for a limited amount of time?

BTW, where can I find the newest syntax for cheat engine lua? Is it in the main.lua? Thank you.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Thu Feb 25, 2016 11:06 am    Post subject: Reply with quote

Code:
function myShowMessage(title, texttoshow, time)
 local myform = createForm(false)
 myform.Caption = title
 myform.BorderStyle = 'bsDialog'
 myform.AutoSize = true
 myform.Position = 'poScreenCenter'

 local mylabel = createLabel(myform)
 mylabel.Caption = texttoshow
 mylabel.BorderSpacing.Around = 20

 local t=createTimer(myform)
 t.Interval = time
 t.OnTimer = function () myform.destroy() end

 myform.show()

end


myShowMessage('Warning', 'Something something, lorem ipsum dolor sit amet', 5000)

_________________
Back to top
View user's profile Send private message MSN Messenger
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Thu Feb 25, 2016 11:09 am    Post subject: Reply with quote

mgr.inz.Player wrote:
Code:
function myShowMessage(title, texttoshow, time)
 local myform = createForm(false)
 myform.Caption = title
 myform.BorderStyle = 'bsDialog'
 myform.AutoSize = true
 myform.Position = 'poScreenCenter'

 local mylabel = createLabel(myform)
 mylabel.Caption = texttoshow
 mylabel.BorderSpacing.Around = 20

 local t=createTimer(myform)
 t.Interval = time
 t.OnTimer = function () myform.destroy() end

 myform.show()

end


myShowMessage('Warning', 'Something something, lorem ipsum dolor sit amet', 5000)


OMG, you are so great! Thanks a lot!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites