Jump to content

Bot is drinking twice or more C#


BetterSister

Recommended Posts

Currently when i use this to drink it will usually drink twice or more (i don't know how cuz i can't do that manually) and then doesn't wait till mana is full

            if (ObjectManager.Me.ManaPercentage > 40 || ObjectManager.Me.InCombat || ObjectManager.Me.HaveBuff("Drink"))
            {
                Logging.WriteDebug("drinking false");
                return false;
            }
            Logging.WriteDebug("drinking now");
            ItemsManager.UseItem(RestoDruidSettings.CurrentSetting.Drinking);

            while (ObjectManager.Me.HaveBuff("Drink") && ObjectManager.Me.ManaPercentage < 100)
            {
                Logging.WriteDebug("we're sleeping");
                Thread.Sleep(1000);
            }
            return false;
        }
[D] 11:35:45 - drinking false
[D] 11:35:45 - drinking false
[D] 11:35:45 - drinking false
[D] 11:35:45 - drinking false
[D] 11:35:45 - drinking false
[D] 11:35:46 - drinking false
[D] 11:35:46 - drinking false
[D] 11:35:46 - drinking false
[D] 11:35:46 - drinking false
[D] 11:35:46 - drinking false
[D] 11:35:46 - drinking false
[D] 11:35:46 - drinking false
[F] 11:35:47 - [Spell] Cast Regrowth (Regrowth)
[D] 11:35:49 - drinking false
11:35:49 - [Looting] Loot Earthborer
[N] 11:35:49 - [Path-Finding] Path Count: 2
[F] 11:35:49 - [Spell] Cast Rejuvenation (Rejuvenation)
[D] 11:35:50 - drinking now
[D] 11:35:50 - drinking now
[D] 11:35:50 - drinking now
[D] 11:35:50 - drinking now
[D] 11:35:50 - drinking now
[D] 11:35:50 - drinking now
[D] 11:35:50 - drinking now
[D] 11:35:50 - drinking now
[D] 11:35:50 - drinking now
[D] 11:35:51 - drinking now
[D] 11:35:51 - drinking now
[D] 11:35:51 - drinking now
[D] 11:35:51 - drinking now
[D] 11:35:51 - drinking now
[D] 11:35:52 - drinking now
[D] 11:35:52 - drinking now
[D] 11:35:52 - drinking now
[D] 11:35:52 - drinking now
[D] 11:35:52 - drinking now
[D] 11:36:13 - drinking false
[D] 11:36:13 - drinking false
[D] 11:36:13 - drinking false
[D] 11:36:13 - drinking false
[D] 11:36:13 - drinking false

Apparently it ignores the "Drink" buff entirely and uses the item many times. Why?

Link to comment
Share on other sites

  • 2 weeks later...
35 minutes ago, Chas3down said:

Debug buffs through wrobot to see if the problem is with "Drink"

it probably doesn't detect "Drink" buff properly because with this code it never detected the buff "Drink"

                if (ObjectManager.Me.HaveBuff("Drink"))
                {
                    Logging.WriteDebug("We have Drink buff");
                }

Link to comment
Share on other sites

3 minutes ago, betterSister said:

it probably doesn't detect "Drink" buff properly because with this code it never detected the buff "Drink"

                if (ObjectManager.Me.GetBuff("Drink"))
                {
                    Logging.WriteDebug("We have Drink buff");
                }

Debug all your buffs to the logger to see if it's just called something else in wrobot(though I don't see why it would) or you can use buff ID (if that's implemented in wrobot)

Link to comment
Share on other sites

26 minutes ago, Chas3down said:

Debug all your buffs to the logger to see if it's just called something else in wrobot(though I don't see why it would) or you can use buff ID (if that's implemented in wrobot)

Wrong code.. fixed it :D but it still doesn't detect

Link to comment
Share on other sites

5 hours ago, betterSister said:

Now Regen is eating 1 food every 2sec even if it's already eating

I saw this issue today for the first time, It isn't an everytime occurrence for me, was just when a certain set of parameters were met, I just restarted bot and it worked fine.(I can't remember the parameters, I can test more if needed)

 

note this was not with a custom regen class like I am assuming he is using.

Link to comment
Share on other sites

It floods the item untill it reaches around 90% mana or hp and sometimes doesn't continue from there. Happent most of the time while using my 1-13 quester and mage food (muffins and what the drink item name is.. I'll check them when i get home) 

Link to comment
Share on other sites

21 minutes ago, betterSister said:

Last time i tried it didn't detect the buff. I will be home in 9 hours then i can try to debug it more

Just make a quick script to display all buff IDs , find drink id and use it

could be differnt the wowhead one or something maybe? So find it manually

Link to comment
Share on other sites

8 minutes ago, Brian said:

Just make a quick script to display all buff IDs , find drink id and use it

could be differnt the wowhead one or something maybe? So find it manually

If you're at computer could you write the script before i get home? 

Link to comment
Share on other sites

i wrote a quick plugin to see if checking the buffs work. For me it does now detect them properly

using robotManager.Helpful;
using robotManager.Products;
using System;
using System.Threading;
using wManager.Plugin;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
using Timer = robotManager.Helpful.Timer;

public class Main : IPlugin
{
    private bool _isLaunched;
    public void Dispose()
    {
        _isLaunched = false;
        Logging.Write("Drink and eat debuger by betterSister disabled");
    }

    public void Initialize()
    {
        _isLaunched = true;
        Logging.Write("Drink and eat debuger by betterSister enabled");
        var timer = new Timer(5 * 1000);
        while (_isLaunched && Products.IsStarted)
        {
            try
            {
                if (timer.IsReady && Conditions.InGameAndConnectedAndProductStartedNotInPause)
                {
                    if (ObjectManager.Me.HaveBuff("Food"))
                    {
                        Logging.WriteDebug("We have Food buff");
                    }
                    if (ObjectManager.Me.HaveBuff("Drink"))
                    {
                        Logging.WriteDebug("We have Drink buff");
                    }
                    if (!ObjectManager.Me.HaveBuff("Drink") && !ObjectManager.Me.HaveBuff("Food"))
                    {
                        Logging.WriteDebug("We don't have Drink or Food buffs");
                    }
                }
            }
            catch (Exception e)
            {
                Logging.WriteDebug("ERROR ON DRINK EAT DEBUGER: " + e);
            }
            Thread.Sleep(150);
        }
    }
    public void Settings()
    {
        Logging.WriteDebug("We don't have 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...