Page 1 of 1

Tool for Generating Lua On/Off Scripts for Cheat Engine AA Scripts

Posted: Thu Dec 12, 2024 7:16 am
by bbfox

This program is designed to help users generate Lua On/Off scripts for Cheat Engine's Auto Assembler (AA) scripts.
I often use this technique in my tables because, honestly, I'm lazy. However, maintaining these scripts becomes a hassle when the table gets outdated and needs to be renewed. So, I decided to spend some time writing a program to streamline the process.

I initially tried developing it directly in Cheat Engine's Lua environment, but debugging there was a pain to me (low lua skill), so I switched to another platform.

Here's how it works:

  1. Select a Cheat Engine Table File:

    • The program opens a file dialog allowing the user to select a .CT (Cheat Engine Table) file.
  2. Parse the XML File:

    • It reads the .CT file as XML and extracts entries with Auto Assembler Script or those with specific options (e.g., moHideChildren=1).
  3. Display a TreeView:

    • The program shows a TreeView UI for users to explore and select entries.
    • Each entry is displayed hierarchically based on its depth in the .CT source file.
    • A numeric selector allows users to control how many levels of the TreeView are expanded.
      Spoiler

      Image

  4. Generate Lua Scripts:

    • Based on the selected entries, the program generates two Lua script sections:
      • [ENABLE]: Activates the selected entries in ascending order of their hierarchy.
      • [DISABLE]: Deactivates all entries (irrespective of user selection) in reverse hierarchical order.
    • The Lua script includes comments with metadata (ID, description, and depth) for each entry.
      Spoiler

      Image


Paste the generated AA script into Cheat Engine. It will activate scripts based on your selection and disable all scripts from the tree, starting from the leaf nodes up to the root, when this AA is turned off. Make sure to exclude this AA script itself.
Below is a screenshot example (with "Execute asynchronous" checked).
Image



Developed using .NET Framework 4.8 (Windows platform only)

Old releases

Spoiler
AAToggleGenerator.zip
Password: oct; fixed memory leak and add some checks
(1.25 MiB) Downloaded 82 times
AAToggleGenerator.zip
Password: oct; added "addressList.refresh()" (make CE UI reflect changes immediately)
(1.25 MiB) Downloaded 306 times
AAToggleGenerator.zip
Password: oct; revised for thread-safe (CE 7.6)
(1.25 MiB) Downloaded 309 times
AAToggleGenerator-1218.zip
Password: oct; added ID renumbering in this application. Remember to reload table in CE after re-number.
(1.25 MiB) Downloaded 274 times
AAToggleGenerator.zip
Password: oct
(1.25 MiB) Downloaded 324 times

Re: Tool for Generating Lua On/Off Scripts for Cheat Engine AA Scripts – Streamline Your Workflow

Posted: Thu Dec 12, 2024 7:48 am
by Rienfleche

do you play front mission 2nd, Lost Eidolons & MONARK?
i love those games but so few make tables for that game