Пример #1
0
        /// <summary>
        /// Start to receive events to our event table
        /// and start the event reader that will fire
        /// events if they apper in our event table.
        ///
        /// Events will get read every 1000 ms by now.
        /// </summary>
        public void Init()
        {
            StringBuilder luaStuff = new StringBuilder();

            luaStuff.Append("abFrame = CreateFrame(\"FRAME\", \"AbotEventFrame\") ");
            luaStuff.Append("abEventTable = {} ");
            luaStuff.Append("function abEventHandler(self, event, ...) ");
            luaStuff.Append("table.insert(abEventTable, {time(), event, {...}}) end ");
            luaStuff.Append("if abFrame:GetScript(\"OnEvent\") == nil then ");
            luaStuff.Append("abFrame:SetScript(\"OnEvent\", abEventHandler) end");
            AmeisenCore.LuaDoString(luaStuff.ToString());

            IsActive = true;

            EventReader.Start();
            // if we equip an item confirm the dialog
            AmeisenCore.EnableAutoBoPConfirm();
        }