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 


Does CE have something like this/self for Lua in a script?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Profound_Darkness
Newbie cheater
Reputation: 0

Joined: 21 May 2015
Posts: 23

PostPosted: Fri Jun 12, 2015 7:44 pm    Post subject: Does CE have something like this/self for Lua in a script? Reply with quote

btw: I'm just learning Lua via Cheat Engine so...

I'm wondering if CE has something like this/self/me in to either get the ID, index, or simply MemoryRecord object of the record where the Lua code is running from.

This is what I'm looking at now:
Code:

//This entry is called "[Example]"
[ENABLE]
//bla bla, don't care
[DISABLE]
{$lua}
local myself = getAddressList().getMemoryRecordByDescription("[Example]")
--The above line is what I'm looking to replace...
deactivateChildren(myself)
{$asm}
//all the typical disable stuff...  Also don't care.


I haven't had much luck via Google nor skimming the source (via Google Code).

btw: deactivateChildren is recursive and so far seems to work just fine.

FYI - I want to deactivate ALL children of a script when the top script is deactivated as sub-scripts are reliant on work done by the main script and I want the memory to get freed up, etc.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Jun 12, 2015 8:08 pm    Post subject: Reply with quote

Right-click the parent script, Group config > (De)Activating this entry (de)activates children.

Also, copy (CTRL-C) the script you want and paste it into NotePad.
You can use the <ID>#</ID> to retrieve memory record by ID.
Back to top
View user's profile Send private message
Profound_Darkness
Newbie cheater
Reputation: 0

Joined: 21 May 2015
Posts: 23

PostPosted: Fri Jun 12, 2015 8:56 pm    Post subject: Reply with quote

Thanks much, if the ID is static as in doesn't change regardless of what I do to it (short of deletion), that would do nicely.

As for (De)Activating this entry (de)activates children option, tried it before going the Lua route and it also activates children and I only want to deactivate children. Thanks though.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Jun 13, 2015 1:39 am    Post subject: Reply with quote

the id is static yes, it won't change regardless of adding/removing entries before it, nor dragging it around to different positions

and next version activating/deactivating will be split up

_________________
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
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Sun Jun 14, 2015 6:44 pm    Post subject: Reply with quote

Dark Byte wrote:
the id is static yes, it won't change regardless of adding/removing entries before it, nor dragging it around to different positions

and next version activating/deactivating will be split up


Could the memory record id also send like syntaxcheck a lua 'global'(accessible from lua script inside the mr ) variable during activating/deactivating, and including in registered aa-command/prologue's 3rd parameters ?

Thank you~
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