What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

How exactly does blacklist.add work?

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.

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;
            }
 
If you get attacked by a pet wow autmatically set's ure target to the pet and then the bot will try to kill it

My issue is more that the bot targets a player that is blacklisted over and over. It targets, clears, targets, clears, etc.
 
Back
Top