BosslandGmbH / BuddyWing

BuddyWing is the bot for Star Wars: The Old Republic. This repository contains the open-source components that power the bot.
4 stars 2 forks source link

Duplicate Buff entries #28

Closed cassrgs closed 8 years ago

cassrgs commented 8 years ago

Some buffs with stacks are showing twice with different ids

One of those ids doesnt count the stacks the other do count.

This is making the bot randomly recognize or not recognize the buff with stacks when using Me.Buffcount on the routines.

Classes affected Assassin Darkness. Sorcerer Madness and their republic counterparts

Wired203 commented 8 years ago

It would probably help if you can identify a specific buff and show the 2 different ID's on it so he knows exactly what he's looking for.

cassrgs commented 8 years ago

the id changes each time any buff goes out and its cast again, as we can see below

[DefaultCombat] Rotation Paused

MYSELF# -> Buff Name: Coordination ID: 157009061186

MYSELF# -> Buff Name: Mark of Power ID: 157009061189

MYSELF# -> Buff Name: Unnatural Might ID: 157009061194

MYSELF# -> Buff Name: Hunter's Boon ID: 157009061197

#MYSELF# -> Buff Name: Harnessed Darkness ID: 157009388541

MYSELF# -> Buff Name: Dark Charge ID: 157009392276

MYSELF# -> Buff Name: Sprint ID: 157009061498

MYSELF# -> Buff Name: Exploitive Strikes ID: 157009392290

MYSELF# -> Buff Name: Dark Charge ID: 157009061515

#MYSELF# -> Buff Name: Harnessed Darkness ID: 157009390352 Hotkey pressed: Pause Rotation (F8) [DefaultCombat] Rotation Resumed Hotkey pressed: Pause Rotation (F8) [DefaultCombat] Rotation Paused

MYSELF# -> Buff Name: Coordination ID: 157009061186

MYSELF# -> Buff Name: Mark of Power ID: 157009061189

MYSELF# -> Buff Name: Unnatural Might ID: 157009061194

MYSELF# -> Buff Name: Hunter's Boon ID: 157009061197

#MYSELF# -> Buff Name: Harnessed Darkness ID: 157009393458

MYSELF# -> Buff Name: Dark Charge ID: 157009393328

MYSELF# -> Buff Name: Sprint ID: 157009061498

MYSELF# -> Buff Name: Training Dummy ID: 157009393484

MYSELF# -> Buff Name: Dark Protection ID: 157009393355

MYSELF# -> Buff Name: Dark Charge ID: 157009061515

MYSELF# -> Buff Name: Exploitive Strikes ID: 157009393427

MYSELF# -> Buff Name: Conspirator's Cloak ID: 157009393741

#MYSELF# -> Buff Name: Harnessed Darkness ID: 157009393812

also on extension.cs on helpers of defaultcombat the buffcount function gets only the first entry and have no check in case the buff count its 0

public static int BuffCount(this TorCharacter p, string buffName) { return !p.HasMyBuff(buffName) ? 0 : p.Buffs.FirstOrDefault(b => b.Name.Contains(buffName) && b.CasterGuid == BuddyTor.Me.Guid).GetStacks(); }

i guess it would be needed to use another kind of LINQ function to get the second entry of the buff and this issue should be moved to the defaulcombat github instead of here

aevitas commented 8 years ago

We can add a method that takes all occurrences of a specific buff name, something along the lines of

BuddyTor.Me.Buffs.Count(s => s.Name.Equals("Harnessed Darkness")

For obvious reasons, this can't be the default behaviour (because it doesn't work for spells that actually have stacks opposed to multiple instances of the same spell), but it can definitely be an addition if the game decided to use this behaviour.

aevitas commented 8 years ago

Implemented IList<TorEffect> GetBuffsByName(string name) in TorCharacter - int buffCount = GetBuffsByName("Some buff").Count; will return the total amount of spells with the specified name active on the character at any given time.