View previous topic :: View next topic |
Author |
Message |
zxuiji Advanced Cheater Reputation: 1
Joined: 26 Sep 2016 Posts: 70
|
Posted: Mon Sep 26, 2016 2:00 pm Post subject: Recalulating Addresses |
|
|
So far I've put this together but I've been unable to find helpful information on how to get each node and update their address, could someone please show me roughly how to complete this
Code: |
function myRecalcAddr(node,base)
base = memoryrecord_getAddress(node)
-- Don't bother trying if we don't have addr
if ( addr == nil )
return false
end
if ( base > addr )
diff = base - addr
-- Guessed the name and values here
next = memoryrecord_getSibling(node,1)
else
diff = addr - base
end
-- Assume Failure
return false
end
function updateMovementTree()
-- Is suitable indicator of collision? address
base = AOBScan("AC C5 27 37 00 00 00 40 00 00 00 00")
-- This should be the first child of the tree we are going update
node = getMemoryRecordByDescription("AC C5 27 37 00 00 00 40 00 00 00 00")
return myRecalAddr( node, base )
end
|
_________________
Those who do not trust in christ to save them from their sins will only experience hell when their soul is released from it's earthly vessel. |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Sep 26, 2016 5:33 pm Post subject: |
|
|
No clue what you're trying to do here.
You have so many variables that do absolutely nothing. |
|
Back to top |
|
|
zxuiji Advanced Cheater Reputation: 1
Joined: 26 Sep 2016 Posts: 70
|
Posted: Tue Sep 27, 2016 4:28 am Post subject: |
|
|
That's because I can't find the information I need to actually complete the functions, also if you actually look at the names of the functions you should be able to see what I'm attempting to do. _________________
Those who do not trust in christ to save them from their sins will only experience hell when their soul is released from it's earthly vessel. |
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4300
|
Posted: Tue Sep 27, 2016 8:48 am Post subject: |
|
|
myRecalcAddr probably means you're trying to recalculate an address. Perhaps you should look on google maps first- it's pretty good at finding addresses.
updateMovementTree probably means you're updating a tree that's used for movement. I'm guessing it's not an apple tree since those tend to not move around that often.
Other than that, there's little semantic value with those names (that I can deduce). Just because you understand something doesn't mean other people will. If you describe what you want to accomplish, then others might be able to help you.
Look in main.lua for documentation on most functions, tables, and properties CE has available, and look online for more generic Lua tutorials that teach the syntax of the language if needed. _________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
zxuiji Advanced Cheater Reputation: 1
Joined: 26 Sep 2016 Posts: 70
|
Posted: Fri Sep 30, 2016 3:37 am Post subject: |
|
|
Putting aside your sarcasim the last bit there may have actually been helpful, I'll see if I can find this main.lua you spoke of
Edit 1: Well I corrected some of my mistakes (if not all) and I will test the script by the end of sunday, dunno when I'll feel like playing the game in that time so I won't give an exact time.
Edit 2: Turned I had made a lot of mistakes in the code so couldn't do a proper test, fixed a few then got lazy. I'll see how I feel tommorrow, I'm sure I will feel like trying again at some point during the day.
Edit 3: Eventually tried it, fixed a few more errors then hit a stumbling block, right now I'm not seeing the error so I will post the script and reported error and see if someone can work it out while I'm at work:
Code: | ct = getAddressList()
memoryrecord_recalcAddress = function(root,offset)
if ( type(offset) ~= "number" ) then
return false
end
local i
for i = 0, root.Count, 1 do
local node = root.Child[i]
local base = tonumber("0x" .. node.Address)
local addr = base + offset
memoryrecord_setAddress( node, addr )
if ( node.Count > 0 and
memoryrecord_recalcAddress( node, offset ) == false ) then
return false
end
end
return true
end
function updateMovementTree()
-- Is suitable indicator of collision? address
local base = AOBScan("AC C5 27 37 00 00 00 40 00 00 00 00")
if ( base.Count ~= 1 ) then return false end
base = tonumber("0x" .. base[0])
-- This is the tree we are goin to update
local root = ct.getMemoryRecordByDescription("Movement")
if ( root == nil ) then
showMessage("Could not find Movement tree :(")
return false
end
-- This should be the first child of the tree we are going update
local node = ct.getMemoryRecordByDescription("AC C5 27 37 00 00 00 40 00 00 00 00")
if ( node == nil ) then
showMessage("Could not find required node :(")
return false
end
local addr = tonumber( "0x" .. node.Address )
local offset = addr - base
-- This is to confirm we actually reached here, to be removed when script is fixed
showMessage("Attempting to recalculate Movement tree")
if ( addr > base ) then
return memoryrecord_recalcAddress(root,addr-base)
else
return memoryrecord_recalcAddress(root,-(base-addr))
end
end
updateMovementTree() |
Error:[string "ct = getAddressList()..."]:9: attempt to index local 'node' (a nil value) _________________
Those who do not trust in christ to save them from their sins will only experience hell when their soul is released from it's earthly vessel. |
|
Back to top |
|
|
|