Jump to content

Recommended Posts

Hi all

 

I have a problem

 

Usually this command  :

 

public void FocusBuild()
    {
        SteadyShot.Launch(false);
    }
 
Never stop the bot during launch
 
But in the last release, the bot always stop moving to launch it
 
I think the library was modified and a bug is present now
 
Can you confirm, and fix it pls ?
 
Thank you very much :
Link to comment
https://wrobot.eu/forums/topic/1262-stopping-move-with-steadyshotlaunchfalse/
Share on other sites

Hello,
I have looked library code and all seem good, I have try and works fine, can you test this code and tell me if this works:
using System;
using System.Threading;
using System.Windows.Forms;
using robotManager.Helpful;
using robotManager.Products;
using wManager.Wow.Class;
using wManager.Wow.Enums;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
using Timer = robotManager.Helpful.Timer;

public class Main : ICustomClass
{
    public float Range { get { return 20; } }

    private bool _isLaunched;
    private ulong _lastTarget;

    public void Initialize() // When product started, initialize and launch Fightclass
    {
        _isLaunched = true;
        Logging.Write("[My fightclass] Is initialized.");
        Rotation();
    }

    public void Dispose() // When product stopped
    {
        _isLaunched = false;
        Logging.Write("[My fightclass] Stop in progress.");
    }

    public void ShowConfiguration() // When use click on Fight class settings
    {
        MessageBox.Show("[My fightclass] No setting for this Fight Class.");
    }

    // SPELLS:
    public Spell SteadyShot = new Spell("Steady Shot"); // or "Arcane Shot"

    internal void Rotation()
    {
        if (!SteadyShot.KnownSpell)
            SteadyShot = new Spell("Arcane Shot");

        Logging.Write("[My fightclass] Is started.");
        while (_isLaunched)
        {
            try
            {
                if (!Products.InPause)
                {
                    if (!ObjectManager.Me.IsDeadMe)
                    {
                        BuffRotation();

                        if (Fight.InFight && ObjectManager.Me.Target > 0)
                        {
                            Pull();
                            CombatRotation();
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Logging.WriteError("[My fightclass] ERROR: " + e);
            }

            Thread.Sleep(10); // Pause 10 ms to reduce the CPU usage.
        }
        Logging.Write("[My fightclass] Is now stopped.");
    }

    internal void BuffRotation()
    {
        if (ObjectManager.Me.IsMounted)
            return;

    }

    internal void Pull()
    {
        if (ObjectManager.Me.Target == _lastTarget)
            return;

        if (ObjectManager.Target.Target != ObjectManager.Me.Guid)
        {
            
            _lastTarget = ObjectManager.Me.Target;
        }
    }

    internal void CombatRotation()
    {
        // Steady Shot or Arcane Shot
        if (SteadyShot.IsSpellUsable && SteadyShot.IsDistanceGood && SteadyShot.KnownSpell)
        {
            SteadyShot.Launch(false);
            return;
        }
    }
}

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