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.

[TBC] Bot enters regen state during ObjectManager.Me.InCombat

  • Version: All
  • Product: WRobot General
  • Type: Bug
  • Status: Not a Bug

Sometimes, you are still in combat with some mobs. However the bot will still enter combat state. This happens for example if you polymorph one attacker or if you call Fight.StopFight() (maybe because you want to cancel the fightclass to run away from the fight).

The bot should not try to enter regen while still in combat and the bot should STOP regen if it's being attacked.

User Feedback

Recommended Comments

Matenia

Elite user
(edited)

Example screenshot of this: 

kENkfsx.jpg

Quote

[D] 10:54:43 - successfully casted: Ice Barrier
10:54:44 - [Regen] Use drink Conjured Sparkling Water
10:54:58 - [Regen] Finished
10:54:59 - [Fight] Player attack before being attacked by Rock Stalker (lvl 58)
[D] 10:55:30 - [MovementManager] Avoid wall: StrafeLeft
[D] 10:55:32 - [MovementManager] Current pos: -7508,243 ; 1112,508 ; -1,46689 ; "None" - Target pos: -7504,142 ; 1107,832 ; -0,9357554 ; "None" Continent: Kalimdor Tile: 29.91405_46.07796
[D] 10:55:32 - [StuckResolver] Started.
[D] 10:55:35 - [StuckResolver] Done - Stuck count updated, new value: 13.
[D] 10:55:37 - [Fight] Mob seem bugged
[D] 10:55:38 - [Fight] Fight stopped
10:55:38 - [Resurrect] Player dead

This is a log of it just standing around and not fighting back. Potentially, this could be caused by me, but I don't think so.
What could cause stucking in MovementManager when there is not even any walls around?

Edited by Matenia

Matenia

Elite user
(edited)

For testing, I tried using this code (calling start and stop from a plugin).
But nothing is ever logged, so I think ObjectManager.Me.InCombat is incorrectly returning false. It should be the same as this.

 

public static bool AffectingCombat(this WoWLocalPlayer me)
{
  return Lua.LuaDoString<bool>(@"return (UnitAffectingCombat(""player"") ~= nil)");
}
public class RegenStop
{

    private static WoWLocalPlayer Me = ObjectManager.Me;
    private static Engine engine;
    private static Regeneration regeneration = new Regeneration();

    public static void Start()
    {
        FiniteStateMachineEvents.OnStartEngine += (Engine engine) => {
            RegenStop.engine = engine;
        };
        FiniteStateMachineEvents.OnRunState += AntiRegenEventHandler;
        FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += AntiRegenEventHandler;
    }

    public static void Stop()
    {
        FiniteStateMachineEvents.OnRunState -= AntiRegenEventHandler;
        FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState -= AntiRegenEventHandler;
    }

    private static void AntiRegenEventHandler(Engine engine, State state, CancelEventArgs cancelable)
    {
        if (state.DisplayName == "Regeneration" && Me.InCombat)
        {

            Logging.WriteDebug("cancelling regen while in combat");
            cancelable.Cancel = true;

            RegenStop.engine.RemoveStateByName("Regeneration");
            ReenableRegen();
        }
    }

    private static async void ReenableRegen()
    {
        await Task.Delay(10000);
        engine.AddState(regeneration);
    }
}

 

Edited by Matenia

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.