ski
Well-Known Member
- Joined
- Feb 12, 2010
- Messages
- 3,720
I have the following code in my Pull and Combat sections, and the following happens:
- Bot targets player that's out of range
- Log says "Blacklisting player"
- Pet is returned
- Target is cleared
Now that's all well and good, but it repeats that over and over... how does the blacklist actually work? I would think it would not target a Guid that is on the blacklist, but it seems to keep targetting over and over.
- Bot targets player that's out of range
- Log says "Blacklisting player"
- Pet is returned
- Target is cleared
Now that's all well and good, but it repeats that over and over... how does the blacklist actually work? I would think it would not target a Guid that is on the blacklist, but it seems to keep targetting over and over.
Code:
if (Me.GotTarget &&
Me.CurrentTarget.IsPet) {
slog("Battleground: Blacklist Pet {0}",Me.CurrentTarget.Name);
Blacklist.Add(Me.CurrentTarget.Guid, TimeSpan.FromDays(1));
Me.ClearTarget();
lastGuid = 0;
break;
}
// test, if in battleground and someone is out of line of sight, blacklist for 5 seconds
if (Me.GotTarget && !Me.CurrentTarget.InLineOfSight){
slog("Battleground: {0} out of Line of Sight, blacklisting for 3 seconds", Me.CurrentTarget.Name);
Blacklist.Add(Me.CurrentTarget.Guid, TimeSpan.FromSeconds(3));
Me.ClearTarget();
Lua.DoString("PetFollow()");
lastGuid = 0;
break;
}
if (Me.GotTarget && Me.CurrentTarget.Distance > SpellManager.KnownSpells["Shadow Bolt"].MaxRange - 1) {
slog("Battleground: {0} out of Range ({1} yards), blacklisting for 3 seconds", Me.CurrentTarget.Name, Me.CurrentTarget.Distance);
Blacklist.Add(Me.CurrentTarget.Guid, TimeSpan.FromSeconds(3));
Me.ClearTarget();
Lua.DoString("PetFollow()");
lastGuid = 0;
break;
}
// if target has bubble up, blacklist for duration
if (Me.GotTarget && Me.CurrentTarget.Buffs.ContainsKey("Divine Shield")) {
slog("Battleground: {0} has Divine Shield, blacklisting for 10 seconds", Me.CurrentTarget.Name);
Blacklist.Add(Me.CurrentTarget.Guid, TimeSpan.FromSeconds(10));
Me.ClearTarget();
Lua.DoString("PetFollow()");
lastGuid = 0;
break;
}
// if target has iceblock up, blacklist for duration
if (Me.GotTarget && Me.CurrentTarget.Buffs.ContainsKey("Ice Block")) {
slog("Battleground: {0} has Ice Block, blacklisting for 10 seconds", Me.CurrentTarget.Name);
Blacklist.Add(Me.CurrentTarget.Guid, TimeSpan.FromSeconds(10));
Me.ClearTarget();
Lua.DoString("PetFollow()");
lastGuid = 0;
break;
}