How to Automatically Enable Cheat Engine Scripts After Attaching to a Game

Opening a Cheat Engine table can become surprisingly repetitive. You open the table. You attach Cheat Engine to the game. Then you manually tick the same few scripts every single time:

  • Enable
  • Player Base
  • Unlimited Stamina
  • Maybe some helper script with a wonderfully descriptive name like INIT

If you already use our Cheat Engine auto-attach setup, you have eliminated the first annoying step. Now we can eliminate the second.

With a small Lua script, Cheat Engine can automatically activate selected records after attaching to the game. This is especially useful for helper scripts that your table always needs before anything else works.

Before You Start

This guide assumes you already know how to use a basic Cheat Engine table. If not, start with our Cheat Engine beginner’s guide. You should also already have one or more working records in your table.

For example:

Enable
Player Base
Unlimited Stamina
Infinite Ammo

The important thing is that each record has a clear Description, because we are going to use those names from Lua.

The Basic Auto-Enable Script

Press: Ctrl + Alt + L to open the Cheat Table Lua Script window. Then add something like this:

local addressList = getAddressList()
local record = addressList.getMemoryRecordByDescription("Enable")
if record then
 record.Active = true
end

Replace:

Enable

with the description of the record you want to activate automatically.

For example:

local addressList = getAddressList()
local record = addressList.getMemoryRecordByDescription("Unlimited Stamina")
if record then
 record.Active = true
end

When this code runs, Cheat Engine searches the table for a record called Unlimited Stamina and activates it.

Conceptually, it is doing the same thing you normally do by clicking the checkbox. Except Lua does not sigh before doing repetitive work.

Why the if record then Part Matters

You could technically try to activate the record directly.

But this:

if record then
 record.Active = true
end

adds a simple safety check.

If Cheat Engine cannot find a record with that description, it does nothing rather than immediately trying to operate on something that does not exist. This becomes useful if you rename or delete an entry later.

Your table changes. Your six-month-old Lua script does not receive the memo.

Automatically Enable Several Scripts

More realistically, you may have several helper records that should always be enabled.

Instead of repeating the same code manually, create a list:

local scriptsToEnable = {
 "Enable",
 "Player Base",
 "Unlimited Stamina"
}
local addressList = getAddressList()
for _, description in ipairs(scriptsToEnable) do
 local record = addressList.getMemoryRecordByDescription(description)
 if record then
 record.Active = true
 end
end

Now the main part you need to edit is:

local scriptsToEnable = {
 "Enable",
 "Player Base",
 "Unlimited Stamina"
}

Want to add another script? Just add another line:

local scriptsToEnable = {
 "Enable",
 "Player Base",
 "Unlimited Stamina",
 "Infinite Ammo"
}

This makes the template much easier to reuse across different cheat tables.

But There Is One Problem: Timing

There is an important catch. Some Cheat Engine scripts cannot be activated immediately after the process is detected.

Why?

Because the game may technically be running while:

  • Its modules are still loading
  • Your AOB pattern is not available yet
  • The player object does not exist
  • The game is still sitting on the title screen
  • A pointer chain has not become valid

If you try to activate a dependent script too early, it may simply fail. This is especially common with tables where: Enable

must run before: Player Base

which must run before: Unlimited Stamina

Congratulations. Your cheat table now has dependencies. You have accidentally reinvented enterprise software.

Adding a Short Delay

For simple tables, one practical solution is to wait briefly after attachment before activating the scripts.

For example:

local scriptsToEnable = {
 "Enable",
 "Player Base",
 "Unlimited Stamina"
}
function enableSelectedScripts()
 local addressList = getAddressList()
 for _, description in ipairs(scriptsToEnable) do
 local record = addressList.getMemoryRecordByDescription(description)
 if record then
 record.Active = true
 end
 end
end
function onOpenProcess(processID)
 local timer = createTimer(nil)
 timer.Interval = 2000
 timer.OnTimer = function(timer)
 timer.destroy()
 enableSelectedScripts()
 end
end

This waits roughly two seconds after Cheat Engine opens the process, then activates the selected records.

You can adjust:

timer.Interval = 2000

The number is measured in milliseconds.

So:

1000 = 1 second
2000 = 2 seconds
5000 = 5 seconds

For many simple tables, two or three seconds is enough. For games with lengthy loading sequences, it may not be.

Delay Is Not the Same as Readiness

This is worth emphasizing. Waiting five seconds does not guarantee that the game is ready.

A player-related script may still fail if you are sitting on the main menu because the player object has not been created yet. A better-designed table may therefore auto-enable only its basic initialization script and leave gameplay-dependent records for the user.

For example:

local scriptsToEnable = {
 "Enable",
 "AOB Initialization"
}

Then you manually activate:

Player Health
Infinite Ammo
Character Stats

after loading the game. Automation is useful. Blind optimism is not.

Do Not Auto-Enable Everything

It can be tempting to make the table automatically activate every cheat.

You open the game and immediately receive:

  • Infinite health
  • Infinite stamina
  • Infinite ammo
  • Super speed
  • One-hit kill
  • No collision
  • 800× experience
  • Your character briefly entering another dimension

That is usually unnecessary.

I would reserve auto-enable for things such as:

  • Main Enable scripts
  • AOB initialization
  • Player-base finders
  • Pointer initialization
  • Required helper scripts
  • Quality-of-life options you always use

Be more careful with cheats that directly alter gameplay or game state. For example, automatically enabling One Hit Kill before the game finishes loading may be perfectly fine.

Or perhaps the title-screen butterfly now has zero health. You are exploring undocumented behaviour at that point.

Auto-Attach + Auto-Enable

This becomes particularly convenient when combined with the automatic Cheat Engine attachment script.

Your workflow can become:

  1. Open the .CT file.
  2. Launch the game.
  3. Cheat Engine automatically attaches.
  4. Wait a short moment.
  5. Required helper scripts activate automatically.
  6. Start playing.

At that point, opening a cheat table begins to feel much closer to launching a proper trainer rather than manually preparing a laboratory experiment every time.

A Reusable Version

For most personal tables, this is the template worth keeping:

local scriptsToEnable = {
 "Enable",
 "Player Base"
}
function enableSelectedScripts()
 local addressList = getAddressList()
 for _, description in ipairs(scriptsToEnable) do
 local record = addressList.getMemoryRecordByDescription(description)
 if record then
 record.Active = true
 end
 end
end
function onOpenProcess(processID)
 local timer = createTimer(nil)
 timer.Interval = 2000
 timer.OnTimer = function(timer)
 timer.destroy()
 enableSelectedScripts()
 end
end

Most of the time, you only need to change:

local scriptsToEnable = {
 "Enable",
 "Player Base"
}

and possibly:

timer.Interval = 2000

That is considerably easier than rebuilding the logic for every new table.

Final Thoughts

Automatically enabling Cheat Engine records is not particularly glamorous. It does not discover hidden values. It does not inject assembly code. It does not give your character a sword with enough damage to create accounting problems for the final boss.

It simply removes another repetitive step. But when paired with auto-attach, it can make regularly used cheat tables much nicer to work with.

Open the table. Launch the game. Let Cheat Engine handle the boring parts. Which, considering that we invented computers specifically to handle boring parts, seems only fair.

Yabes Elia

Yabes Elia

An empath, a jolly writer, a patient reader & listener, a data observer, and a stoic mentor