Scan through all agents via GetMaxAgents(), then check each one with DllStructGetData($agent, "PlayerNumber") for the Model ID
Thanks for the fast reply. Do you mind showing me how I would write that out?
Also if it's easier to target by enemy level or unique name that would work for me too.
Thanks for the fast reply. Do you mind showing me how I would write that out?
Also if it's easier to target by enemy level or unique name that would work for me too.
Something like this, not tested
Code:
Func TargetEnemyX()
For $i = 0 To GetMaxAgents()
Local $agent = GetAgentByID($i)
If DllStructGetData($agent, "PlayerNumber") = EnemyXModelID Then
ChangeTarget($agent)
EndIf
Next
EndFunc
Func TargetEnemyX()
For $i = 0 To GetMaxAgents()
Local $agent = GetAgentByID($i)
If DllStructGetData($agent, "PlayerNumber") = EnemyXModelID Then
ChangeTarget($agent)
EndIf
Next
EndFunc
Many thanks!
Could you also make it target the closest enemy (of the predefined model ID)?
It currently targets the enemy furthest away.
Either target the closest enemy to me, or closest to a set of coordinates would work.
You've been a big help mate. Would you recommend any guide to learn this kind of stuff?
I'll send an armbrace your way if you want to pm me your ign
Many thanks!
Could you also make it target the closest enemy (of the predefined model ID)?
It currently targets the enemy furthest away.
Either target the closest enemy to me, or closest to a set of coordinates would work.
You've been a big help mate. Would you recommend any guide to learn this kind of stuff?
I'll send an armbrace your way if you want to pm me your ign
Code:
Func TargetEnemyX()
Local $closest = 0
For $i = 0 To GetMaxAgents()
Local $agent = GetAgentByID($i)
If DllStructGetData($agent, "PlayerNumber") = EnemyXModelID Then
If $closest = 0 Then
$closest = $agent
Else
If GetDistance(GetAgentByID(-2), $agent) < GetDistance(GetAgentByID(-2), $closest) Then
$closest = $agent
EndIf
EndIf
Next
ChangeTarget($closest)
EndFunc
There isn't a guide or something like that, the most is just basic programming stuff. Look at the existing bots, learn the api. The most part is just learning by doing.
Func TargetEnemyX()
Local $closest = 0
For $i = 0 To GetMaxAgents()
Local $agent = GetAgentByID($i)
If DllStructGetData($agent, "PlayerNumber") = EnemyXModelID Then
If $closest = 0 Then
$closest = $agent
Else
If GetDistance(GetAgentByID(-2), $agent) < GetDistance(GetAgentByID(-2), $closest) Then
$closest = $agent
EndIf
EndIf
Next
ChangeTarget($closest)
EndFunc
There isn't a guide or something like that, the most is just basic programming stuff. Look at the existing bots, learn the api. The most part is just learning by doing.
Works like a charm thanks. One last thing to ask of you I promise.
Now the UseSkill() function doesn't work as intented. I've tried a few ways such as UseSkill(1) and UseSkill(1, -1) but I can't find any that successfully 'target' the already targeted enemy
Shard Of Oor BDS bot by Underavelvetmoon and updated by NiliyaFlamme / Oneshout
Skin to farm : Bone Dragon Staff
Update :
Quote:
- GWA2 updated for the good PerformAction on DropBundle function
- If "Use Légion stone" check, it's only for lvl 3 (don't need to spend points for 2 easy first lvl; feel free to activate it in script if you want it anyway)
Tips :
Quote:
- Bot need cupcake in inventory to light braziers
- Mod 20% dmg VS zombies help here (my character and all casters heroes got it)
Shard Of Oor BDS bot by n0futur3's and updated by NiliyaFlamme / Oneshout
Skin to farm : Bone Dragon Staff
Update :
Code:
- GWA2 updated for the good PerformAction on DropBundle function
- If "Use Légion stone" check, it's only for lvl 3 (don't need to spend points for 2 easy first lvl; feel free to activate it in script if you want it anyway)
Tips :
Code:
- Bot need cupcake in inventory to light braziers
- Mod 20% dmg VS zombies help here (my character and all casters heroes got it)
Last Chaos GuardianS - New 2019 Server (Opening 12 January 2019) 01/27/2019 - Last Chaos Private Server - 180 Replies https://www.youtube.com/watch?v=kCfwdUoPHu0
Website Coming Soon
Server Information
Start level :1
Max level:165
Experience:x2
Skill Points:x3