February 12, 20215 yr 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.cs
February 12, 20215 yr https://wrobot.eu/forums/topic/2097-condition-hostile-unit-near-target-never-true/?tab=comments#comment-9858
February 12, 20215 yr Author 8 minutes ago, Zan said: https://wrobot.eu/forums/topic/2097-condition-hostile-unit-near-target-never-true/?tab=comments#comment-9858 It looks more related to non C# profiles but I'm unsure exactly how I'd implement that code into my fight class
February 13, 20215 yr 2 hours ago, 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 ObjectManager.GetWoWUnitHostile......
February 13, 20215 yr Author 12 hours ago, Zan said: ObjectManager.GetWoWUnitHostile...... 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. dRotation -feral2.cs
February 13, 20215 yr 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 February 13, 20215 yr by Apexx
February 13, 20215 yr Author 3 hours ago, 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; } 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: in reference to your third line.
February 13, 20215 yr 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)
February 13, 20215 yr Author 20 minutes ago, 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) 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.
February 13, 20215 yr 12 minutes ago, 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. Go download VS Community Edition and add WRobot references while writing in C#
February 13, 20215 yr Author 20 minutes ago, Marsbar said: Oh lol dude, add a using System.Linq; to the usings at the top of the file 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! 9 minutes ago, Zan said: Go download VS Community Edition and add WRobot references while writing in C# 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