 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
User100 Newbie cheater
Reputation: 0
Joined: 10 Nov 2018 Posts: 14
|
Posted: Sun Nov 25, 2018 10:00 am Post subject: Looking for a way to pause engine (Sleep doesn't do it) |
|
|
I'm trying to update the caption on a control element, right before I do a memory scan. Unfortunately, the engine is so fast, that it ties itself up with the scan right away, and the caption is never updated (until it's all over).
I tried to put a Sleep command before it (even as long as 1 sec), but that didn't help.
Is there any other way to tell the engine to take a little breather?
| Code: | function CEButton1Click(sender)
control_setCaption(CETrainer_CEEdit1, "searching") -- never shows up
Sleep(1000) -- doesn't help
print("start")
ms=createMemScan()
memscan_firstScan(ms, soValueBetween, vtSingle, rtRounded, 0, 10000, 0x00000000, 0x00007fffffffffff, "", fsmNotAligned, "", false, false, false, false)
memscan_waitTillDone(ms)
fl=createFoundList(ms)
foundlist_initialize(fl)
count=foundlist_getCount(fl)
object_destroy(fl)
object_destroy(ms)
print("done, "..count.." matches")
control_setCaption(CETrainer_CEEdit1, "done") -- never shows up
Sleep(2000)
control_setCaption(CETrainer_CEEdit1, "-") -- this is the only update shown
end
|
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4711
|
Posted: Sun Nov 25, 2018 10:56 am Post subject: |
|
|
Lua still has control over the main thread. You have to explicitly tell CE to process GUI messages.
| Code: | CETrainer.STARTPOS.Caption = 'Searching...'
processMessages()
local ms = createMemScan()
ms.firstScan(soValueBetween, vtSingle, rtRounded, startXmin, startXmax, 0x00000000, 0x00007fffffffffff, '', fsmNotAligned, '', false, false, false, false)
ms.waitTillDone() |
You could also use OnScanDone or wait in a separate thread.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
User100 Newbie cheater
Reputation: 0
Joined: 10 Nov 2018 Posts: 14
|
Posted: Sun Nov 25, 2018 11:33 am Post subject: |
|
|
Ah, yes... That's what I needed.
processMessages() is doing exactly what I was looking for.
Thanks a bunch!
|
|
| Back to top |
|
 |
|
|
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
|
|