/// <summary> /// Adds our current target to our listOfHealableUnits /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void addHealableUnit_Click(object sender, EventArgs e) { try { // Add a couple of HealableUnits to the list. if (Me.CurrentTarget != null && HealableUnit.Filter(Me.CurrentTarget)) { if (!HealableUnit.Contains(Me.CurrentTarget)) { CLULogger.TroubleshootLog(" Adding: {0} because of user request.", CLULogger.SafeName(Me.CurrentTarget)); HealableUnit.ListofHealableUnits.Add(new HealableUnit(Me.CurrentTarget)); } } else { MessageBox.Show( "Please make sure that you have a CurrentTarget", "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } this.RefreshDataGridView(); } catch (Exception ex) { CLULogger.DiagnosticLog("addHealableUnit_Click : {0}", ex); } }
/// <summary> /// Update the listOfHealableUnits /// </summary> private void updateListofHealableUnitsGrid_Click(object sender, EventArgs e) { CLULogger.TroubleshootLog("User clicked update - Re-Initialize list Of HealableUnits"); HealableUnit.ListofHealableUnits.Clear(); switch (CLUSettings.Instance.SelectedHealingAquisition) { case HealingAquisitionMethod.Proximity: HealableUnit.HealableUnitsByProximity(); break; case HealingAquisitionMethod.RaidParty: HealableUnit.HealableUnitsByPartyorRaid(); break; } }
public override void Pulse() { Spell.PulseDoubleCastEntries(); if (!Me.IsValid || !StyxWoW.IsInGame) { return; } PulseHander handler = this.PulseEvent; if (handler != null) { handler(); } switch (StyxWoW.Me.Class) { case WoWClass.Hunter: case WoWClass.DeathKnight: case WoWClass.Warlock: case WoWClass.Mage: PetManager.Pulse(); break; } if (IsHealerRotationActive) { HealableUnit.Pulse(); // } else { // Make sure we have the proper target from Targeting. // The Botbase should give us the best target in targeting. var firstUnit = Targeting.Instance.TargetList.OrderBy(o => o.Distance).FirstOrDefault(q => !q.IsFriendly && q.IsAlive && !q.IsPet && !q.IsPetBattleCritter); if (CLUSettings.Instance.EnableTargeting && firstUnit != null && (Me.CurrentTarget == null || Me.CurrentTarget.IsDead || !Me.CurrentTarget.IsAlive || !Me.CurrentTarget.IsHostile) && firstUnit.IsHostile) { if (StyxWoW.Me.CurrentTarget != firstUnit) { firstUnit.Target(); } } } }
public void Player_OnMapChanged(BotEvents.Player.MapChangedEventArgs args) { try { if ((CLU.LocationContext == GroupLogic.Battleground || CLU.LocationContext == GroupLogic.PVE) && TalentManager.CurrentSpec != WoWSpec.DruidFeral) { DetachCombatLogEvent(); } else { AttachCombatLogEvent(); } //Why would we create same behaviors all over ? if (CLU.LastLocationContext == CLU.LocationContext) { return; } CLULogger.TroubleshootLog("Context changed. New context: " + CLU.LocationContext + ". Rebuilding behaviors."); CLU.Instance.CreateBehaviors(); if (CLU.IsHealerRotationActive && StyxWoW.IsInGame) { CLULogger.TroubleshootLog("CombatLogEvents: Party Members Changed - Re-Initialize list Of HealableUnits"); switch (CLUSettings.Instance.SelectedHealingAquisition) { case HealingAquisitionMethod.Proximity: HealableUnit.HealableUnitsByProximity(); break; case HealingAquisitionMethod.RaidParty: HealableUnit.HealableUnitsByPartyorRaid(); break; } } } catch (Exception ex) { CLULogger.DiagnosticLog("Player_OnMapChanged : {0}", ex); } }
private void HandlePartyMembersChanged(object sender, LuaEventArgs args) { try { if (CLU.IsHealerRotationActive && StyxWoW.IsInGame) { CLULogger.TroubleshootLog("CombatLogEvents: Party Members Changed - Re-Initialize list Of HealableUnits"); switch (CLUSettings.Instance.SelectedHealingAquisition) { case HealingAquisitionMethod.Proximity: HealableUnit.HealableUnitsByProximity(); break; case HealingAquisitionMethod.RaidParty: HealableUnit.HealableUnitsByPartyorRaid(); break; } } } catch (Exception ex) { CLULogger.DiagnosticLog("HandlePartyMembersChanged : {0}", ex); } }
/// <summary> /// Prune the listOfHealableUnits that meet a criteria /// </summary> private void pruneUnitHealingGrid_Click(object sender, EventArgs e) { HealableUnit.Remove(); HealingGrid.Refresh(); }
public override void Initialize() { CLULogger.TroubleshootLog("Attatching BotEvents"); BotEvents.OnBotStarted += CombatLogEvents.Instance.CombatLogEventsOnStarted; BotEvents.OnBotStopped += CombatLogEvents.Instance.CombatLogEventsOnStopped; BotEvents.OnBotChanged += CombatLogEvents.Instance.BotBaseChange; BotEvents.Player.OnMapChanged += CombatLogEvents.Instance.Player_OnMapChanged; RoutineManager.Reloaded += RoutineManagerReloaded; /////////////////////////////////////////////////////////////////// // Start non invasive user information /////////////////////////////////////////////////////////////////// CLULogger.TroubleshootLog("Character level: {0}", Me.Level); CLULogger.TroubleshootLog("Character Faction: {0}", Me.IsAlliance ? "Alliance" : "Horde"); CLULogger.TroubleshootLog("Character Race: {0}", Me.Race); CLULogger.TroubleshootLog("Character Mapname: {0}", Me.MapName); CLULogger.TroubleshootLog("GroupType: {0}", GroupType.ToString()); CLULogger.TroubleshootLog("LocationContext: {0}", LocationContext.ToString()); // Talents CLULogger.TroubleshootLog("Retrieving Talent Spec"); try { TalentManager.Update(); } catch (Exception e) { StopBot(e.ToString()); } CLULogger.TroubleshootLog(" Character Current Build: {0}", TalentManager.CurrentSpec.ToString()); // Intialize Behaviors....TODO: Change this ? if (_combatBehavior == null) { _combatBehavior = new PrioritySelector(); } if (_combatBuffBehavior == null) { _combatBuffBehavior = new PrioritySelector(); } if (_preCombatBuffBehavior == null) { _preCombatBuffBehavior = new PrioritySelector(); } if (_pullBehavior == null) { _pullBehavior = new PrioritySelector(); } if (_restBehavior == null) { _restBehavior = new PrioritySelector(); } // Behaviors if (!CreateBehaviors()) { return; } CLULogger.TroubleshootLog(" Behaviors created!"); // Racials CLULogger.TroubleshootLog("Retrieving Racial Abilities"); foreach (WoWSpell racial in Racials.CurrentRacials) { CLULogger.TroubleshootLog(" Character Racial Abilitie: {0} ", racial.Name); } CLULogger.TroubleshootLog(" {0}", Me.IsInInstance ? "Character is currently in an Instance" : "Character seems to be outside an Instance"); CLULogger.TroubleshootLog(" {0}", StyxWoW.Me.CurrentMap.IsArena ? "Character is currently in an Arena" : "Character seems to be outside an Arena"); CLULogger.TroubleshootLog(" {0}", StyxWoW.Me.CurrentMap.IsBattleground ? "Character is currently in a Battleground " : "Character seems to be outside a Battleground"); CLULogger.TroubleshootLog(" {0}", StyxWoW.Me.CurrentMap.IsDungeon ? "Character is currently in a Dungeon " : "Character seems to be outside a Dungeon"); CLULogger.TroubleshootLog("Character HB Pull Range: {0}", Targeting.PullDistance); /////////////////////////////////////////////////////////////////// // END non invasive user information /////////////////////////////////////////////////////////////////// // Create the new List of HealableUnit type. CLULogger.TroubleshootLog("Initializing list of HealableUnits"); switch (CLUSettings.Instance.SelectedHealingAquisition) { case HealingAquisitionMethod.Proximity: HealableUnit.HealableUnitsByProximity(); break; case HealingAquisitionMethod.RaidParty: HealableUnit.HealableUnitsByPartyorRaid(); break; } CLULogger.TroubleshootLog(" {0}", IsHealerRotationActive ? "Healer Base Detected" : "No Healer Base Detectected"); // Initialize Botchecks CLULogger.TroubleshootLog("Initializing Bot Checker"); BotChecker.Initialize(); CLULogger.TroubleshootLog("Initializing Sound Player"); SoundManager.Initialize(); CLULogger.TroubleshootLog("Initializing Keybinds"); this._clupulsetimer.Interval = 1000; // 1second this._clupulsetimer.Elapsed += ClupulsetimerElapsed; // Attatch this._clupulsetimer.Enabled = true; // Enable this._clupulsetimer.AutoReset = true; // To keep raising the Elapsed event GC.KeepAlive(this._clupulsetimer); //TroubleshootLog("Initializing DpsMeter"); //DpsMeter.Initialize(); CLULogger.TroubleshootLog("Initialization Complete"); }