| View previous topic :: View next topic |
| Author |
Message |
jgoemat Master Cheater
Reputation: 23
Joined: 25 Sep 2011 Posts: 266
|
Posted: Wed Jul 22, 2026 1:51 am Post subject: Quick script for mono statics |
|
|
Just wrote an autoassembler lua script to find and create children for static fields on a class. This is for 'Keep on Mining' and has some values affecting the pick.
| Code: |
[enable]
{$lua}
if syntaxcheck then return end
local namespaceName = ""
local className = "TheAnvil"
local fields = {
equippedMineTime = vtSingle,
equippedMinePower = vtSingle,
equipped2XChance = vtSingle,
equippedMiningArea = vtSingle,
collTime = vtSingle
}
LaunchMonoDataCollector()
local addressList = getAddressList()
-- remove existing children
while memrec.Count > 0 do
memrec[0].destroy()
end
function addMemoryRecord(address, name, recordType)
local entry = addressList.createMemoryRecord()
entry.Description = name
entry.Type = recordType
entry.Address = address
entry.Parent = memrec
end
local class = mono_findClass(namespaceName, className)
local baseAddress = mono_class_getStaticFieldAddress(mono_enumDomains()[1], class)
for i,f in ipairs(mono_class_enumFields(class)) do
if f.isStatic and fields[f.name] ~= nil then
addMemoryRecord(baseAddress + f.offset, f.name, fields[f.name])
end
end
{$asm}
[disable]
{$lua}
if syntaxcheck then return end
-- destroy children
while memrec.Count > 0 do
memrec[0].destroy()
end
{$asm}
|
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25972 Location: The netherlands
|
Posted: Wed Jul 22, 2026 6:07 am Post subject: |
|
|
also in 7.7 you can give a memory record the address
| Code: |
classname.staticfieldname
|
and it'll automatically be at the correct address once it becomes available
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 98
Joined: 14 Jul 2007 Posts: 3411
|
Posted: Fri Jul 24, 2026 8:27 am Post subject: |
|
|
| Cheers DB, I was not aware, quite useful!
|
|
| Back to top |
|
 |
|