#include <nomadmemory.au3>
#include <GUIConstantsEx.au3>
#Include <Timers.au3>
$AllodsProcessName = "Perfect World"
$ProcessID = WinGetProcess($AllodsProcessName,"")
SetPrivilege("SeDebugPrivilege", 1)
If $ProcessID = -1 Then
MsgBox(4096, "ERROR", "Failed to detect MMO A1 running.")
Exit
EndIf
$DllInformation = _MemoryOpen($ProcessID)
If @Error Then
MsgBox(4096, "ERROR", "Failed to open memory.")
Exit
EndIf
$BotVersion = "0.04"
Global $GUITitle = "Search HP test" & $BotVersion
Global $win_main, $mem_label1, $mem_label2 ,$mem_label1_1, $mem_label2_1
$i = "1"
TestGUI()
Func TestGUI()
$win_main = GUICreate($GUITitle, 200, 200, -1, -1)
$mem_label2_1 = GUICtrlCreateLabel('HP:', 15, 25, 150, 20)
$mem_label2 = GUICtrlCreateLabel('11', 40, 25, 150, 20)
GUISetState(@SW_SHOW)
_Timer_SetTimer($win_main, 500, '_Update_mem')
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()
EndFunc
Func _Update_mem($hWnd, $Msg, $iIDTimer, $dwTime)
_CurrentHP()
GUICtrlSetData($mem_label2, StringFormat($HPdec))
EndFunc
Func _CurrentHP()
$CurrentHP = (_MemoryRead(0x0A598ACC, $DllInformation, 'ptr'))
If @Error Then
MsgBox(4096, "ERROR", "Failed to read memory.")
Exit
EndIf
Global $HPdec = dec(StringTrimLeft($CurrentHP, 2))
EndFunc