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 


Closing messageDialog automatically

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Bricked-Wall
How do I cheat?
Reputation: 0

Joined: 30 Mar 2023
Posts: 6

PostPosted: Thu Apr 06, 2023 12:25 pm    Post subject: Closing messageDialog automatically Reply with quote

Hello! I'm using the following function:

Code:
messageDialog("Hack started Correctly")


However, I want the dialog to close automatically, without user input.

Thanks
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Thu Apr 06, 2023 1:30 pm    Post subject: Reply with quote

use a form with that text instead
_________________
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
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Thu Apr 06, 2023 4:06 pm    Post subject: Reply with quote

Use ..
Code:
function msgDialog(text,clsSec)
clsSec=tonumber(clsSec) * 5 -- newT.Interval x 5 =  1 sec
if newT then newT.Destroy() newT=nil end
newT=createTimer() newT.Interval=200 newT.Enabled=false
local clsIndex=0
local attrIndex1=250
local attrIndex2=10

if newDialog then newDialog.Destroy() newDialog=nil end
DP1=getScreenDPI()/96
newDialog=createForm(false)
newDialog.Position="poDesktopCenter"
newDialog.height=55*DP1 newDialog.width=410*DP1
newDialog.PopupMode=0 newDialog.BorderStyle="bsNone"  newDialog.ShowInTaskBar="stAlways"
newDialog.setLayeredAttributes(0x000100, 10, LWA_COLORKEY | LWA_ALPHA )
newDialog.Color=0x000100
-------------------------
pnl1=createPanel(newDialog)
pnl1.height=45*DP1 pnl1.width=400*DP1 pnl1.left=5*DP1 pnl1.top=5*DP1
pnl1.BevelWidth=4 pnl1.BevelColor=0x0000FF pnl1.Color=0xE0E0E0
----------------------- msg.lbl1 ----- 
lbl1=createLabel(pnl1)
lbl1.AutoSize=false
lbl1.height=35*DP1 lbl1.width=390*DP1 lbl1.left=5*DP1 lbl1.top=5*DP1
lbl1.caption=text lbl1.Font.Color=0x0000FF  lbl1.Font.Name="Lucida Fax"
lbl1.alignment="taCenter" lbl1.Font.Style="fsBold" lbl1.Font.Size=19*DP1
lbl1.OptimalFill=true
--------------------------------------
 newT.OnTimer=function()
  if clsIndex==clsSec then
   newT.Interval=100
    --print("clsIndex: "..clsIndex.."\nattrIndex1: "..attrIndex1)
    newDialog.setLayeredAttributes(0x000100, attrIndex1, LWA_COLORKEY | LWA_ALPHA )
    newDialog.Color=0x000100
     if attrIndex1==0 then
      if newDialog then newDialog.Destroy() newDialog=nil end
      if newT then newT.Destroy() newT=nil end
     else
      attrIndex1=tonumber(attrIndex1) - 10
     end
  else
   clsIndex=tonumber(clsIndex) + 1
    if attrIndex2~=250 then
      attrIndex2=tonumber(attrIndex2) + 30
       --print("clsIndex: "..clsIndex.."\nattrIndex2: "..attrIndex2)
      newDialog.setLayeredAttributes(0x000100, attrIndex2, LWA_COLORKEY | LWA_ALPHA )
      newDialog.Color=0x000100
    end
  end
 end
 newDialog.Show()
 newT.Enabled=true
end

-- use
--youTrainerName.CEButton1.OnClick=function()
--procesID = getProcessIDFromProcessName("youGame.exe")
--  if (procesID==nil) then
   msgDialog("Hack not started Correctly!",8) -- 8 sec visible ..
--   else
--   msgDialog("Everything is fine",8)
--  openProcess(procesID)
--   end
--end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past


Last edited by AylinCE on Sat Apr 08, 2023 8:19 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sat Apr 08, 2023 12:46 am    Post subject: Re: Closing messageDialog automatically Reply with quote

Bricked-Wall wrote:
Hello! I'm using the following function:

Code:
messageDialog("Hack started Correctly")


However, I want the dialog to close automatically, without user input.

Thanks


Just try run script below :

Code:
function customMB(title, texttoshow, time)
 local mf = createForm(false)
 mf.Caption = title
 mf.BorderStyle = 'bsDialog'
 mf.AutoSize = true
 mf.Position = 'poScreenCenter'
 local mlbl = createLabel(mf)
 mlbl.Caption = texttoshow
 mlbl.BorderSpacing.Around = 20
 local t=createTimer(mf)
 t.Interval = time
 t.OnTimer = function () mf.destroy() end
 mf.show()
end

customMB('Hack Checking', 'Hack started Correctly', 5000)

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
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