public void OnPulse() { if (!HookHandler.CheckCombatHook()) { Logger.DBLog.Info("Hooking Combat!"); HookHandler.HookCombat(); } if (FunkyGame.GameIsInvalid) { return; } //in-game monitoring FunkyGame.Profile.CheckCurrentProfileBehavior(); GoldInactivity.CheckTimeoutTripped(); Hotbar.CheckSkills(); Equipment.CheckEquippment(); if (FunkyGame.AdventureMode) { FunkyGame.Bounty.CheckActiveBounty(); } }
internal static void OnBotStart(IBot bot) { if (ZetaDia.IsInGame) { CheckGameIDChange(); } HookHandler.StoreTreeHooks(); //Logger.DBLog.InfoFormat("fBaseXtensions is enabled == {0}", FunkyBaseExtension.PluginIsEnabled); if (FunkyBaseExtension.PluginIsEnabled) { if (FunkyBaseExtension.Settings.Debugging.DebuggingData) { Logger.DBLog.Debug("Loading Debugging Data from Xml"); ObjectCache.DebuggingData = new DebugData(); } if (RoutineManager.Current.Name == "Funky") { Navigator.PlayerMover = new Navigation.PlayerMover(); Navigator.StuckHandler = new Navigation.PluginStuckHandler(); CombatTargeting.Instance.Provider = new PluginCombatTargeting(); LootTargeting.Instance.Provider = new PluginLootTargeting(); ObstacleTargeting.Instance.Provider = new PluginObstacleTargeting(); } FunkyGame.Reset(); //Hotbar.OnSkillsChanged += PlayerClass.HotbarSkillsChangedHandler; GoldInactivity.LastCoinageUpdate = DateTime.Now; GoldInactivity.OnGoldTimeoutTripped += GameCache.GoldInactivityTimerTrippedHandler; Equipment.OnEquippedItemsChanged += Equipment.EquippmentChangedHandler; if (!HookHandler.initTreeHooks) { HookHandler.HookBehaviorTree(); } if (FunkyGame.CurrentStats == null) { FunkyGame.CurrentStats = new Stats.Stats(); } else if (FunkyGame.CurrentStats.Hero != FunkyGame.CurrentHeroName) { //Switched heroes! } } HookEvents(); }
internal static void OnBotStop(IBot bot) { //FunkyGame.CurrentGameID = new GameId(); //FunkyGame.AdventureMode = false; FunkyGame.ShouldRefreshAccountDetails = true; ExitGameBehavior.ShouldExitGame = false; ExitGameBehavior.BehaviorEngaged = false; SetVariableTag.VariableDictionary.Clear(); CharacterControl.ResetVars(); if (FunkyBaseExtension.PluginIsEnabled) { if (RoutineManager.Current.Name == "Funky") { Navigator.PlayerMover = new DefaultPlayerMover(); Navigator.StuckHandler = new DefaultStuckHandler(); } Equipment.OnEquippedItemsChanged -= Equipment.EquippmentChangedHandler; // Issue final reports Stats.Stats.WriteProfileTrackerOutput(ref FunkyGame.CurrentStats); } if (HookHandler.initTreeHooks) { HookHandler.ResetTreehooks(); } UnhookEvents(); ZetaDia.Memory.ClearCache(); CharacterControl.GameDifficultyChanged = false; CharacterSettings.Instance.GameDifficulty = CharacterControl.OrginalGameDifficultySetting; }