Use AOE if targeted by multiple mobs
-
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
Use AOE if targeted by multiple mobs
How can I get the bot to use AOE skills only if I'm targeted by multiple mobs?
Re: Use AOE if targeted by multiple mobs
Someone asked something similar recently. I posted a little function that counted the number of mobs that have you targeted. Let me look for it.
http://www.solarstrike.net/phpBB3/viewt ... 759#p19759
As to how you could use it, maybe, in the onPreSkillCast section of your profile, check if you are casting your AOE skill. Is so then count your aggroed targets. If number > n then return true else return false so it can continue attacking with other skills.
http://www.solarstrike.net/phpBB3/viewt ... 759#p19759
As to how you could use it, maybe, in the onPreSkillCast section of your profile, check if you are casting your AOE skill. Is so then count your aggroed targets. If number > n then return true else return false so it can continue attacking with other skills.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
-
- Posts: 24
- Joined: Tue Mar 01, 2011 3:23 am
Re: Use AOE if targeted by multiple mobs
Wouldn't it work better to check the mobs that are in AoE range rather than the one targeting you ?
Would just have to replace (in rock5' code linked)
by
(50 for purgatory fire, change for whatever AoE range is used)
Would just have to replace (in rock5' code linked)
Code: Select all
if pawn.TargetPtr == player.Address then
Code: Select all
if 50 > distance(player.X, player.Z, pawn.X, pawn.Z) then
Re: Use AOE if targeted by multiple mobs
Good point. I just answered what he asked.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Use AOE if targeted by multiple mobs
Trouble with that is it would recognise all mobs not just the ones targeting you, if people are trying to just through areas faster, hence the aoe, then they wouldn't want to stop to aoe in the middle of mobs not agroed on them because it would waste time. An example would be if you use a lvl 50 character to farm FA, you could easily run past a lot of the mobs and they wouldn't even aggro onto you because of the level difference.Auto Pilot wrote:Wouldn't it work better to check the mobs that are in AoE range rather than the one targeting you ?
Would just have to replace (in rock5' code linked)byCode: Select all
if pawn.TargetPtr == player.Address then
(50 for purgatory fire, change for whatever AoE range is used)Code: Select all
if 50 > distance(player.X, player.Z, pawn.X, pawn.Z) then
Food for thought =)
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
-
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
Re: Use AOE if targeted by multiple mobs
I swear I searched... can't believe I missed that other thread - thanks Rock!
Auto - thanks for the reply but Lisa is right on with what I'm trying to do. =)
Auto - thanks for the reply but Lisa is right on with what I'm trying to do. =)
-
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
Re: Use AOE if targeted by multiple mobs
I hate to ask but I can't really wrap my mind around the best way to implement this. Best thing I can think of is to change skill priority if multi aggro'd, but that doesn't seem practical. Can someone point me in the right direction?
Code: Select all
function CountAggroTargets()
local aggrocount = 0
local objectList = CObjectList();
objectList:update();
for i = 0,objectList:size() do
local obj = objectList:getObject(i);
if( obj ~= nil ) then
local pawn = CPawn(obj.Address);
if pawn.TargetPtr == player.Address then
aggrocount = aggrocount + 1
end
end
end
return aggrocount
end
Re: Use AOE if targeted by multiple mobs
Like I said, you could use it in the onPreSkillCast section of your profile. It would look something like this.
This will only cast your area of effect if more than 4 mobs have you targeted. There is no provision for changing the sequence of skills. If you want to cast the aoe skill as soon as possible, you could cast the aoe after checking CountAggroTargets(). eg.
Code: Select all
<onPreSkillCast>
if arg1.Name == "your aoe skill" then
if CountAggroTargets() < 5 then -- Change '5' to how many you want
return false
end
end
return true
</onPreSkillCast>
Code: Select all
if arg1.Name ~= "your aoe skill" and CountAggroTargets() > 5 then -- Change '5' to how many you want
player:cast("your aoe skill")
end
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
-
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
Re: Use AOE if targeted by multiple mobs
I'm such a dousche... it was right there in your first reply. New baby = sleep deprivation = fail! >=(
Who is online
Users browsing this forum: Semrush [Bot] and 1 guest