 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Cissamannen Cheater
Reputation: 0
Joined: 16 Jul 2009 Posts: 38
|
Posted: Thu Apr 16, 2020 10:33 am Post subject: Mass edit and adding |
|
|
Hello,
I'm trying to bulk add a bunch of offsets that I have to sort in properly under certain parent groups.
So to give an example the groups would go as follows:
Items
- Slot 1
-- ID
-- Type
-- Quantity
So I have the offsets needed for ID, Type, and Quantity from Slot 1 onwards, so what I want to be able to do is, have a script basically write out groups of Slot 1 all the way to Slot 1000 (Yes the game has alot of items, 2000 is max but there is not that many). Then have a script that adds the 3 corresponding offsets for each Slot.
Like, for each Parent group made (Slot 2 and onwards) write Offset and name for the 3 sections written above, and repeat for Slot 3 and then 4 etc.
I already have the Dropdown Editor that I can do that quickly with luckily, but this other part is out of my area.
ID is 2 Bytes, Type is Byte, Quantity is Byte.
See picture for example of sorting method I'd prefer (Ignore Slot under Quantity).
I have this script Dark_Byte shared in another thread, but its the one that only writes out 1 2 3 4 5 or said name is using "example".
| Code: | al=getAddressList()
a=0x34A3C
for i=1,1000 do
mr=al.createMemoryRecord()
mr.Address=string.format("%x", a)
mr.setDescription(i)
mr.Type=vtWord
a=a+24
end |
Any tips will be greatly appreciated, if this is even possible to create easy. |
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 153
Joined: 06 Jul 2014 Posts: 4734
|
Posted: Thu Apr 16, 2020 11:57 am Post subject: |
|
|
Haven't tested this
| Code: | local InventoryAddress = 0x217465c
local SlotCount = 1000
local SlotSize = 0x18
local properties = {
--{ Description, Offset, Type, (optional)dropdown options list },
{ 'ID', 0xC, vtWord, { 'a:13', 'b:15', } },
{ 'Type', 0x8, vtByte, { 'c:47', 'd:57', } },
{ 'Quantity', 0x14, vtByte, },
{ 'Slot', 0x4, vtByte, },
}
assert(SlotCount > 0 and SlotSize > 0 and #properties > 0)
local mrHead = AddressList.createMemoryRecord()
mrHead.Description = 'Items'
mrHead.IsGroupHeader = true
mrHead.Options = '[moHideChildren]'
for i = 0, SlotCount-1, 1 do
local mrItem = AddressList.createMemoryRecord()
mrItem.appendToEntry(mrHead)
mrItem.Description = 'Slot '..(i+1)
mrItem.IsGroupHeader = true
mrItem.Options = '[moHideChildren]'
for _,v in ipairs(properties) do
local mrProp = AddressList.createMemoryRecord()
mrProp.appendToEntry(mrItem)
mrProp.Description = v[1]
mrProp.Type = v[3]
mrProp.Address = ('%08X'):format(InventoryAddress + i * SlotSize + v[2])
end
end
local mrDropdown = mrHead[0]
for _,v in ipairs(properties) do
local t = v[4] -- dropdown options
if t then
local stringlist = createStringlist()
for _,s in ipairs(t) do
stringlist.add(s)
end
mrDropdown.DropDownList = stringlist
mrDropdown.DropDownReadOnly = true
mrDropdown.DropDownDescriptionOnly = true
mrDropdown.DisplayAsDropDownListItem = true
end
end
for sloti = 1, SlotCount-1, 1 do
local mrItem = mrHead[sloti]
for propi,v in ipairs(properties) do
if v[4] then -- if dropdown options are defined for this property
local mrProp = mrItem[propi]
local mrLink = mrDropdown[propi]
mrProp.DropDownLinked = true
mrProp.DropDownLinkedMemrec = mrLink
mrProp.DropDownReadOnly = mrLink.DropDownReadOnly
mrProp.DropDownDescriptionOnly = mrLink.DropDownDescriptionOnly
mrProp.DisplayAsDropDownListItem = mrLink.DisplayAsDropDownListItem
end
end
end
|
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
Cissamannen Cheater
Reputation: 0
Joined: 16 Jul 2009 Posts: 38
|
Posted: Thu Apr 16, 2020 2:51 pm Post subject: |
|
|
| ParkourPenguin wrote: | Haven't tested this
| Code: | local InventoryAddress = 0x217465c
local SlotCount = 1000
local SlotSize = 0x18
local properties = {
--{ Description, Offset, Type, (optional)dropdown options list },
{ 'ID', 0xC, vtWord, { 'a:13', 'b:15', } },
{ 'Type', 0x8, vtByte, { 'c:47', 'd:57', } },
{ 'Quantity', 0x14, vtByte, },
{ 'Slot', 0x4, vtByte, },
}
assert(SlotCount > 0 and SlotSize > 0 and #properties > 0)
local mrHead = AddressList.createMemoryRecord()
mrHead.Description = 'Items'
mrHead.IsGroupHeader = true
mrHead.Options = '[moHideChildren]'
for i = 0, SlotCount-1, 1 do
local mrItem = AddressList.createMemoryRecord()
mrItem.appendToEntry(mrHead)
mrItem.Description = 'Slot '..(i+1)
mrItem.IsGroupHeader = true
mrItem.Options = '[moHideChildren]'
for _,v in ipairs(properties) do
local mrProp = AddressList.createMemoryRecord()
mrProp.appendToEntry(mrItem)
mrProp.Description = v[1]
mrProp.Type = v[3]
mrProp.Address = ('%08X'):format(InventoryAddress + i * SlotSize + v[2])
end
end
local mrDropdown = mrHead[0]
for _,v in ipairs(properties) do
local t = v[4] -- dropdown options
if t then
local stringlist = createStringlist()
for _,s in ipairs(t) do
stringlist.add(s)
end
mrDropdown.DropDownList = stringlist
mrDropdown.DropDownReadOnly = true
mrDropdown.DropDownDescriptionOnly = true
mrDropdown.DisplayAsDropDownListItem = true
end
end
for sloti = 1, SlotCount-1, 1 do
local mrItem = mrHead[sloti]
for propi,v in ipairs(properties) do
if v[4] then -- if dropdown options are defined for this property
local mrProp = mrItem[propi]
local mrLink = mrDropdown[propi]
mrProp.DropDownLinked = true
mrProp.DropDownLinkedMemrec = mrLink
mrProp.DropDownReadOnly = mrLink.DropDownReadOnly
mrProp.DropDownDescriptionOnly = mrLink.DropDownDescriptionOnly
mrProp.DisplayAsDropDownListItem = mrLink.DisplayAsDropDownListItem
end
end
end
|
|
A short edit on offsets and it worked perfectly! You are a god my man!  |
|
| Back to top |
|
 |
|
|
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
|
|