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 


Why caption change not showing or Skipped?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Bit Byte
Advanced Cheater
Reputation: 0

Joined: 28 Nov 2022
Posts: 62

PostPosted: Thu Aug 31, 2023 8:26 am    Post subject: Why caption change not showing or Skipped? Reply with quote

I have attached 2 images.
In both case everything executes to the end but skips over some, I cant understand why.

In the function checkUserKey() if or else block executes and shows the correct
Ufrm1.Ulbl2.caption=
Which shows that it does execute to the end, but it does not show the change to Ufrm1.Ulbl2.caption occuring before this if block which is marked in image.

In the VipTimer1.OnTimer=function() the last line startMyTrainer() executes because my trainer opens.
Which shows that it does execute to the end, but it does not show the change to Ufrm1.Ulbl2.caption occuring before this which is marked in image.

Can anyone explain why?



Skipped 2.jpg
 Description:
 Filesize:  113.14 KB
 Viewed:  1373 Time(s)

Skipped 2.jpg



Skipped.jpg
 Description:
 Filesize:  130.3 KB
 Viewed:  1373 Time(s)

Skipped.jpg


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

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

PostPosted: Thu Aug 31, 2023 8:35 am    Post subject: Reply with quote

debug tip: add prints before and after and see if those get executed

skipped.jpg: GUI updates only happen outside of functions (unless you explicitly call processMessages)
So the first update is replaced by one of the 2 results before it gets drawn

skipped2.jpg: The form is destroyed before the updated text is shown to the user

_________________
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
Bit Byte
Advanced Cheater
Reputation: 0

Joined: 28 Nov 2022
Posts: 62

PostPosted: Thu Aug 31, 2023 9:53 am    Post subject: Reply with quote

Thank you @ Dark Byte for your answer
The prints before and after show that they get exeecuted..attached image.

skipped.jpg: Aren't one of the 2 results that get GUI drawn also inside the function?

I cant find processMessages in celua documention examples on how to use it

skipped2.jpg: The form is destroyed in the startMyTrainer() function but that function is called after
Ufrm1.Ulbl2.caption="Validation check Successful.\nStarting Trainer..!"
So it should get drawn before the Ufrm1.destroy() shouldn't it?
Am I missing something?



PrintOutput.jpg
 Description:
 Filesize:  235.78 KB
 Viewed:  1360 Time(s)

PrintOutput.jpg


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

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

PostPosted: Thu Aug 31, 2023 2:45 pm    Post subject: Reply with quote

Quote:

skipped.jpg: Aren't one of the 2 results that get GUI drawn also inside the function?

Immediately after setting the string you set it either to "userid is valid" or "You are not a registered user"

Quote:

skipped2.jpg: The form is destroyed in the startMyTrainer() function but that function is called after
Ufrm1.Ulbl2.caption="Validation check Successful.\nStarting Trainer..!"
So it should get drawn before the Ufrm1.destroy() shouldn't it?

No, the form won't update until the function exits
So you set the caption, then startMyTrainer and then destroy it. So there's nothing to update

sleep() also won't trigger an update as the function still doesn't exit

What you can do is use a timer, or use processMessages() but keep in mind that also allows the user to click buttons

_________________
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
Bit Byte
Advanced Cheater
Reputation: 0

Joined: 28 Nov 2022
Posts: 62

PostPosted: Mon Sep 04, 2023 6:05 am    Post subject: Reply with quote

I couldn't find how to implement processMessages().
So I made a MsgDisplay() function and call it from the timer function.
It now works and shows the two Messages that weren't showing up on GUI previously, probably not the most efficient way though...

Code:
function MsgDisplay()
VipTimer1.Enabled=false
  if loadIndex==6 then
       Ufrm1.Ulbl2.caption="Please wait\nChecking User ID"
       VipTimer1.Enabled=true
  end
  if loadIndex==12 then
       Ufrm1.Ulbl2.caption="Validation check Successful.\nStarting Trainer..!"
       VipTimer1.Enabled=true
  end
end


function startMyTrainer()
   if VipTimer1 then VipTimer1.Destroy() VipTimer1=nil end
   if Ufrm1 then Ufrm1.Destroy() Ufrm1=nil end
   CETrainer.show()
end


VipTimer1.OnTimer=function()
  loadIndex=tonumber(loadIndex) + 1
  if loadIndex==3 then
     checkVersion()
  end
  if loadIndex==6 then
     MsgDisplay()
  end
  if loadIndex==9 then
     checkUserKey()
  end
  if loadIndex==12 then
     MsgDisplay()
  end
  if loadIndex==15 then
     VipTimer1.Enabled=false
     startMyTrainer()
  end


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