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 


luaCode activates memrec but not its timers

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Autem
Expert Cheater
Reputation: 1

Joined: 30 Jan 2023
Posts: 156

PostPosted: Sat Nov 04, 2023 3:22 am    Post subject: luaCode activates memrec but not its timers Reply with quote

I have a script called "Mextend" that works as expected with timers when I check it manually and it deactivates itself a few seconds later. When I use luaCode in another AA script to activate the Mextend script, its timers don't trigger and it stays activated forever. I'm guessing the issue is in the way I am writing the luaCode section in the AA script. What's the trick to executing the lua inside of Mextend in this type of code?:
{$luaCode}
getAddressList().getMemoryRecordByDescription('Mextend').Active=true
{$asm}

Also, if I use that line in the Lue Engine to test it, it successfully activates Mextend and everything works correctly. It's ONLY failing when triggered from within another AA script for some reason.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Nov 04, 2023 4:31 am    Post subject: Reply with quote

luacode runs asynchronous from the main thread by default
that means GUI access is not allowed/buggy

you first have to synchronize with the GUI before you can access it, so try this:
Code:

{$luaCode}
synchronize(function() 
  getAddressList().getMemoryRecordByDescription('Mextend').Active=true
end)
{$asm}

_________________
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
Autem
Expert Cheater
Reputation: 1

Joined: 30 Jan 2023
Posts: 156

PostPosted: Sat Nov 04, 2023 5:35 am    Post subject: Reply with quote

Worked perfectly, thanks!
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