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 


Lua error

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 510

PostPosted: Mon Aug 30, 2021 4:18 am    Post subject: Lua error Reply with quote

I've got error:
You can not use while process is frozen
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Aug 30, 2021 4:49 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 510

PostPosted: Mon Aug 30, 2021 4:53 am    Post subject: Reply with quote

When creating new thread where inside function loop functions (repeat,while etc.)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Aug 30, 2021 5:21 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 510

PostPosted: Mon Aug 30, 2021 6:52 am    Post subject: Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Aug 30, 2021 7:00 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 510

PostPosted: Mon Aug 30, 2021 7:02 am    Post subject: Reply with quote

So instead of creating thread, i need to use timer?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Aug 30, 2021 7:11 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 510

PostPosted: Mon Aug 30, 2021 7:12 am    Post subject: Reply with quote

ok i got it,thx
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