Jump to content

Automatic rebuff - why doesn't it work


Seminko

Recommended Posts

Heya,

i have put together a quick custome profile from bits and pieces around the forum.

It doesn't give any error but does not buff me at all.

Any ideas?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.ComponentModel;
using System.Diagnostics;
using System.Threading;

using robotManager.Helpful;
using robotManager.Products;

using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;

public class CustomProfile : Custom_Profile.ICustomProfile
{
    private bool isRunning;
    private static WoWLocalPlayer Me = ObjectManager.Me;

    public void Pulse()
    {
		while (isRunning)
		{
				if (!Me.HaveBuff("Arcane Intellect"))// && //!ObjectManager.Me.InCombat
				{
					SpellManager.CastSpellByNameLUA("Arcane Intellect");
					Logging.WriteDebug("Buffed [Arcane Intellect]");
					Thread.Sleep(Usefuls.Latency + 600);
				}
				if (!Me.HaveBuff("Frost Armor"))// && !ObjectManager.Me.InCombat
				{
					SpellManager.CastSpellByNameLUA("Frost Armor");
					Logging.WriteDebug("Buffed [Frost Armor]");
					Thread.Sleep(Usefuls.Latency + 600);
				}
				if (!Me.HaveBuff("Dampen Magic"))// && !ObjectManager.Me.InCombat
				{
					SpellManager.CastSpellByNameLUA("Dampen Magic");
					Logging.WriteDebug("Buffed [Dampen Magic]");
					Thread.Sleep(Usefuls.Latency + 600);
				}
				Thread.Sleep(1000);
		}
    }

    public void Dispose()
    {
        Logging.Write("Buffer stopped.");
    }
}

 

Link to comment
Share on other sites

1 hour ago, Droidz said:

Hello, you never put "true" at "isRunning"

I updated it. It says it buffed me but it didn't.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.ComponentModel;
using System.Diagnostics;
using System.Threading;

using robotManager.Helpful;
using robotManager.Products;

using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;

public class CustomProfile : Custom_Profile.ICustomProfile
{
    private static WoWLocalPlayer Me = ObjectManager.Me;

    public void Pulse()
    {
		if (!Me.HaveBuff("Arcane Intellect"))// && //!ObjectManager.Me.InCombat
		{
			SpellManager.CastSpellByNameLUA("Arcane Intellect");
			Logging.WriteDebug("Buffed [Arcane Intellect]");
			Thread.Sleep(Usefuls.Latency + 600);
		}
		if (!Me.HaveBuff("Frost Armor"))// && !ObjectManager.Me.InCombat
		{
			SpellManager.CastSpellByNameLUA("Frost Armor");
			Logging.WriteDebug("Buffed [Frost Armor]");
			Thread.Sleep(Usefuls.Latency + 600);
		}
		if (!Me.HaveBuff("Dampen Magic"))// && !ObjectManager.Me.InCombat
		{
			SpellManager.CastSpellByNameLUA("Dampen Magic");
			Logging.WriteDebug("Buffed [Dampen Magic]");
			Thread.Sleep(Usefuls.Latency + 600);
		}
		Thread.Sleep(1000);
    }

    public void Dispose()
    {
        Logging.Write("Buffer stopped.");
    }
}

 

Link to comment
Share on other sites

Updated the script again, but it only buffs once. Don't know how to make it check for the buffs repeatedly.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.ComponentModel;
using System.Diagnostics;
using System.Threading;

using robotManager.Helpful;
using robotManager.Products;

using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;

public class CustomProfile : Custom_Profile.ICustomProfile
{
    public void Pulse()
    {
		try
        {
            Buffer.Pulse();
        }
        catch (Exception e)
        {
            Logging.WriteError("CustomProfile > Pulse(): " + e);
        }
    }

    public void Dispose()
    {
        try
        {
            Buffer.Dispose();
        }
        catch (Exception e)
        {
            Logging.WriteError("CustomProfile > Dispose(): " + e);
        }
    }
}

internal static class Buffer
{
	public static bool Pulse()
	{
		try
		{
			if (!ObjectManager.Me.HaveBuff("Arcane Intellect") && !ObjectManager.Me.InCombat)
			{
				SpellManager.CastSpellByNameLUA("Arcane Intellect");
				Logging.WriteDebug("Buffed [Arcane Intellect]");
				Thread.Sleep(Usefuls.Latency + 1600);
			}
			if (!ObjectManager.Me.HaveBuff("Frost Armor") && !ObjectManager.Me.InCombat)
			{
				SpellManager.CastSpellByNameLUA("Frost Armor");
				Logging.WriteDebug("Buffed [Frost Armor]");
				Thread.Sleep(Usefuls.Latency + 1600);
			}
			if (!ObjectManager.Me.HaveBuff("Dampen Magic") && !ObjectManager.Me.InCombat)
			{
				SpellManager.CastSpellByNameLUA("Dampen Magic");
				Logging.WriteDebug("Buffed [Dampen Magic]");
				Thread.Sleep(Usefuls.Latency + 1600);
			}
			return true;
		}
		catch (Exception e)
		{
			try
			{
				Dispose();
			}
			catch
			{
			}
			Logging.WriteError("Buffer > Pulse(): " + e);
			Products.ProductStop();
			return false;
		}
	}
	public static void Dispose()
    {
        Logging.Write("Stop Buffer.");
    }
}

 

Link to comment
Share on other sites

Hello, replace

Buffer.Pulse();

by

        while (wManager.Wow.Helpers.Conditions.ProductIsStarted)
        {
            if (wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
            {
                Buffer.Pulse();
            }
        }

 

Link to comment
Share on other sites

24 minutes ago, Droidz said:

Hello, replace


Buffer.Pulse();

by


        while (wManager.Wow.Helpers.Conditions.ProductIsStarted)
        {
            if (wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
            {
                Buffer.Pulse();
            }
        }

 

You're a godsend Droidz! Is there a helper condition sth like HaveMana?

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...