Jump to content
  • Wrong Lua events


    Matenia
    • Version: All Product: WRobot General Type: Bug Status: Cannot Reproduce

    Test on Vanilla 1.12.1 and TBC 2.4.3

    Following code is executed all the time during combat (especially on Vanilla - not so much going wrong on TBC).

    EventsLua.AttachEventLua(LuaEventsId.PLAYER_DEAD, m => {
      LastDeath = DateTime.Now;
      Logging.WriteDebug("Died, set new timestamp for last death");
    });

     



    User Feedback

    Recommended Comments

    Droidz

    Posted

    Hello, i cannot reproduce problem, to test if it is not wow or server bug, try to run this code:

    local f  = CreateFrame('Frame')
    f:RegisterAllEvents()
    f:SetScript('OnEvent',
        function()
            if event and tostring(event) == 'PLAYER_DEAD' then
    			DEFAULT_CHAT_FRAME:AddMessage("DEADDDDD")
            end
        end
    )

    And check if when WRobot detect "PLAYER_DEAD" event, this event appear also in Wow.

    Matenia

    Posted

    After testing, it seems it is fired more often in C# events than ingame.

    Matenia

    Posted

    public static void Start()
        {
            EventsLuaWithArgs.OnEventsLuaWithArgs += AntiDrownEventHandler;
        }
    
        public static void Stop()
        {
            EventsLuaWithArgs.OnEventsLuaWithArgs -= AntiDrownEventHandler;
        }
    
        private static void AntiDrownEventHandler(LuaEventsId id, List<string> args)
        {
            
            if (id == LuaEventsId.MIRROR_TIMER_START)
            {
                Logging.WriteDebug(args[0] + "  " + args[1]);
            }
            if (id == LuaEventsId.MIRROR_TIMER_START && args[0] == "BREATH")
            {
                //sets BreathExpires to be in the future by x milliseconds
                BreathExpires = DateTime.Now.AddMilliseconds(double.Parse(args[1]));
                Logging.WriteDebug("Breath has " + double.Parse(args[1]) + " milliseconds left");
            }
        }

    This code is also "bugged". Ingame Lua event handler: works perfectly, it shows event id, "BREATH" and even 4 arguments.
    But using this in the bot, it's never called.

    @Droidz maybe you need to add this event manually?

    Matenia

    Posted

    For anyone wondering, this works:

    EventsLua.AttachEventLua((LuaEventsId)Enum.Parse(typeof(LuaEventsId), "PLAYER_DEAD"), m => {
      LastDeath = DateTime.Now;
      Logging.WriteDebug("Died, set new timestamp for last death");
    });

     



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...