Search code examples
automationcheat-engine

How to automate cheat engine value search/set without creating a trainer


Would it be possible to avoid searching values and setting them (i explained, what I need bellow) in cheat engine? I know you can find pointers of adreses and create trainer, but the problem is that the apps, I use cheat engine on, get updated a lot by my companies, and the pointers change every time. Meaning, I would have to create new trainers multiple times a week. Basically almost every day..

I would like to automate this, since, what I need, is quite easy:

1) open cheat engine and select application by name (example.exe)

2) Find float values that are equel to 100.0

3) wait for 2 seconds (so I can change stuff in app)

4) find float values that have changed to 200.0

5) wait 2 seconds (so I can change stuff in app)

6) find float values that now have changed to 300.0

7) at this point there will only be 3 values found. So I need to select the last one and freeze it to 500.0, so even if the app changes it back to 300.0, it gets set to 500.0 again.

As you can see, it's super annoying to do this manually, and I don't want to create like 3 trainers almost every day. Just to use them like 3x that day.

So my question is, would it be possible to automate this?

I'm not asking for complete code, but some detailed info with links would be highly appreciated, as I have used cheat engine a lot, and I know a lot about programing, I have 0 experience and knowledge about cheat engine scripting.


Solution

  • Would it be possible to automate this? Yes it would be. You could automate this by creating a cheat engine script at the least or creating a trainer. Your question also states that you want to do it without creating a trainer, so no.

    The Cheat Engine LUA or simple Cheat Engine scripting framework includes functionality for everything you're wanting to do:

    openProcess()   //to get process access rights for the process
    MemScan::firstScan()  //to scan for 100.0f
    MemScan::nextScan()  //to filter/rescan the results
    sleep()  //to pause execution
    memrec_freeze()  //to freeze
    

    The link you're requesting is to the LUA and Auto Assembler Tutorial section of the official Cheat Engine forum

    When the game you're working on updates frequently, you are correct that pointers become a burden to reverse and update each patch. The solution is to use array of byte signature scanning to locate assembly instructions that access the variables you're wanting to access. Don't worry CE has you covered on that as well, AOBScan().