Not allow user to lock value (not allow to mark items as 'X')

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: 425
Joined: Sat Jul 23, 2022 8:59 am
Answers: 0
x 915

Not allow user to lock value (not allow to mark items as 'X')

Post by bbfox »

This script will force table item(s) cannot be "locked". i.e. you don't want user to lock a value.
Image

Original discussion from OCT.org:

Code: Select all

--memory record IDs now allowed to be 'locked'
-- IDs: list of ID found in .CT file:
-- <CheatEntry>
--      <ID>2218</ID>  <--- Here

-- Memory record IDs now allowed to be 'locked'
IDs = {999999, 9999999}

-- Determine event trigger sequence
if not contains then
    function contains(table, val)
       for i = 1, #table do
          if table[i] == val then
             return true
          end
       end
       return false
    end
end

if not onMemRecPreExecute then
    function onMemRecPreExecute(memoryrecord, newstate)
        if contains(IDs, memoryrecord.ID) and newstate then
            synchronize(function()
                if not memoryrecord.OnActivate then
                    memoryrecord.OnActivate = function(memoryrecord, before, currentstate)
                        return false
                    end
                end
            end)
        end
    end
end

May use AI for assistance. Don't use it if you have any concern. Free to modify it but leave credit. Table is free, just leave the author's name and source URL.
Tip me a coffee? https://ko-fi.com/bbfoxmodding


Post Reply