| View previous topic :: View next topic |
| Author |
Message |
Frouk Grandmaster Cheater
Reputation: 5
Joined: 22 Jun 2021 Posts: 510
|
Posted: Mon Aug 30, 2021 4:18 am Post subject: Lua error |
|
|
I've got error:
You can not use while process is frozen
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25833 Location: The netherlands
|
Posted: Mon Aug 30, 2021 4:49 am Post subject: |
|
|
when does it show that ? When using any mono functions? Because that's normal. It can't work when the target is suspended
_________________
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 |
|
 |
Frouk Grandmaster Cheater
Reputation: 5
Joined: 22 Jun 2021 Posts: 510
|
Posted: Mon Aug 30, 2021 4:53 am Post subject: |
|
|
| When creating new thread where inside function loop functions (repeat,while etc.)
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25833 Location: The netherlands
|
Posted: Mon Aug 30, 2021 5:21 am Post subject: |
|
|
I don't quite understand what you're talking about.
Do you suspend a process, and then create a thread in the target process with while loops?
Or are you saying that Cheat Engine freezes when you use while loops ?
If the second, that's normal. do not use infinite while loops inside the main thread, and do not access GUI controls from a thread without synchronize. (and synchronize only works when the main GUI thread is not frozen)
you can do things like this though:
| Code: |
shouldStop=false
local counter=0
function somethread(t)
while shouldStop==false do
counter=counter+1
sleep(0) --this sleep is important (else the CS doesn't get released)
end
end
createThread(somethread)
createThread(somethread)
createThread(somethread)
print(counter)
sleep(10)
print(counter)
sleep(10)
print(counter)
shouldStop=true
sleep(10)
print(counter)
sleep(10)
print(counter)
sleep(10)
print(counter)
|
_________________
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 |
|
 |
Frouk Grandmaster Cheater
Reputation: 5
Joined: 22 Jun 2021 Posts: 510
|
Posted: Mon Aug 30, 2021 6:52 am Post subject: |
|
|
CE freezes when i use while loop, if i create thread where while loop is enabled,CE isn't freezing
Error appears even if process isn't suspended
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25833 Location: The netherlands
|
Posted: Mon Aug 30, 2021 7:00 am Post subject: |
|
|
yeah, don't use while loop in the main GUI thread if it's going to take a long time.
_________________
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 |
|
 |
Frouk Grandmaster Cheater
Reputation: 5
Joined: 22 Jun 2021 Posts: 510
|
Posted: Mon Aug 30, 2021 7:02 am Post subject: |
|
|
| So instead of creating thread, i need to use timer?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25833 Location: The netherlands
|
Posted: Mon Aug 30, 2021 7:11 am Post subject: |
|
|
creating a thread is fine, you can call your loop code in there, but if you intent on accessing the GUI use a synchronize() call , but don't do a while in there
and a timer is always fine as well
_________________
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 |
|
 |
Frouk Grandmaster Cheater
Reputation: 5
Joined: 22 Jun 2021 Posts: 510
|
Posted: Mon Aug 30, 2021 7:12 am Post subject: |
|
|
| ok i got it,thx
|
|
| Back to top |
|
 |
|