Scripting pointers

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
pzaw
What is cheating?
What is cheating?
Posts: 1
Joined: Sun Mar 24, 2019 12:40 pm
Reputation: 0

Scripting pointers

Post by pzaw »

hi,

I am a little above a total newbie.
I am trying to use cheat engine 6.xx on HMMIII.
I don't know Lua but I do know Pascal/Delphi and assembly for PIC, ATmel etc uP..
Of course this is different from Intel uP asssembly.
I am hardly a professional programmer so ideally if you could explain the steps in as much
detail as possible would be appreciated.

What I am trying to do:
I have pointers to my hero's attributes - Name, level, knowledge, experience, movement, army size etc.
The pointers work 100% every time.

The trouble is I have to edit the offsets for each hero manually. This is a tedious process as there could
be a few heros.and you don't know what heros you will end up with.
Each set of offsets are different for each hero.

What I would ideally like is to make a script to change the pointer offset values according to the hero that I am using.
So this is purely a problem of scripting.

To work out the offset there is an equation that multiplies bytes together like xxxxxxxx +yyy*aaaa+ff+ccc
I have this equation in the add offset box in the "Change Address" Form that pops up when you click on the P->xxxxxxxxx

Now my questions are:

1. Is there a way to programatically change the offset in **this** "Change Address" Form's offset box?
. if so can someone more knowledgable than I am may be able to start me offf.

This method would be ideal as everything is there already just change the offset values programatically.

OR

2. How can read and write to this pointer address programatically without the use of the "Change Address" Form.
. Again can someone more knowledgable than I am may be able to start me offf.

Sudo code I amigine could be:

Read a user-value <- this is for setting values you want. similar to values in tables.
ccc=read from pointer address wwwwwww
variable-offset=xxxxxxxx +yyy*aaaa+ff+ccc
write user-value to variable-offset
exit

Of course I think this is more complicated. To me at least.

Any help would be appreciated.

TimFun13
Expert Cheater
Expert Cheater
Posts: 1354
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 6

Re: Scripting pointers

Post by TimFun13 »

Lua:

Code: Select all

myOffset = readInteger(0xDEADBEEF, true)
In the pointers address/offset:
xxxxxxxx +yyy*aaaa+ff+$myOffset


And if you're writing to the address in Lua, the "$" symbol is not used.

Code: Select all

local offset = readInteger(0xDEADBEEF, true)
local addr = getAddressSafe('xxxxxxxx +yyy*aaaa+ff')
if addr ~= nil then
  writeFloat(addr + offset, 100)
end

User avatar
VampTY
Table Makers
Table Makers
Posts: 809
Joined: Tue Mar 05, 2019 10:52 am
Reputation: 1047

Re: Scripting pointers

Post by VampTY »

Here's something easy and straight to the point, let's say you have your here's level pointer, then :
- pointer being selected just press ctrl+h and you'll do 2 hotkeys, or more, depends how many you want
- first hotkey/increase value with ... 50 or whatever you want
- second hotkey/set value to 0 will set to 0, removing all

This will add things even from 0..you can also alter with freeze values by setting them to the value you want (its all in that drop menu in hotkeys), you get the idea, i hoped it helped you!

Note: for god mode, you can have on the same hotkey, let's say F1, so on the pointer, on F1 you select toogle freeze and value set to 100 m but the main thing will be toogle freeze,for example...then second key is the same F1 (will activate in the same time) on this add set value to 100...practice a bit, there's multiple and way more complex ways, this is the short version and easiest one, best of luck!

anl93
Table Makers
Table Makers
Posts: 264
Joined: Mon May 29, 2017 10:12 am
Reputation: 86

Re: Scripting pointers

Post by anl93 »

is there a tutorial video how to make this?
thank you. its the same problem i'm having.

MartaLabieniec
Expert Cheater
Expert Cheater
Posts: 312
Joined: Sat Oct 06, 2018 3:19 pm
Reputation: 137

Re: Scripting pointers

Post by MartaLabieniec »

Yes, there is perfect tutorial how to script pointers here:

Post Reply

Who is online

Users browsing this forum: No registered users