Exemplo n.º 1
0
        public void Start()
        {
            Log.Debug("[Summoner] Start");

            // load default taskmanager
            _taskManager = (TaskManager)BotManager.CurrentBot.Execute("GetTaskManager");
            if (_taskManager == null)
            {
                Log.Error("[Summoner] Fail to get the global TaskManager.");
                BotManager.Stop();
                return;
            }

            // add Summoner task
            if (!_taskManager.AddBefore(new SummonerTask(), "CombatTask (Leash 50)"))
            {
                Log.Error("[Summoner] Failed to add Task 'SummonerTask'.");
            }
        }
Exemplo n.º 2
0
        private void AddTask(ITask task, string name, AddType type)
        {
            bool added = false;

            switch (type)
            {
            case AddType.Before:
                added = _taskManager.AddBefore(task, name);
                break;

            case AddType.After:
                added = _taskManager.AddAfter(task, name);
                break;

            case AddType.Replace:
                added = _taskManager.Replace(name, task);
                break;
            }
            if (!added)
            {
                Log.ErrorFormat("[Summoner] Fail to add \"{0}\".", name);
                BotManager.Stop();
            }
        }