public override void Pulse() { if (_lastTargetGuid != StyxWoW.Me.CurrentTargetGuid) { _lastTargetGuid = StyxWoW.Me.CurrentTargetGuid; // Don't print this shit if we don't need to. Kthx. if (_lastTargetGuid != 0) { // Add other target switch info stuff here. Logger.WriteDebug("Switched targets!"); Logger.WriteDebug("Melee Distance: " + Spell.MeleeRange); Logger.WriteDebug("Health: " + StyxWoW.Me.CurrentTarget.MaxHealth); Logger.WriteDebug("Level: " + StyxWoW.Me.CurrentTarget.Level); } } // Double cast shit Spell.DoubleCastPreventionDict.RemoveAll(t => DateTime.UtcNow.Subtract(t).TotalMilliseconds >= 2500); PetManager.Pulse(); if (HealerManager.NeedHealTargeting) { HealerManager.Instance.Pulse(); } if (Group.MeIsTank && CurrentWoWContext != WoWContext.Battlegrounds && (Me.IsInParty || Me.IsInRaid)) { TankManager.Instance.Pulse(); } }
public override void Pulse() { PetManager.Pulse(); if (NeedHealTargeting) { HealTargeting.Instance.Pulse(); } if (NeedTankTargeting && CurrentWoWContext != WoWContext.Battlegrounds && (Me.IsInParty || Me.IsInRaid)) { TankTargeting.Instance.Pulse(); } }
public override void Pulse() { // No pulsing if we're loading or out of the game. if (!StyxWoW.IsInGame || !StyxWoW.IsInWorld) { return; } // Update the current context, check if we need to rebuild any behaviors. UpdateContext(); // Double cast shit Spell.DoubleCastPreventionDict.RemoveAll(t => DateTime.UtcNow.Subtract(t).TotalMilliseconds >= 2500); Spell.PulseDoubleCastEntries(); //Only pulse for classes with pets switch (StyxWoW.Me.Class) { case WoWClass.Hunter: case WoWClass.DeathKnight: case WoWClass.Warlock: case WoWClass.Mage: PetManager.Pulse(); break; } if (HealerManager.NeedHealTargeting) { HealerManager.Instance.Pulse(); } if (Group.MeIsTank && CurrentWoWContext != WoWContext.Battlegrounds && (Me.GroupInfo.IsInParty || Me.GroupInfo.IsInRaid)) { TankManager.Instance.Pulse(); } }
public override void Pulse() { #region Pulse - check for conditions that we should not Pulse during /* * if (!StyxWoW.IsInGame) * { * if (DateTime.UtcNow > _nextNotInGameMsgAllowed) * { * Logger.WriteDebug(Color.HotPink, "info: not in game"); * _nextNotInGameMsgAllowed = DateTime.UtcNow.AddSeconds(30); * } * return; * } * _nextNotInGameMsgAllowed = DateTime.MinValue; * * if (!StyxWoW.IsInWorld) * { * if (DateTime.UtcNow > _nextNotInWorldMsgAllowed) * { * Logger.WriteDebug(Color.HotPink, "info: not in world"); * _nextNotInWorldMsgAllowed = DateTime.UtcNow.AddSeconds(30); * } * return; * } * _nextNotInWorldMsgAllowed = DateTime.MinValue; */ #endregion _pulsePhase++; if (_pulsePhase == 1) { if (WaitForLatencyCheck.IsFinished) { Latency = StyxWoW.WoWClient.Latency; WaitForLatencyCheck.Reset(); } // output messages about pulldistance and behaviorflag changes here MonitorPullDistance(); MonitorBehaviorFlags(); /* * // now if combat disabled, bail out * bool combatDisabled = Bots.Grind.BehaviorFlags.Combat != (Bots.Grind.LevelBot.BehaviorFlags & Bots.Grind.BehaviorFlags.Combat); * if (combatDisabled != _lastCombatDisabledState) * { * _lastCombatDisabledState = combatDisabled; * Logger.Write(Color.HotPink, * combatDisabled * ? "info: botbase disabled BehaviorFlags.Combat" * : "info: botbase enabled BehaviorFlags.Combat" * ); * } */ // check time since last call and be sure user knows if Singular isn't being called if (SingularSettings.Debug) { TimeSpan since = CallWatch.TimeSpanSinceLastCall; if (since.TotalSeconds > (4 * CallWatch.SecondsBetweenWarnings)) { if (!Me.IsGhost && !Me.Mounted && !Me.IsFlying && DateTime.UtcNow > _nextNoCallMsgAllowed) { Logger.WriteDebug(Color.HotPink, "info: {0:F0} seconds since {1} BotBase last called Singular", since.TotalSeconds, GetBotName()); _nextNoCallMsgAllowed = DateTime.UtcNow.AddSeconds(4 * CallWatch.SecondsBetweenWarnings); } } } UpdateDiagnosticFPS(); } else if (_pulsePhase == 2) { // talentmanager.Pulse() intense if does work, so return if true if (TalentManager.Pulse()) { return; } // check and output casting state information UpdateDiagnosticCastingState(); UpdatePullMoreConditionals(); // Update the current context, check if we need to rebuild any behaviors. UpdateContext(); } else if (_pulsePhase == 3) { _pulsePhase = 0; // Pulse our StopAt manager StopMoving.Pulse(); PetManager.Pulse(); // Double cast maintenance Spell.MaintainDoubleCast(); HotkeyDirector.Pulse(); WatchAurasForProcs(); } if (Me.Class == WoWClass.Warlock) { ClassSpecific.Warlock.Common.CancelBurningRushIfNeeded(fromPulse: true); } // Output if Target changed CheckCurrentTarget(); // Output if Pet or Pet Target changed CheckCurrentPet(); // check Targeting pulses if (HealerManager.NeedHealTargeting) { BotBase bot = GetCurrentBotBase(); if (bot != null && (bot.PulseFlags & PulseFlags.Targeting) != PulseFlags.Targeting) { HealerManager.Instance.Pulse(); } } else if (TankManager.NeedTankTargeting && Group.MeIsTank) { BotBase bot = GetCurrentBotBase(); if (bot != null && (bot.PulseFlags & PulseFlags.Targeting) != PulseFlags.Targeting) { TankManager.Instance.Pulse(); } } }