Jump to content
This site uses cookies! Learn More

This site uses cookies!

By continuing to use this site, you agree to allow us to store cookies on your computer. :)

  • 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

    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.

    Share this comment


    Link to comment
    Share on other sites
    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?

    Share this comment


    Link to comment
    Share on other sites

    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");
    });

     

    Share this comment


    Link to comment
    Share on other sites


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...