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 


moAllowManualCollapseAndExpand is not working

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
attikaintheworld
How do I cheat?
Reputation: 0

Joined: 10 Oct 2022
Posts: 3
Location: EU

PostPosted: Sun Sep 21, 2025 6:53 am    Post subject: moAllowManualCollapseAndExpand is not working Reply with quote

Clicking on top level table activates/deactivates children as expected but children can still be manually toggled. I would expect moAllowManualCollapseAndExpand="0" is for prohibiting manual expansion.

Code:

?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="42">
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"A"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$lua}
        [ENABLE]
          getAddressList().getMemoryRecordByDescription("B").active=true
          getAddressList().getMemoryRecordByDescription("C").active=true
        [DISABLE]
          getAddressList().getMemoryRecordByDescription("B").active=false
          getAddressList().getMemoryRecordByDescription("C").active=false
      </AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>1</ID>
          <Description>"B"</Description>
          <GroupHeader>1</GroupHeader>
          <Options moAllowManualCollapseAndExpand="0"/>
        </CheatEntry>
        <CheatEntry>
          <ID>2</ID>
          <Description>"C"</Description>
          <Options moAllowManualCollapseAndExpand="0"/>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{$lua}
            [ENABLE]
              print("C enabled")
            [DISABLE]
              print("C disabled")
          </AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
</CheatTable>


I would like to move some core codes into separate tables and those would be dependencies of other tables so I want to prohibit deactivating and hence destroying them manually.

Bonus question. Can I include/import lua script in <AssemblerScript>

What is the recommended way of organizing code in case there are feature, utility, core codes?

_________________
not sure I am not too old for this
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Mon Sep 22, 2025 12:32 am    Post subject: Reply with quote

moAllowManualCollapseAndExpand allows you to manually collapse / expand child memory records with the left / right arrow keys respectively. It has nothing to do with how AA scripts are activated.
It's disabled (0) by default. Enabling it on the memory records `B` and `C` wouldn't do anything since they don't have any children.

Most people have the group configs "Hide children when deactivated" and maybe "Deactivating this entry deactivates its children" set on a parent memory record and call that good enough. If a user changes group configs and starts screwing with stuff, it's their fault if they mess it up.

`globalalloc` can help with storing addresses since that'll never be deallocated if the parent script is disabled without disabling children.

attikaintheworld wrote:
Can I include/import lua script in <AssemblerScript>
Use a {$lua} block like you already are. CE uses a single Lua state everywhere unless explicitly stated otherwise, so globals defined in the main Lua script are accessible everywhere. Remember to execute the main script.
attikaintheworld wrote:
What is the recommended way of organizing code in case there are feature, utility, core codes?
Depends on what you mean by "feature, utility, core codes."
Most people use parent AA scripts w/ hidden-when-deactivated children if you need an address copied from some other injection point.
Call Lua functions defined in the main Lua script for more general purposes. There are also indirect methods: e.g. registerAutoAssemblerCommand, but {$lua} blocks are usually easier.

Edit: you're missing `if syntaxcheck then return end` at the top of each {$lua} block

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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