Heya I've been working to improve the pongmei chestrun thats been posted here bunch of times. I've been trying to implement the function posted below(found in faction only dmoss farm afaik) to make skill casting bit more "intelligent". My problem is that it fails to count certain enemies or completely breaks. I tried this by printing number of foes every time function is executed. So far it for example checks enemies every 0.1s so I know when im entering agro or when I have melee distance foes hitting me. :confused:
What could cause this?
Thanks in advance
Func GetNumberOfFoesInRangeOfAgent($aAgent, $aRange)
Local $lAgent, $lDistance
Local $lCount = 0
If Not IsDllStruct($aAgent) Then $aAgent = GetAgentByID($aAgent)
For $i = 1 To GetMaxAgents()
$lAgent = GetAgentByID($i)
If BitAND(DllStructGetData($lAgent, 'typemap'), 262144) Then ContinueLoop
If DllStructGetData($lAgent, 'Type') <> 0xDB Then ContinueLoop
If DllStructGetData($lAgent, 'Allegiance') <> 3 Then ContinueLoop
If DllStructGetData($lAgent, 'HP') <= 0 Then ContinueLoop
If BitAND(DllStructGetData($lAgent, 'Effects'), 0x0010) > 0 Then ContinueLoop
$lDistance = GetDistance($lAgent)
If $lDistance > $aRange Then ContinueLoop
$lCount += 1
Next
Return $lCount
EndFunc
EDIT: Found this same function written more understandibly in vaettir script and got it working
What could cause this?
Thanks in advance
Func GetNumberOfFoesInRangeOfAgent($aAgent, $aRange)
Local $lAgent, $lDistance
Local $lCount = 0
If Not IsDllStruct($aAgent) Then $aAgent = GetAgentByID($aAgent)
For $i = 1 To GetMaxAgents()
$lAgent = GetAgentByID($i)
If BitAND(DllStructGetData($lAgent, 'typemap'), 262144) Then ContinueLoop
If DllStructGetData($lAgent, 'Type') <> 0xDB Then ContinueLoop
If DllStructGetData($lAgent, 'Allegiance') <> 3 Then ContinueLoop
If DllStructGetData($lAgent, 'HP') <= 0 Then ContinueLoop
If BitAND(DllStructGetData($lAgent, 'Effects'), 0x0010) > 0 Then ContinueLoop
$lDistance = GetDistance($lAgent)
If $lDistance > $aRange Then ContinueLoop
$lCount += 1
Next
Return $lCount
EndFunc
EDIT: Found this same function written more understandibly in vaettir script and got it working