$CA_GetNumberOfFoesInRangeOfAgent does not work for me either. DOnt know why...
I noticed your range is high. So your not looking for how many mobs are surrounding a target Range (100-300?)
So...
Its longer but you can use $CA_GetNextFoe and stick all the enemys in an array. I think the max distance is 5000 or around that.
Then cycle the array and grab a variable if $CA_GetMyDistanceToAgent < 915
Code:
Func GetNextAliveFoe($AgentID)
$GetNextAliveFoe = CmdCB($CA_GetNextFoe, $AgentID)
Return $GetNextAliveFoe[0]
EndFunc
Code:
Func GetDistanceToAgent($AgentID)
$GetDistanceToAgent = CmdCB($CA_GetMyDistanceToAgent, $AgentID)
Return _IntToFloat($GetDistanceToAgent[0])
EndFunc
Code:
Func MobScan($Distance)
Global $Mob[50]
Global $NumberOfTargets
$i = 0
$Mob[$i] = GetNextAliveFoe(0)
Do
$i = $i + 1
$Mob[$i] = GetNextAliveFoe($Mob[$i - 1])
$MaxMobs = $i - 1
Until GetNextAliveFoe($Mob[$i - 1]) = 0
For $i = 0 To $MaxMobs Step 1
If GetDistanceToAgent($Mob[$i]) <= $Distance Then
$NumberOfTargets = $NumberOfTargets + 1
EndIf
Next
Return $NumberOfTargets
EndFunc
Code:
If MobScan(915) Then
EndIf