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.

Regeneration state events

  • Version: All
  • Product: WRobot General
  • Type: Suggestion
  • Status: Added

The `Regeneration` state should have event handlers (`Start`/`Loop`/`End`) in order to allow plugins / fight classes to execute rotations. The use case is as following:

 

- The bot doesn't have food

- The bot needs to regenerate HP but has mana

 

In theory the FC could spam heals / potions if they are available, and it would be quite elegant to implement this if special events are added. I know that `FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState` / `FiniteStateMachineEvents.OnRunState` could be used but I think that native events would be cleaner (it also saves everyone from reinventing the wheel and building boiler plate around the FSM system).

User Feedback

Recommended Comments

Hello,

Start > robotManager.Events.FiniteStateMachineEvents.OnRunState

Loop > robotManager.Events.FiniteStateMachineEvents.OnRunningLoopState (you need to wait next update)

End > robotManager.Events.FiniteStateMachineEvents.OnAfterRunState

robotManager.Events.FiniteStateMachineEvents.OnRunningLoopState += (state, cancel) =>
{
    if (state.DisplayName == "Regeneration")
    {
        // ...
    }
};

// OR

robotManager.Events.FiniteStateMachineEvents.OnRunningLoopState += (state, cancel) =>
{
    if (state is wManager.Wow.Bot.States.Regeneration)
    {
        // ...
    }
};

// I also add OnCustomEvent, you can create your own event like that robotManager.Events.Events.CustomEventCancelable("Event Name", new object[] { "arg1", "arg2" });
robotManager.Events.Events.OnCustomEvent += (name, args, cancelable) =>
{
    if (name == "ItemsManager.UseItem")
    {
        var itemName = (string)args[0];
    }
    else if (name == "SpellManager.CastSpellByNameLUA")
    {
        var spellName = (string)args[0];
    }
    // ...
};

 

Hashira

Elite user

Super cool. Is there a list of pre-registered events for `robotManager.Events.Events.CustomEventCancelable` or does it apply to any library function by default ?

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.