Ralle1976

GetNumberOfFoesInRangeOfAgent2 Examples

Jan 19th, 2017
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.96 KB | None | 0 0
  1. Func GetNumberOfFoesInRangeOfAgent2($aMaxDistance = 4000, $ModelID1 = 0, $ModelID2 = 0)
  2.    Local $lCount = 0
  3.    Local $lTargetTypeArray = MemoryReadAgentPtrStruct(3)
  4.    For $i = 1 To $lTargetTypeArray[0]
  5.       Switch(MemoryRead($lTargetTypeArray[$i] + 244, 'word'))
  6.           Case $ModelID1, $ModelID2
  7.               ContinueLoop
  8.           Case Else
  9.             If GetDistance($lTargetTypeArray[$i], $GMePtr) < $aMaxDistance Then $lCount += 1
  10.       Endswitch
  11.    Next
  12.    Return $lCount
  13. EndFunc
  14.  
  15. Func GetNumberOfFoesInRangeOfAgent2($aMaxDistance = 4000, $ModelID1 = 0, $ModelID2 = 0)
  16.     Local $__ModelID = 0, $lCount = 0
  17.     Local $lTargetTypeArray = MemoryReadAgentPtrStruct(3)
  18.     For $i = 1 To $lTargetTypeArray[0]
  19.         $__ModelID = MemoryRead($lTargetTypeArray[$i] + 244, 'word')
  20.         If $__ModelID = $ModelID1 Then ContinueLoop ;Spirit 1
  21.         If $__ModelID = $ModelID2 Then ContinueLoop ;Spirit 2
  22.         If GetDistance($lTargetTypeArray[$i], $GMePtr) < $aMaxDistance Then $lCount += 1
  23.     Next
  24. Return $lCount
  25. EndFunc
Advertisement