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 


Can't get the pointer checkbox tick for header.....

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

Joined: 18 Feb 2024
Posts: 9

PostPosted: Sun Nov 17, 2024 9:30 pm    Post subject: Can't get the pointer checkbox tick for header..... Reply with quote

Code:

{$lua}
[ENABLE]
-- lua code
-- Target pointer
local newPointer = "EEMEM"

-- Function to update only group header (parent) pointers
function updateGroupHeaderPointer(groupDescription)
    local addressList = getAddressList()
    local memrec = nil

    -- Search for the memory record with the given description
    for i = 0, addressList.Count - 1 do
        if addressList[i].Description == groupDescription then
            memrec = addressList[i]
            break
        end
    end

    -- Check if the group was found
    if not memrec then
        -- Removed pop-up message
        -- showMessage("Group not found: " .. groupDescription)
        return
    end

    -- Ensure the record is a group header (parent pointer)
    if memrec.isGroupHeader then
        -- Update the pointer's base address
        memrec.Address = newPointer
        memrec.IsPointer = true
        -- Removed pop-up message
        -- showMessage("Group header pointer updated for: " .. groupDescription .. " to " .. newPointer)
    else
        -- If it's not a group header, log the type (you may want to keep this)
        -- showMessage("The selected record is not a group header: " .. groupDescription ..
        --             " (Type: " .. memrec.Type .. ")")
    end
end

-- Execute the function for each group
local groups = {
    "B License",
    "A License",
    "IB License",
    "IA License",
    "Super License",
    "Coffee Break",
    "Driving Mission"
}

for _, group in ipairs(groups) do
    updateGroupHeaderPointer(group)
end

[DISABLE]
-- lua code
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4696

PostPosted: Mon Nov 18, 2024 11:50 am    Post subject: Reply with quote

Put `if syntaxcheck then return end` at the top of every {$lua} block in an AA script unless you have good reason to do otherwise.

Use AddressList.getMemoryRecordByDescription.

Memory records have both IsGroupHeader and IsAddressGroupHeader properties. IsAddressGroupHeader implies IsGroupHeader, but the converse is not true in general. You should check IsAddressGroupHeader instead, or set it to true yourself.

`IsPointer` isn't a valid property.
Example:
Code:
local mr = AddressList.createMemoryRecord()
mr.Description = 'Example Pointer Header'
mr.IsAddressGroupHeader = true
mr.setAddress('game.exe+1234', { 0x5C, 0x38 })

_________________
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
nirvada
How do I cheat?
Reputation: 0

Joined: 18 Feb 2024
Posts: 9

PostPosted: Mon Nov 18, 2024 7:05 pm    Post subject: Reply with quote

Code:

{$lua}
if syntaxcheck then return end

[ENABLE]
local newPointer = "EEMEM"

function updateGroupHeaderPointer(groupDescription)
    local addressList = getAddressList()
    local memrec = addressList.getMemoryRecordByDescription(groupDescription)

    if memrec.IsAddressGroupHeader then
        memrec.Address = newPointer
        memrec.IsPointer = true
    end
end

local groups = {
    "B License",
    "A License",
    "IB License",
    "IA License",
    "Super License",
    "Coffee Break",
    "Driving Mission"
}

for _, group in ipairs(groups) do
    updateGroupHeaderPointer(group)
end

[DISABLE]



tried and doesn't tick pointer checkbox
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 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