[Help]How to get current hitpoints of my role with no error menu

User Tag List

Results 1 to 3 of 3
  1. #1
    AGPS's Avatar Member
    Reputation
    1
    Join Date
    Aug 2012
    Posts
    53
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help]How to get current hitpoints of my role with no error

    I use AutoIt script, and I got two methods to get current hitpoints of my role from someone else' post, but neither of them work well.
    1st, the following codes work well occasionally, but not always, I don't know why.
    Code:
    global $Atrib_Hitpoints_Cur[2] = [0x71, "float"]
    $tempHealth = IterateActorAtribs(0x77BC0000, $Atrib_Hitpoints_Cur)
    2rd, I find function GetLifep doesn't work, for there is no "HealthBall_liquid" in the result of IterateObjectList. Could someone make it perfectly?
    Maybe they worked well before?
    Blizzhackers • View topic - [Autoit & MemoryRead] Tool-kit for bots
    Code:
    ;;--------------------------------------------------------------------------------
    ;;   GetLifep()
    ;;--------------------------------------------------------------------------------
    Func GetLifep()
       While 1
          $OBject = IterateObjectList(0)
          $foundlife = 0
          For $i = 0 To UBound($OBject, 1) - 1
             If StringInStr($OBject[$i][2], "HealthBall_liquid") Then
                $_LIFE = _MemoryRead($OBject[$i][9] + 0x408, $d3, 'float')
                $foundlife = 1
                ExitLoop 2
             EndIf
          Next
          If $foundlife = 0 Then
             $_LIFE = -1
             ExitLoop
          EndIf
       WEnd
       Return $_LIFE
    EndFunc   ;==>GetLifep
    
    ;;--------------------------------------------------------------------------------
    ;;   IterateObjectList()
    ;;--------------------------------------------------------------------------------
    Func IterateObjectList($_displayINFO)
       $_CurOffset = $_itrObjectManagerD
       $_Count = _MemoryRead($_itrObjectManagerCount, $d3, 'int')
       Dim $OBJ[$_Count + 1][10]
    
       For $i = 0 To $_Count Step +1
          $_GUID = _MemoryRead($_CurOffset + 0x4, $d3, 'ptr')
          $_NAME = _MemoryRead($_CurOffset + 0x8, $d3, 'char[64]')
          $_POS_X = _MemoryRead($_CurOffset + 0xB0, $d3, 'float')
          $_POS_Y = _MemoryRead($_CurOffset + 0xB4, $d3, 'float')
          $_POS_Z = _MemoryRead($_CurOffset + 0xB8, $d3, 'float')
          $_DATA = _MemoryRead($_CurOffset + 0x1FC, $d3, 'int')
          $_DATA2 = _MemoryRead($_CurOffset + 0x1Cc, $d3, 'int')
          $_DATA3 = _MemoryRead($_CurOffset + 0x1C0, $d3, 'int')
    
          $CurrentLoc = GetCurrentPos()
          $xd = $_POS_X - $CurrentLoc[0]
          $yd = $_POS_Y - $CurrentLoc[1]
          $zd = $_POS_Z - $CurrentLoc[2]
          $Distance = Sqrt($xd * $xd + $yd * $yd + $zd * $zd)
          $OBJ[$i][0] = $i
          $OBJ[$i][1] = $_GUID
          $OBJ[$i][2] = $_NAME
          $OBJ[$i][3] = $_POS_X
          $OBJ[$i][4] = $_POS_Y
          $OBJ[$i][5] = $_POS_Z
          $OBJ[$i][6] = $_DATA
          $OBJ[$i][7] = $_DATA2
          $OBJ[$i][8] = $Distance
          $OBJ[$i][9] = $_CurOffset
    
          $_CurOffset = $_CurOffset + $_ObjmanagerStrucSize
       Next
       Return $OBJ
    EndFunc   ;==>IterateObjectList

    [Help]How to get current hitpoints of my role with no error
  2. #2
    leo11173's Avatar Member
    Reputation
    1
    Join Date
    Jul 2012
    Posts
    58
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    ;;--------------------------------------------------------------------------------
    ;;      GetLifep()
    ;;--------------------------------------------------------------------------------
    Func GetLifep()
      Local $index, $offset, $count, $item[10], $foundobject = 0
      startIterateObjectsList($index, $offset, $count)
      While iterateObjectsList($index, $offset, $count, $item)
        If StringInStr($item[1], "HealthBall_liquid") Then
          return _MemoryRead($item[8] + 0x408, $d3, 'float')
        EndIf
      WEnd
    EndFunc   ;==>GetLifep
    
    
    Func checkForPotion()
    ;Local $mesurepot = TimerInit() ;;;;;;;;;;;;;;
    
       $life = GetLifep()
    	If IsNumber($life) Then
                $diff = TimerDiff($timeforpotion)
    			If $life < $LifeForPotion/100 and $diff > 30000 Then
    				$timeforpotion = TimerInit()
    				send("q")
    			EndIf
    endfunc
    
    ;;--------------------------------------------------------------------------------
    ;;      Function to iterate all objects()
    ;;--------------------------------------------------------------------------------
    
    Func startIterateObjectsList(ByRef $index, ByRef $offset, ByRef $count)
    	$count = _MemoryRead($_itrObjectManagerCount, $d3, 'int')
    	$index = 0
    	$offset = $_itrObjectManagerD
    EndFunc   ;==>startIterateObjectsList
    
    Func iterateObjectsList(ByRef $index, ByRef $offset, ByRef $count, ByRef $item)
    	While 1
    		If $index > $count Then Return False
    		$index += 1
    		$item[0] = _MemoryRead($offset + 0x4, $d3, 'ptr') ; GUID
    		$item[1] = _MemoryRead($offset + 0x8, $d3, 'char[64]') ; Name
    		$item[2] = _MemoryRead($offset + 0xB0, $d3, 'float') ; PosX
    		$item[3] = _MemoryRead($offset + 0xB4, $d3, 'float') ; PosY
    		$item[4] = _MemoryRead($offset + 0xB8, $d3, 'float') ; PosZ
    		$item[5] = _MemoryRead($offset + 0x1FC, $d3, 'int') ; Data1
    		$item[6] = _MemoryRead($offset + 0x1CC, $d3, 'int') ; Data2
    		$item[7] = _MemoryRead($offset + 0x1C0, $d3, 'int') ; Data3
    		$item[8] = $offset ; Current Offset
    		$item[9] = getDistance($item[2], $item[3], $item[4]) ; Distance
    		$offset = $offset + $_ObjmanagerStrucSize
    		Return True
    	WEnd
    EndFunc   ;==>iterateObjectsList

  3. #3
    AGPS's Avatar Member
    Reputation
    1
    Join Date
    Aug 2012
    Posts
    53
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by leo11173 View Post
    Code:
    ;;--------------------------------------------------------------------------------
    ;;      GetLifep()
    ;;--------------------------------------------------------------------------------
    Func GetLifep()
      Local $index, $offset, $count, $item[10], $foundobject = 0
      startIterateObjectsList($index, $offset, $count)
      While iterateObjectsList($index, $offset, $count, $item)
        If StringInStr($item[1], "HealthBall_liquid") Then
          return _MemoryRead($item[8] + 0x408, $d3, 'float')
        EndIf
      WEnd
    EndFunc   ;==>GetLifep
    
    
    Func checkForPotion()
    ;Local $mesurepot = TimerInit() ;;;;;;;;;;;;;;
    
       $life = GetLifep()
    	If IsNumber($life) Then
                $diff = TimerDiff($timeforpotion)
    			If $life < $LifeForPotion/100 and $diff > 30000 Then
    				$timeforpotion = TimerInit()
    				send("q")
    			EndIf
    endfunc
    
    ;;--------------------------------------------------------------------------------
    ;;      Function to iterate all objects()
    ;;--------------------------------------------------------------------------------
    
    Func startIterateObjectsList(ByRef $index, ByRef $offset, ByRef $count)
    	$count = _MemoryRead($_itrObjectManagerCount, $d3, 'int')
    	$index = 0
    	$offset = $_itrObjectManagerD
    EndFunc   ;==>startIterateObjectsList
    
    Func iterateObjectsList(ByRef $index, ByRef $offset, ByRef $count, ByRef $item)
    	While 1
    		If $index > $count Then Return False
    		$index += 1
    		$item[0] = _MemoryRead($offset + 0x4, $d3, 'ptr') ; GUID
    		$item[1] = _MemoryRead($offset + 0x8, $d3, 'char[64]') ; Name
    		$item[2] = _MemoryRead($offset + 0xB0, $d3, 'float') ; PosX
    		$item[3] = _MemoryRead($offset + 0xB4, $d3, 'float') ; PosY
    		$item[4] = _MemoryRead($offset + 0xB8, $d3, 'float') ; PosZ
    		$item[5] = _MemoryRead($offset + 0x1FC, $d3, 'int') ; Data1
    		$item[6] = _MemoryRead($offset + 0x1CC, $d3, 'int') ; Data2
    		$item[7] = _MemoryRead($offset + 0x1C0, $d3, 'int') ; Data3
    		$item[8] = $offset ; Current Offset
    		$item[9] = getDistance($item[2], $item[3], $item[4]) ; Distance
    		$offset = $offset + $_ObjmanagerStrucSize
    		Return True
    	WEnd
    EndFunc   ;==>iterateObjectsList
    Thanks, leo11173, but I don't see and difference from your codes. I just cannot find any object named as "HealthBall_liquid", I've tested on my Barb role. Does Barb differ from other race?

Similar Threads

  1. Replies: 2
    Last Post: 08-14-2012, 10:13 AM
  2. [Help] How to get members to a highrate blizzlike server???
    By Naturaldepth in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 07-12-2008, 01:56 PM
  3. Help, how to get last name
    By jho369 in forum WoW Scam Prevention
    Replies: 6
    Last Post: 07-03-2008, 11:28 AM
  4. [Help] How to get two pics into photoshop
    By Randie in forum Art & Graphic Design
    Replies: 4
    Last Post: 06-17-2008, 11:18 AM
  5. [Help]How to get feathers on my raptor mount
    By Daftz in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 04-08-2008, 02:14 AM
All times are GMT -5. The time now is 07:34 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search