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.

Executing Lua code only once after I die

Featured Replies

Is there any way in my fight class to execute Lua code, whenever I die, once?
I want it to call ReloadUI() to prevent the combat rotation from stopping randomly on a MoP client.

 

I tried some custom scripts, but the bot never executed them (and there is that issue of only doing it ONCE too).

Hello,

in the fightclass editor, in "Additionnal C# code" (top left) put this code:

    static Main()
    {
        bool lastState = false;

        while (Conditions.ProductIsStarted)
        {
            if (Conditions.InGameAndConnectedAndProductStartedNotInPause &&
                !Conditions.IsAttackedAndCannotIgnore)
            {
                if (lastState && !ObjectManager.Me.IsDeadMe)
                {
                    Logging.WriteDebug("Retrieve corpse, ReloadUI");
                    Lua.LuaDoString("ReloadUI()");
                }
                lastState = ObjectManager.Me.IsDeadMe;
            }
            Thread.Sleep(100);
        }
    }

 

  • Author

That bugs it entirely, so the bot only keeps working if I turn it on/off (for one fight, but it doesn't run unless I turn it on, and doesn't fight unless I turn it off).
Probably a multithreading issue.

But it's okay, I'll use this to write a custom plugin instead.

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.