Page 1 of 1

A method for saving AOB locations for later use

Posted: Sat Apr 03, 2021 8:57 pm
by aSwedishMagyar
I've been having fun with table files and experimenting with ways to save the location of an AOB so when you open the table later it can simply read them out and register your symbols. Here is what I have come up with:

In the zip file there is a lua file with the following functions:
  • generateAOBList()
  • saveLocation(name)
  • readLocation(name)
  • destroyTableFiles()
  • refreshTableFile(name)
  • tableFileWriteBytes(file,bytes)
  • createByteTableString(byteTable)
All of these must be included in your table for it to work. The first three functions are the ones you will be using while the rest are helper functions that I used to clean things up.

I commented the lua file so hopefully that is enough to get you going but here is a general description of the three functions you call:

This function is what normalizes the format of your AOB items, you will need to add in your own unique AOBs along with the symbol name you want for them. The formatting for each item has to be {AOB,'symbolName'}.

This function take your symbol name and gets its location as getNameFromAddress(). It then reads 20 bytes from that location which is converted into a hex string. A table file is created with the same name as the symbol and the address and byte table string are saved to it.

This function opens the table file with the same name and reads out the address and byte table string. It then reads 20 bytes from the address and compares it with the saved byte table, if they are the same it registers the symbol at the saved address and returns true. You can use this in your enable as the method for determining whether you scan for the AOB or not.

See my Chronicon table for an example of how I use it.

Let me know what you think or if you have any questions on how to use it.

Re: A method for saving AOB locations for later use

Posted: Mon Jun 28, 2021 2:08 am
by G40styHW
This is extremely helpful, thank you sir.