Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wrong Lua events

  • 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.

Matenia

Elite user

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

Matenia

Elite user
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

Elite user

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.