View previous topic :: View next topic |
Author |
Message |
Bit Byte Advanced Cheater
Reputation: 0
Joined: 28 Nov 2022 Posts: 62
|
Posted: Thu Aug 31, 2023 8:26 am Post subject: Why caption change not showing or Skipped? |
|
|
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?
Description: |
|
Filesize: |
113.14 KB |
Viewed: |
1373 Time(s) |

|
Description: |
|
Filesize: |
130.3 KB |
Viewed: |
1373 Time(s) |

|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Thu Aug 31, 2023 8:35 am Post subject: |
|
|
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 |
|
 |
Bit Byte Advanced Cheater
Reputation: 0
Joined: 28 Nov 2022 Posts: 62
|
Posted: Thu Aug 31, 2023 9:53 am Post subject: |
|
|
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?
Description: |
|
Filesize: |
235.78 KB |
Viewed: |
1360 Time(s) |

|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Thu Aug 31, 2023 2:45 pm Post subject: |
|
|
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 |
|
 |
Bit Byte Advanced Cheater
Reputation: 0
Joined: 28 Nov 2022 Posts: 62
|
Posted: Mon Sep 04, 2023 6:05 am Post subject: |
|
|
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 |
|
 |
|