Exemplo n.º 1
0
        public override void Start()
        {
            DumpConfiguration();
            _botStartTime = DateTime.Now;
            FishCaught    = new Dictionary <string, uint>();
            LootTargeting.Instance.IncludeTargetsFilter += LootFilters.IncludeTargetsFilter;
            Lua.Events.AttachEvent("LOOT_OPENED", LootFrameOpenedHandler);
            Lua.Events.AttachEvent("LOOT_CLOSED", LootFrameClosedHandler);
            Lua.Events.AttachEvent("UNIT_SPELLCAST_FAILED", UnitSpellCastFailedHandler);

            Coroutines.OnStart();
        }
Exemplo n.º 2
0
        public override void Stop()
        {
            Coroutines.OnStop();

            Log("In {0} days, {1} hours and {2} minutes we have caught",
                (DateTime.Now - _botStartTime).Days,
                (DateTime.Now - _botStartTime).Hours,
                (DateTime.Now - _botStartTime).Minutes);

            foreach (var kv in FishCaught)
            {
                Log("{0} x{1}", kv.Key, kv.Value);
            }

            LootTargeting.Instance.IncludeTargetsFilter -= LootFilters.IncludeTargetsFilter;
            Lua.Events.DetachEvent("LOOT_OPENED", LootFrameOpenedHandler);
            Lua.Events.DetachEvent("LOOT_CLOSED", LootFrameClosedHandler);
            Lua.Events.DetachEvent("UNIT_SPELLCAST_FAILED", UnitSpellCastFailedHandler);

            if (!string.IsNullOrEmpty(_prevProfilePath) && File.Exists(_prevProfilePath))
            {
                ProfileManager.LoadNew(_prevProfilePath);
            }
        }