Jump to content

Apexx

Elite user
  • Posts

    332
  • Joined

Posts posted by Apexx

  1. Lua.RunMacroText("/stopcasting");

    Maybe something like this:

    private readonly Spell DivineShield = new Spell("Divine Shield");
    
    // Divine Shield
    if (ObjectManager.Me.HealthPercent < 30 && ObjectManager.Me.IsCast && DivineShield.KnownSpell && DivineShield.IsSpellUsable)
    {
        Lua.RunMacroText("/stopcasting");
        DivineShield.Launch();
    }

     

  2. Just recently, I cannot seem to figure out what the bot continues to enable Click to move in my game settings! It's so aggravating! I mainly use WRotation
    and have enabled, Disable game option 'Click to move' with WRotation. and no matter what, it ALWAYS becomes enabled again. The only two plugins I am
    using currently are, Settings Backup and my WRadar. Am I missing another setting somewhere?

  3. Hello, your method RangeManager() looks like it will only return true if there are more than 1 unit in range.

    if (ObjectManager.GetWoWUnitHostile().Count(u => u.Position.DistanceTo(ObjectManager.Target.Position) <= 40  && u.IsAttackable) > 1)

    You may want to change > 1 to >= 1 as seen below, but I could be wrong.

    private void RangeManager()
    {
    	if (ObjectManager.GetWoWUnitHostile().Count(u => u.Position.DistanceTo(ObjectManager.Target.Position) <= 40  && u.IsAttackable) >= 1)
    	{
    		RangeCheck = true;
    	}
    	else
    	{
    		RangeCheck = false;
    	}
    	return;
    }

     

  4. I added a small sleep time before trying to launch the spell and it seems to help.

    public static bool CallPet()
    {
        try
        {
            if (!Me.IsCast &&
                !Me.IsMounted &&
                _callPet.KnownSpell &&
                _callPet.IsDistanceGood &&
                _callPet.IsSpellUsable)
            {
                Thread.Sleep(800);
                _callPet.Launch();
                Thread.Sleep(SpellManager.GlobalCooldownTimeLeft() + Usefuls.Latency);
                return true;
            }
        }
        catch (Exception e) { Logging.WriteError("CallPet() ERROR: " + Environment.NewLine + e); }
        return false;
    }
    public static bool RevivePet()
    {
        try
        {
            if (!Me.IsCast &&
                !Me.IsMounted &&
                Me.ManaPercentage > 80 &&
                _revivePet.KnownSpell &&
                _revivePet.IsDistanceGood &&
                _revivePet.IsSpellUsable)
            {
                Thread.Sleep(800);
                _revivePet.Launch();
                Thread.Sleep(SpellManager.GlobalCooldownTimeLeft() + Usefuls.Latency);
                return true;
            }
        }
        catch (Exception e) { Logging.WriteError("RevivePet() ERROR: " + Environment.NewLine + e); }
        return false;
    }

     

  5. Hi, quick questions regarding this method to CheckPet() inside my fight class.  The code below is somewhat a derivative from converting the Fight Class Editor into C#.
    The mana required to use the spell "Revive Pet" varies based on level, If the player does not have enough mana, It will just keep spamming the ability until their is enough.
    Is there a way to keep this from happening?

    I also am noticing the issue that when I mount or dismount, it will try and cast the Call Pet ability in that brief moment of getting on the mount, or jumping off every single
    time (This also includes taxis). It even gets so bad that when I mount up and try to ride off, it dismounts me to use the ability, call pet again!

    So far I have had to comment this sort of thing out of my fight class all together as it was just more of hassle than to worry about it. I do believe it is important though if I
    plan on using any portion of the bot like Grinder, Quester, Automaton, etc...

    Any help with the simple Pet Management would be greatly appreciated! Thanks!

    internal void CheckPet()
    {
        if (ObjectManager.Me.IsDeadMe || Me.IsMounted || Me.IsStunned || Me.Pacified || Me.GetMove) return;
    
        if (!ObjectManager.Pet.IsValid)
        {
            _callPet.Launch();                                      // Call Pet
        }
        if (!ObjectManager.Pet.IsValid || ObjectManager.Pet.IsDead)
        {
            //if (Me.Mana >= 1040)
                _revivePet.Launch(true);                            // Revive Pet
        }
    }

     

  6. Yeah I cannot get WRobot's keyboard class to work either. Seen the examples throughout the forums though.

    public class Main : IPlugin
    {
    	private Wradar.InputHook.KeyboardHook _hook;
    	private Keys _keyAdd = Keys.None;
    	private Keys _keyRemove = Keys.None;
    	
    	public void Initialize()
    	{
    		_keyAdd = Keys.F5;
    		_keyRemove = Keys.F6;
    		_hook = new Wradar.InputHook.KeyboardHook(true);	// Strange it doesn't work with this set as Global
    		_hook.KeyDown += HookOnKeyDown;
    		
    		_isLaunched = true;
    	}
    
    	private void HookOnKeyDown(Keys key, bool shift, bool ctrl, bool alt)
        {
            Logging.WriteDebug("key = " + key);
    
            if (key == _keyAdd)
            {
                try
                {
                    Logging.WriteDebug("Would you like to add ____ object to the collections list?");
                }
                catch (Exception ex)
                {
                    Logging.WriteError("HookOnKeyDown _keyAdd Error:\n" + ex);
                }
            }
            else if(key == _keyRemove)
            {
                try
                {
                    Logging.WriteDebug("Would you like to remove ____ object from the collections list?");
                }
                catch (Exception ex)
                {
                    Logging.WriteError("HookOnKeyDown _keyRemove Error:\n" + ex);
                }
            }
        }
    	
    	public void Dispose()
        {
            try
            {
                if (_hook != null)
                {
                    _hook.KeyDown -= HookOnKeyDown;
                    _hook.Dispose();
                }
            }
            catch { }
            _isLaunched = false;
        }
    }

     

×
×
  • Create New...