lua scripts will not mark item as locked (mark as "X") after execute

A forum dedicated to use and support LUA for Cheat Engine.


Post Reply
User avatar
bbfox
Table Master
Table Master
Journeyman Hacker
Journeyman Hacker
Posts: 183
Joined: Sat Jul 23, 2022 8:59 am
Answers: 0
x 404

lua scripts will not mark item as locked (mark as "X") after execute

Post by bbfox »

This script will make lua scripts will not be checked ("mark as X") after script executed. Used for executing a lua script without [DISABLE] section.

Original discussion in OCT.org; I did not remember who answered my question.

  1. Step 1: Place this code piece in Cheat table lua script

    Code: Select all

    --lua scripts that table checkbox will not be checked with "NO_ACTIVATE" in comment
    function onMemRecPostExecute(memoryrecord, newState, succeeded )
        if memoryrecord.Type == vtAutoAssembler and memoryrecord.Script:find("NO_ACTIVATE") and newState and succeeded then
            memoryrecord.disableWithoutExecute()
        end
    end
  2. Step 2: in lua script, place a comment "NO_ACTIVATE" in script. i.e. below script will print a message and keep item unchecked (unlock)

    Code: Select all

    [ENABLE]
    {$lua}
    --NO_ACTIVATE
    if syntaxcheck then return end
    print('Hello World!')
     
    {$asm}
    [DISABLE]
    
    

I create tables to suit my preferences. Table is free to use, but need to leave the author's name and source URL: https://opencheattables.com.
Table will not be up-to-date. Feel free to modify it, but kindly provide credit to the source.


User avatar
J1327
Donor
Donor
Novice Hacker
Novice Hacker
Posts: 43
Joined: Mon Jul 25, 2022 5:00 pm
Answers: 0
Location: Baltic States
x 48

Re: lua scripts will not mark item as locked (mark as "X") after execute

Post by J1327 »

..or..alternatively you can use in AA: test al,al

example:

Code: Select all

[ENABLE]
{$lua}
if syntaxcheck then return end
print('Hello World!')
{$asm}
test al,al
[DISABLE]

🙃
Ṯ̸͋͠H̷̻́Ē̵̦̇R̴̛̠̞̾E̷̥̗̎̾ ̷̩̽̂Ì̵̱S̵̲͘ ̷̝̝̽͆S̵̯̒T̷̩͈̃͑Î̶̯̟Ļ̴̬̈L̴̘̱̏̒ ̵̨̟̈́͠T̵͓͎͐I̶̥͈̽M̷̡̛͒E̶͙͗


User avatar
imjustmaxie
Curious
Curious
Posts: 5
Joined: Thu Apr 06, 2023 4:34 am
Answers: 0
x 10

Re: lua scripts will not mark item as locked (mark as "X") after execute

Post by imjustmaxie »

My method might be unorthodox, but what I typically do is this:

Code: Select all

{$LUA}
if syntaxcheck then return end
--insert code here
[enable]
error()
[disable]

Post Reply