Can Lua batch copy and add groups?

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
longsers
Cheater
Cheater
Posts: 35
Joined: Sat Aug 19, 2017 12:36 pm
Reputation: 11

Can Lua batch copy and add groups?

Post by longsers »

Similar to this question
cheatengine.org/forum/viewtopic.php?t=609399
If there is already a ready group,header's Description is Character1
like this:

Code: Select all

Character1
   hp    [[a.exe+123]+104]+10
   mp    [[a.exe+123]+108]+10
   str     [[a.exe+123]+10c]+10
Zanzer gave a lua batch editing offset

Code: Select all

local list = getAddressList()
for n = 0, list.Count - 1 do
  local rec = list[n]
  if rec.OffsetCount > 0 then
    rec.Offset[1] = rec.Offset[1] + 0x100
  end
end
Can Lua be used to increase 100 groups at once?
such as:

Group2 is

Code: Select all

Character2
   hp     [[a.exe+123]+204]+10
   mp    [[a.exe+123]+208]+10
   str    [[a.exe+123]+20c]+10
-------------------------------
finally, The twisty method is to repeat the copy and paste 8 times to get 128 groups, and then delete 28 groups
and use this

Code: Select all

local list = getAddressList()
 for n = 0, list.Count - 1 do
  local rec = list[n]
  if rec.OffsetCount > 0 then
    local m = math.floor(n/4)
    rec.Offset[1] = rec.Offset[1] + m*0x100
  end
end

Post Reply

Who is online

Users browsing this forum: No registered users