Ralle1976 icon

GetNumberOfFoesInRangeOfAgent2 Examples

Ralle1976 | PRO | 01/20/17 04:36:02 AM UTC | 0 ⭐ | 12910 👁️ | Never ⏰ | []
AutoIt |

960 B

|

None

|

0 👍

/

0 👎

Func GetNumberOfFoesInRangeOfAgent2($aMaxDistance = 4000, $ModelID1 = 0, $ModelID2 = 0)
   Local $lCount = 0
   Local $lTargetTypeArray = MemoryReadAgentPtrStruct(3)
   For $i = 1 To $lTargetTypeArray[0]
      Switch(MemoryRead($lTargetTypeArray[$i] + 244, 'word'))
          Case $ModelID1, $ModelID2
              ContinueLoop
          Case Else
            If GetDistance($lTargetTypeArray[$i], $GMePtr) < $aMaxDistance Then $lCount += 1
      Endswitch
   Next
   Return $lCount
EndFunc
 
Func GetNumberOfFoesInRangeOfAgent2($aMaxDistance = 4000, $ModelID1 = 0, $ModelID2 = 0)
    Local $__ModelID = 0, $lCount = 0
    Local $lTargetTypeArray = MemoryReadAgentPtrStruct(3)
    For $i = 1 To $lTargetTypeArray[0]
        $__ModelID = MemoryRead($lTargetTypeArray[$i] + 244, 'word')
        If $__ModelID = $ModelID1 Then ContinueLoop ;Spirit 1
        If $__ModelID = $ModelID2 Then ContinueLoop ;Spirit 2
        If GetDistance($lTargetTypeArray[$i], $GMePtr) < $aMaxDistance Then $lCount += 1
    Next
Return $lCount
EndFunc

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎