 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
darquizard How do I cheat?
Reputation: 0
Joined: 21 Sep 2016 Posts: 2
|
Posted: Wed Sep 21, 2016 9:01 pm Post subject: Faster Memory Reading with Nomad Memory |
|
|
I'm writing a small cheat. In this game, when another player attacks you, if you cast a healing spell at the same time or immediately after you die, you don't actually die, but stay alive with the amount of health you were healed for. This effect is very powerful and is known as 'healing out'.
I've patched together some code in Nomad Memory and AutoIt that reads the current value of your players health - if that value doesn't equal the max value then cast a heal spell. Here is the code.
| Code: |
#include <NomadMemory.au3>
$count = 1 ;for debugging
While 1
$StaticOffset = Dec("[CE hex memory value]") ; Convert CE memory address from hex to dec
$pid = ProcessExists("GameProcess.exe") ;Select the process ID in windows
$openmem = _MemoryOpen($pid) ; Open the processes
$baseADDR = _MemoryGetBaseAddress($openmem, 1)
$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
$value = _MemoryRead($finalADDR, $openmem)
if $value <> [my maximum health] then
Send("{NUMPAD1}") ;Try to cast spell in slot 1 - healout!
$count = $count + 1 ;increments the global $count variable
ConsoleWrite($count & @CRLF) ;prints the global count variable so you can see how fast it runs
Else ;if $value is equal to max health
$x = 3 ;set this useless variable to 3 (This is obviously very amateurish....)
EndIf
WEnd
_MemoryClose($openmem) ;close memory reading
|
The script only seems to work properly if I use $value <> [max health], I've tried using $value <= [100] or [1000] but that doesn't work at all, it fails to heal out every single time. This is problematic because if your health is anything but a defined value then you simply heal constantly, which is silly and suspicious. It also only works if someone 1-shots you, which is common enough to make it useful, but not ideal.
I'm wondering if this is just part of the mechanic of the game and I have to live with it? Or if there is a better way that you can think of to detect a change?
An idea came to me, but I'm not sure how to implement it - get the current health of your character, and then detect if it decreases at all, then cast a heal if it has. Not sure how to do that elegantly.
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Sep 21, 2016 10:20 pm Post subject: |
|
|
Read whatever documentation you have on _MemoryRead().
Random guess, it's returning an integer when you health is a float.
You try something silly and see if you even have the value you think?
| Code: | | ConsoleWrite($value & @CRLF); |
|
|
| Back to top |
|
 |
darquizard How do I cheat?
Reputation: 0
Joined: 21 Sep 2016 Posts: 2
|
Posted: Wed Sep 21, 2016 11:55 pm Post subject: |
|
|
| From what I can tell the health is an integer, it does return the correct value as far as I can tell - in Cheat Engine the number is an integer as well when represented as 4 bytes.
|
|
| Back to top |
|
 |
|
|
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
|
|