-- 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
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.
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
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