script won't read diablo 2 process memory

Ask gaming related questions
Yugo
Posts: 24
Joined: 01 Mar 2018, 05:20

script won't read diablo 2 process memory

10 Nov 2018, 06:37

Hi,

first off, I've read all the releated topics in the forum and i want to mantion ,that i'm not playing this old game on battle net or have the skills to code a bot ^^

Just wanted some nostalgic feeling from the old good days back, and playing in singleplayer for couple weeks. Now i was woundering if i can read the memory for health and mana and code something like "automatic take helath/mana potions" when health/mana drops to a certain level. Just a help for me because I'm playing on hardcore modus (as mantioned only singleplayer) So i have tried to reach the life adress but i became always a "0" as a respond! following code is working with all other games, but not with diablo .-.

so i#m really confused and frusrated. it should be so easy, as i said in other games it works like a charm.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance force


;GTA WORKS!
;value:=ReadMemory(0x023DB2FC,"GTA2")
;msgbox, %value%

;DIABLO ...
value:=ReadMemory(0x04ECC92C,"Diablo II")
msgbox, %value%




ReadMemory(MADDRESS,PROGRAM)
{
winget, pid, PID, %PROGRAM%

VarSetCapacity(MVALUE,4,0)
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)

Loop 4
result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)

return, result 
}



p.s. sorry for my poor english, I am obviosly not native speaker ^^ lol

thanks anyway


EDIT:

a user by the name FloowSnaake was arround in the old forums. Is he stil active in the new (could not find his profile)? Because i thing he might be the right person to ask for things like this (best example his POE Script)
John
Posts: 75
Joined: 10 Apr 2014, 08:59

Re: script won't read diablo 2 process memory

04 Dec 2018, 02:26

First you need to find the the address itself and the offsets that point to the address, with e.g. Cheat Engine. Once you've found those then you'd be looking at writing the script and all good, but without that first step there's no need to start scripting with AHK.
Btw, if you use Cheat Engine or one of the other more popular software to scan then you run the risk of instaban so make sure to first search from google with "[your game here] cheat engine ban". In this case you might even find a cheat table which has up to date offsets and addresses.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 35 guests