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 


The Thread Class.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Sat Jun 10, 2017 6:00 pm    Post subject: The Thread Class. Reply with quote

Code:

function TestThread1(self)
   print("ok1")
end


function CEButton2Click(sender)
    thread1 = createNativeThread(TestThread1)
end


I use the code above to create a thread and do some heavy work. The code worked at the beginning, then I went on to write some other codes that were not related at all. Then , the thread code just didn't work anymore. So, I replace all the code with a single print function in TestThread1, and it doesn't get triggered. Sad

What's the problem? What can prevent the thread class from working?
PS: I tried createThread, same result. I also read the tutorial on thread class, but the problem exists.

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Sat Jun 10, 2017 7:39 pm    Post subject: Reply with quote

With CE 6.7, just tested the following and it works fine:
Code:

function ThreadCallback(self)
    print('Thread was called.');
end
createNativeThread(ThreadCallback);

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Sat Jun 10, 2017 7:44 pm    Post subject: Reply with quote

atom0s wrote:
With CE 6.7, just tested the following and it works fine:
Code:

function ThreadCallback(self)
    print('Thread was called.');
end
createNativeThread(ThreadCallback);


It's weird, it is working for me now..... Don't know what really happened. O_O

Maybe it's because I get rid of "thread1=", or maybe because I restarted my CE...

Thanks anyway, atom0s.

_________________
**************

A simple example is better then ten links. Very Happy
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 Lua Scripting 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