fBaseXtensions.EventHandling.OnBotStart C# (CSharp) Method

OnBotStart() static private method

static private OnBotStart ( IBot bot ) : void
bot IBot
return void
        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();
        }

Usage Example

Exemplo n.º 1
0
        public void OnEnabled()
        {
            UIControl.InstallSettingsButton();
            _pluginenabled = true;
            Logger.DBLog.InfoFormat("fBaseXtensions v{0} has been enabled!", Version.ToString());

            if (BotMain.IsRunning)
            {
                EventHandling.OnBotStart(null);
            }
        }