Jump to content

Recommended Posts

I'd like to use Swipe in cat form when there's a certain amount of mobs in range but I can't seem to find any api information on how to accomplish that. 

I've attached the base I've been using below if you have any suggestions.

Thanks!

dRotation - Feral.csFetching info...

  On 2/12/2021 at 11:48 PM, Zan said:
Expand  

It looks more related to non C# profiles but I'm unsure exactly how I'd implement that code into my fight class

  On 2/12/2021 at 11:57 PM, Sleepwalker said:

It looks more related to non C# profiles but I'm unsure exactly how I'd implement that code into my fight class

Expand  
ObjectManager.GetWoWUnitHostile......
  On 2/13/2021 at 2:40 AM, Zan said:
ObjectManager.GetWoWUnitHostile......
Expand  

Implementing this code into the fight class base I'm using doesn't appear to work, wrobot just throws up errors. I've attached the fight class below and an image with said error, thanks again for your help. 4161b03a1b.png

dRotation -feral2.csFetching info...

Here's what I use to check attackers in range:

public static int GetAttackerCountInRange(float yards)
{
    int EnemyCountInRange = ObjectManager.GetUnitAttackPlayer().Count(t => t.IsAlive && t.IsValid && t.IsAttackable && t.InCombat && t.GetDistance <= yards);
    if (EnemyCountInRange > 0)
        {
            Logging.WriteDebug($"Enemy attacking count = {EnemyCountInRange}");
            return EnemyCountInRange;
        }
    return 0;
}

 

Edited by Apexx
  On 2/13/2021 at 4:22 PM, Apexx said:

Here's what I use to check attackers in range:

public static int GetAttackerCountInRange(float yards)
{
    int EnemyCountInRange = ObjectManager.GetUnitAttackPlayer().Count(t => t.IsAlive && t.IsValid && t.IsAttackable && t.InCombat && t.IsTargetingMeOrMyPetOrPartyMember && t.GetDistance <= yards);
    if (EnemyCountInRange > 0)
        {
            Logging.WriteDebug($"Enemy attacking count = {EnemyCountInRange}");
            return EnemyCountInRange;
        }
    return 0;
}

 

Expand  

Can you show how you've implemented this? I'm pretty nooby when it comes to c#. I've tried putting the code in its own spot then calling GetAttackerCountInRange in the swipe spell however I run into an error saying this: a8a22229ba.png in reference to your third line.

This should be enough as your if statement:

if (Swipe.KnownSpell && Swipe.IsSpellUsable && Swipe.IsDistanceGood && ObjectManager.Me.ComboPoint <= 3 && ObjectManager.GetWoWUnitAttackables().Count(u => u.Position.DistanceTo(ObjectManager.Target.Position) <= 8 && u.Guid != ObjectManager.Pet.Guid) >= 3)
  On 2/13/2021 at 8:34 PM, Marsbar said:

This should be enough as your if statement:

if (Swipe.KnownSpell && Swipe.IsSpellUsable && Swipe.IsDistanceGood && ObjectManager.Me.ComboPoint <= 3 && ObjectManager.GetWoWUnitAttackables().Count(u => u.Position.DistanceTo(ObjectManager.Target.Position) <= 8 && u.Guid != ObjectManager.Pet.Guid) >= 3)
Expand  

I get the same error every time, I really appreciate all the help I'm receiving. The error looks the same as everyone elses suggestion though, .Count cannot be used like a method. 8aac85be73.png

  On 2/13/2021 at 8:57 PM, Sleepwalker said:

I get the same error every time, I really appreciate all the help I'm receiving. The error looks the same as everyone elses suggestion though, .Count cannot be used like a method. 8aac85be73.png

Expand  

Go download VS Community Edition and add WRobot references while writing in C#

  On 2/13/2021 at 8:59 PM, Marsbar said:

Oh lol dude, add a 

using System.Linq;

to the usings at the top of the file

Expand  

I can't believe it was something so simple hahah! I can tweak around with more things now at least thanks so much! I just gotta figure out how to stop the other spells casting now instead of swipe but I'm sure I can figure that out.

Edit:

I just used an else if statement in the swipe spell and it works perfectly, so now it'll cast swipe if 3 targets and shred if it's less than that. Thanks so much!

  On 2/13/2021 at 9:10 PM, Zan said:

Go download VS Community Edition and add WRobot references while writing in C#

Expand  

Yeah makes a lot of sense, I've just been a bit of a fool and stuck to using NP++ for a while now, I'll swap over to that thank you again also.

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