Jump to content

Not repairing items if only one items is broken?


Recommended Posts

Hello. i have a problem botting paladins, they refuse to repair items if only one item is broken for example, if it happens to his Weapon, it cause some problems, paladin is still strong enough to kill enemies with magic, and he cant get less durability cause he's not dying, but ofc grind is way to slow with that, Is it really true that wrobot Force repair run only after total durability check of all items?

Link to comment
Share on other sites

Hello, try plugin like (no tested):

 

using System.ComponentModel;
using robotManager.FiniteStateMachine;
using robotManager.Helpful;
using wManager.Wow.Bot.States;
using wManager.Wow.Helpers;
using Timer = robotManager.Helpful.Timer;

public class Main : wManager.Plugin.IPlugin
{
    public void Initialize()
    {
        var t = new Timer(5 * 5000);
        robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += delegate (Engine engine, State state, CancelEventArgs cancelable)
        {
            try
            {
                if (t.IsReady &&
                    Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause &&
                    !Conditions.IsAttackedAndCannotIgnore &&
                    state.DisplayName == "To Town")
                {
                    t.Reset();
                    // https://wowwiki.fandom.com/wiki/API_GetInventoryItemDurability
                    if (!ToTown.ForceToTown &&
                        Lua.LuaDoString<double>(
                            @"local current, maximum = GetInventoryItemDurability(16);
                                    if not maximum then
                                        return 1
                                    end
                                    if not current then
                                        return 0;
                                    end
                                    return maximum / current;") < 0.1)
                    {
                        Logging.Write("Force go to town weapon broken");
                        ToTown.ForceToTown = true;
                    }
                }
            }
            catch { }
        };
    }

    public void Dispose()
    {
    }

    public void Settings()
    {
    }
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...