Posted: Wed Jun 12, 2019 12:32 am Post subject: Building a pointer in my script
I am trying to build a pointer in my script that then checks the value of the end result. If the value is 0 it saves that value to its child. How do you build a pointer in lua? I thought it was like this but I guess I read wrong.
Code:
[ENABLE]
{$lua}
disableMemrec(memrec)
players = {38,70,A8,E0,118}
for i,offset in ipairs(players) do
local adr = getAddress("DarkSoulsIII.exe")
adr = readPointer(adr+4768E78) -- BaseB
adr = readPointer(adr+40)
adr = readPointer(adr+offset)
local val = readBytes(adr+70)
if(val == 0) then
child = memrec.Child[0]
adr = getAddress("BaseB")
adr = readPointer(adr+40)
adr = readPointer(adr+offset)
adr = readPointer(adr+XB)
val = readString(adr+7D8)
child.Value = val
end
end
{$asm}
createThread(Snipe)
[DISABLE]
numbers in lua are in decimal unless you prefix with 0x so 10 is ten but 0x10 is sixteen. BTW getAddress and readString etc.'s string parsing can handle eg. "[[BaseB+40]+7D8]+10", in which case it uses the same parsing as CE does in the address list so numbers are hex by default. It can't do variable interpolation on it's own though so for a variable/looped offset you'd have to build a string with eg. readString(("[[[BaseB+40]+%X]+??]+7D8"):format(offset)) (XB is not a valid hex value btw, hence the ??s) _________________
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