Posted: Mon Jan 18, 2021 5:26 am Post subject: Questions of Lua Var to address
in this code ECX can read a 4 byte int
that show a map size in B
E.g : A map is 1 MB it will show 1,048,576 (B) [1024 x 1024]
But it is hard to read the size in B
so I am trying to make it show it in KB
MapInKB = ECX / 1024
and round it up
MapInKBRoundup =math.floor(MapInKB+1)
Code:
addresslist=getAddressList()
ECX=readInteger("[Game.dll+D7D000]+134")
if ECX~=nil then
MapInKB = ECX / 1024
MapInKBRoundup =math.floor(MapInKB+1)
mr=addresslist_getMemoryRecordByDescription(addresslist, "Map size in KB")
memoryrecord_setAddress(mr,MapInKBRoundup)
end
this code can show MapInKBRoundup in Lua engine
but fail to show the variable (MapInKBRoundup) in address list
I have been google a lot I guess it is
getMemoryRecordByDescription
memoryrecord_setAddress
but it did change the address but it change the value as a address not value as value
I use a dumb way to fix it
Code:
function getMapsize()
ECX=readInteger("[Game.dll+D7D000]+134")
if ECX~=nil then
MapInKB = ECX / 1024
MapInKBRoundup = math.floor(MapInKB + 1)
writeInteger("70002000",MapInKBRoundup)
end
end
Joined: 07 May 2020 Posts: 163 Location: On The Moon
Posted: Wed Jan 20, 2021 1:00 pm Post subject:
Try this
Code:
addresslist=getAddressList()
ECX=readInteger("[Game.dll+D7D000]+134")
if ECX~=nil then
MapInKB = ECX / 1024
MapInKBRoundup =math.floor(MapInKB+1)
mr=addresslist_getMemoryRecordByDescription(addresslist, "Map size in KB")
memoryrecord_setValue(mr,MapInKBRoundup)
end
print(MapInKBRoundup)
i think this should work gl _________________
I can see you Hitler
Especially When I am On the Moon!!
You are Right now in cheat engine forum
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