- Код: Выделить всё
Private Const MobHPAdress = &H54EA10
Public Declare Function Toolhelp32ReadProcessMemory Lib "kernel32.dll" (ByVal th32ProcessID As Long, ByRef lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal cbRead As Long, ByRef lpNumberOfBytesRead As Long) As Long
Function getMLong(ByVal addr As Long) As Long
Dim mp As Long
Toolhelp32ReadProcessMemory ByVal pid, ByVal addr, mp, 4, 0
getMLong = mp
End Function
Function getCount(ByVal myHP&) As Integer
Dim i&, Num&
For i = HPAdress To HPAdress + 66900 Step 168
Num = getMLong(i)
DoEvents
If Num <> 0 Then
getCount = getCount + 1
End If
Next i
End Function