Jump to content

Recommended Posts

Hello, im having 4 small issues running 3.3.5 fightclass ive been mixing with on free time.

it wont stop "spamming" mend pet once the pet drops under 60% hp. and the second issue is the feed pet code does not seem to actually "feed" it to my pet, it does however pick it up from invenentory  but does not actually use the feed pet on it? 

the third & fourth issue is that my hunters mark & serpent sting wont go off on the target but i cant find an issue, it was working before ?

 

        {

        // Call Pet
        if (!ObjectManager.Pet.IsValid && CallPet.KnownSpell)
        {
            CallPet.Launch();
            Thread.Sleep(Usefuls.Latency + 1000);
        {
        // Revive Pet
        if (!ObjectManager.Pet.IsValid || ObjectManager.Pet.IsDead && RevivePet.KnownSpell)
            RevivePet.Launch();
            Thread.Sleep(Usefuls.Latency + 1400);

		if (ObjectManager.Pet.IsAlive && ObjectManager.Pet.IsValid && ObjectManager.Me.IsAlive &&  MendPet.KnownSpell && !ObjectManager.Pet.HaveBuff("Mend Pet") && MendPet.IsDistanceGood && ObjectManager.Pet.HealthPercent <=60)
        {
            MendPet.Launch();
			Thread.Sleep(Usefuls.Latency + 14000);
            return;
        }
		
        // Hunters Mark
		if (HuntersMark.KnownSpell && HuntersMark.IsSpellUsable && HuntersMark.IsDistanceGood && !ObjectManager.Target.HaveBuff("Hunter's Mark"))
        {
            Lua.LuaDoString(@"WrathCS.text:SetText(""Buffing Hunter's Mark"")");
            HuntersMark.Launch();
            return;
        }
        // Serpent Sting
        if (SerpentSting.KnownSpell && SerpentSting.IsSpellUsable && SerpentSting.IsDistanceGood && !ObjectManager.Target.HaveBuff("Serpent Sting"))
        {
            Lua.LuaDoString(@"WrathCSFrame.text:SetText(""Casting Serpent Sting"")");
            SerpentSting.Launch();
            return;
        }
		

hopefully anyone can help me out here ? thanks!

also is there any way to get my pet to attack the units that have aggro on me?

Link to comment
https://wrobot.eu/forums/topic/11267-wrath-335a-c-issues-in-fightclass/
Share on other sites

Hello,

First off using this "Lua.LuaDoString(@"WrathCS.text:SetText(""Buffing Hunter's Mark"")");" is slowing you're rotation down. Reason can be found Here

2nd with you're mend problem, you need to add a space inbetween <= Here 60 (should fix the problem

3rd you do not really need to keep using Thread.Sleep(Usefuls.Latency + 14000);, you can use "Usefuls.WaitIsCasting();" its a lot better in my option.

4th : for feeding you can use code like this

// food list, it will choost whats best food inside you're bags.
private List<string> FoodList()
  {
    return new List<string>()
    {
      "Tough Jerky",
    };
  }
 
// choost from the food list
private void FeedPet()
 {
if (PetFoodType().Contains("Food type"))
      FeedByType(FruitList());
 }

// feed from list
FeedPet();
Thread.Sleep(600);

5th id try adding "Usefuls.WaitIsCasting();" to mark and sting. 

make sure to check if you're spelling is correct.

if you need anymore help join my discord server and id be more then happy to help. Link : ttps://discord.gg/ppm8Ufc

38 minutes ago, The Smokie. said:

Hello,

First off using this "Lua.LuaDoString(@"WrathCS.text:SetText(""Buffing Hunter's Mark"")");" is slowing you're rotation down. Reason can be found Here

2nd with you're mend problem, you need to add a space inbetween <= Here 60 (should fix the problem

3rd you do not really need to keep using Thread.Sleep(Usefuls.Latency + 14000);, you can use "Usefuls.WaitIsCasting();" its a lot better in my option.

4th : for feeding you can use code like this


// food list, it will choost whats best food inside you're bags.
private List<string> FoodList()
  {
    return new List<string>()
    {
      "Tough Jerky",
    };
  }
 
// choost from the food list
private void FeedPet()
 {
if (PetFoodType().Contains("Food type"))
      FeedByType(FruitList());
 }

// feed from list
FeedPet();
Thread.Sleep(600);

5th id try adding "Usefuls.WaitIsCasting();" to mark and sting. 

make sure to check if you're spelling is correct.

if you need anymore help join my discord server and id be more then happy to help. Link : ttps://discord.gg/ppm8Ufc

Thanks for the help with code snippets and finding my missing space! ?

i was just wondering if you have any templates/ideas of how i can make my pet tank all the mobs so i dont end up dying if my mend pet gains aggro, or is there a way to feign death if x mobs attacking me?

also regarding the pet feed, it looks like ill need to add all the food manualy right? and can i add it like this?

 

    public void Feed()	
// food list, it will choost whats best food inside you're bags.
private List<string> FoodList()
  {
    return new List<string>()
    {
      "Tough Jerky",
    };
  }
 
// choost from the food list
private void FeedPet()
 {
if (PetFoodType().Contains("Food type"))
      FeedByType(FruitList());
 }

// feed from list
FeedPet();
Thread.Sleep(600);

 

Lets throw some misconceptions out of the window:

1 hour ago, The Smokie. said:

First off using this "Lua.LuaDoString(@"WrathCS.text:SetText(""Buffing Hunter's Mark"")");" is slowing you're rotation down. Reason can be found Here

Yes. It may slow your rotation very slightly(as it says in that post maybe 80ms) but nothing you really want to worry about. Go ahead with your LUA.

47 minutes ago, antisnake said:

2nd with you're mend problem, you need to add a space inbetween <= Here 60 (should fix the problem

This doesn't make a difference, space or no space, the code does the same thing.

1 hour ago, The Smokie. said:

4th : for feeding you can use code like this

That code snippet wont work (FoodList & FruitList? also the method FeedByType() isn't even in the snippet) and doesn't have the solution to his problem (using the food after picking it up).

1 hour ago, The Smokie. said:

5th id try adding "Usefuls.WaitIsCasting();" to mark and sting. 

Also wont make a difference in this case.

In terms of answers to your questions:
Mend pet spam - you'll want to add a condition to check if you're currently channeling (mend pet is a channel not a cast), the Usefuls.WaitIsCasting() should also do the trick though.
Pet feeding - From the looks of it you're using eenys vanilla FC, the lua api changed a bit since vanilla, thats why it doesn't work on wotlk
Use the UseItem method and it should work eg:

SpellManager.CastSpellByNameLUA("Feed Pet");
ItemsManager.UseItem("Some Food Name");

Serpent & hunters - looks fine to me, should work.
Pet management - you could do something like the below and add it into the main rotation (untested):
 

internal void PetCombat()
{
    var aggroUnits = ObjectManager.GetUnitAttackPlayer().Where(x => x.TargetObject == ObjectManager.Me);
    if (aggroUnits.Count() >0)
    {
        ObjectManager.Me.FocusGuid = aggroUnits.First().Guid;
        Lua.RunMacroText("/petattack [@focus]");
    }
}

 

Edited by Marsbar
7 hours ago, Marsbar said:

Lets throw some misconceptions out of the window:

Yes. It may slow your rotation very slightly(as it says in that post maybe 80ms) but nothing you really want to worry about. Go ahead with your LUA.

This doesn't make a difference, space or no space, the code does the same thing.

That code snippet wont work (FoodList & FruitList? also the method FeedByType() isn't even in the snippet) and doesn't have the solution to his problem (using the food after picking it up).

Also wont make a difference in this case.

In terms of answers to your questions:
Mend pet spam - you'll want to add a condition to check if you're currently channeling (mend pet is a channel not a cast), the Usefuls.WaitIsCasting() should also do the trick though.
Pet feeding - From the looks of it you're using eenys vanilla FC, the lua api changed a bit since vanilla, thats why it doesn't work on wotlk
Use the UseItem method and it should work eg:

Serpent & hunters - looks fine to me, should work.
Pet management - you could do something like the below and add it into the main rotation (untested):
 


internal void PetCombat()
{
    var aggroUnits = ObjectManager.GetUnitAttackPlayer().Where(x => x.TargetObject == ObjectManager.Me);
    if (aggroUnits.Count() >0)
    {
        ObjectManager.Me.FocusGuid = aggroUnits.First().Guid;
        Lua.RunMacroText("/petattack [@focus]");
    }
}

 

Thanks! regarding mend pet, only in vanilla its a channel, in tbc/wrath its a buff you apply to your pet (like renew) so it does not work?

will report back after testing your suggestions! thanks! 

edit: i just realised that my call pet is not working and i was wondering if you could help me with that? 

 

        // Call Pet
        if (!ObjectManager.Pet.IsValid && CallPet.KnownSpell)
        {
            CallPet.Launch();
            Thread.Sleep(Usefuls.Latency + 1000);
        {

it does not seem to work & it gets stuck trying to revive pet, almost as if Pet.IsValid & Pet.IsDead & Pet.IsAlive is broken? i tried out other fightclasses from the forum and same thing. also i fully understand how to add the feeding code ?

ps also your petcombat snippet returns an error
[E] 20:47:56 - Compilator Error :
c:\Users\nickl\AppData\Local\Temp\1rmclwrz\1rmclwrz.0.cs(171,59) : error CS1061: System.Collections.Generic.List<wManager.Wow.ObjectManager.WoWUnit> innehåller inte en definition för Where och det gick inte att hitta någon Where-tilläggsmetod som accepterar ett första argument av typen System.Collections.Generic.List<wManager.Wow.ObjectManager.WoWUnit> (saknas ett using-direktiv eller en sammansättningsreferens?)

1 hour ago, antisnake said:

regarding mend pet, only in vanilla its a channel, in tbc/wrath its a buff you apply to your pet (like renew) so it does not work?

Ah sorry, I assumed because I saw that massive thread sleep in there. Doing a thread sleep for 14 seconds means your whole fightclass does nothing for that duration!
I guess just double check the buff the pet receives when you mend it, that !havebuff should stop it from being spammed (it also can't spam it if theres a 14 sec sleep lol).

Where do you write your code? The call pet you posted ends in { instead of }. Pet.IsValid should work.

2 hours ago, antisnake said:

also i fully understand how to add the feeding code ?

I assume you meant to say you don't understand. Paste your current feed pet function and I'll show you.

6 hours ago, Marsbar said:

Ah sorry, I assumed because I saw that massive thread sleep in there. Doing a thread sleep for 14 seconds means your whole fightclass does nothing for that duration!
I guess just double check the buff the pet receives when you mend it, that !havebuff should stop it from being spammed (it also can't spam it if theres a 14 sec sleep lol).

Where do you write your code? The call pet you posted ends in { instead of }. Pet.IsValid should work.

I assume you meant to say you don't understand. Paste your current feed pet function and I'll show you.

thanks for the help! ran into an issue with the aggro snippet

[E] 20:47:56 - Compilator Error :
c:\Users\nickl\AppData\Local\Temp\1rmclwrz\1rmclwrz.0.cs(171,59) : error CS1061: System.Collections.Generic.List<wManager.Wow.ObjectManager.WoWUnit> innehåller inte en definition för Where och det gick inte att hitta någon Where-tilläggsmetod som accepterar ett första argument av typen System.Collections.Generic.List<wManager.Wow.ObjectManager.WoWUnit> (saknas ett using-direktiv eller en sammansättningsreferens?)

And the feeding macro is below

    public void Feed()	
	{
		if (FeedPet.KnownSpell && !Fight.InFight )
			{
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 1)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 2)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 3)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 4)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 5)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 6)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 7)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 8)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 9)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 10)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 11)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 12)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 13)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 14)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 15)\r\nend  ");
									Thread.Sleep(400);
       					 }
						 if (ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsCast && !ObjectManager.Pet.HaveBuff("Feed Pet Effect"))
       					 {
       					     	Lua.LuaDoString("if GetPetHappiness() < 3 then\r\n  CastSpellByName(\"Feed Pet\")\r\n  PickupContainerItem(0, 16)\r\nend  ");
									Thread.Sleep(400);
       					 }
			}
	}

thanks again for all the help!  

Also is there a way to call a function to be used only when out of combat? and another when im combat? eg aspects?

4 minutes ago, The Smokie. said:

why use bag slot instead of the meat or food name / ID?

to lazy to add every single piece of food tbh would be easier if it would just loop every bagslot i thought. but will look into it

also is there a dont do x action if mounted? 

!ObjectManager.Me.IsMounted but is there a !ObjectManager.Me.IsNOTmounted? or am i missing something here

tbh thats you're downfall, making a fightclass right is worth more then being lazy. Trust me, ive thought about being lazy with some of my fightclasses but i had to write the food method for mage completely. being lazy helps no one.

Just now, The Smokie. said:

tbh thats you're downfall, making a fightclass right is worth more then being lazy. Trust me, ive thought about being lazy with some of my fightclasses but i had to write the food method for mage completely. being lazy helps no one.

wise words, also you commented right as i updated my answer ?

3 minutes ago, The Smokie. said:

just this


!ObjectManager.Me.IsMounted

 

        // Call Pet
        if (!ObjectManager.Pet.IsAlive && !ObjectManager.Me.IsMounted && !ObjectManager.Me.IsDeadMe && CallPet.KnownSpell)
        {
            CallPet.Launch();
            Thread.Sleep(Usefuls.Latency + 500);

with this it still dismounts me to call pet?

if (ObjectManager.Pet.IsDead && !ObjectManager.Me.IsMounted && !ObjectManager.Me.IsDead && CallPet.KnownSpell && CallPet.IsSpellUsable)
        {
            CallPet.Launch();
            Thread.Sleep(Usefuls.Latency + 500);
		}

I've edited you're C# with a few code problems. There is a lot of conditions you can use. like i said via discord message. watch @Marsbar Amazing guide on how to make fightclasses. he taught me everything i know from that single video and a lot of trial and error.

Try disabling all you're wow addons , this might case you to dismount.

 

also looping is good and all but the way you have it will case a lot of problems with lag, cpu heating up. just use a array list.

4 minutes ago, The Smokie. said:

if (ObjectManager.Pet.IsDead && !ObjectManager.Me.IsMounted && !ObjectManager.Me.IsDead && CallPet.KnownSpell && CallPet.IsSpellUsable)
        {
            CallPet.Launch();
            Thread.Sleep(Usefuls.Latency + 500);
		}

I've edited you're C# with a few code problems. There is a lot of conditions you can use. like i said via discord message. watch @Marsbar Amazing guide on how to make fightclasses. he taught me everything i know from that single video and a lot of trial and error.

Try disabling all you're wow addons , this might case you to dismount.

0 addons, it still dismounts me tho ?

edit this to you're needs. it will take a little editing to make work for you're needs.

private Dictionary<int, uint> FoodDictionary = new Dictionary<int, uint>
    {
        { 5, 2287 },
        { 15, 3770 },
        { 25, 3771 },
        { 35, 4599 },
        { 45, 8952 },
        { 55, 8952 },
        { 65, 8952 },
        { 75, 8952 },
        
    };
  int previousFoodLevel = 0;
            foreach (int level in FoodDictionary.Keys)
            {
                if (previousFoodLevel <= Me.Level && level > Me.Level)
                {
                    CurrentFood = FoodDictionary[previousFoodLevel];
                    string foodName = ItemsManager.GetNameById(FoodDictionary[previousFoodLevel]);
                    wManagerSetting.CurrentSetting.FoodName = foodName;
                    
                    
                }
                previousFoodLevel = level;
            }

 

14 hours ago, antisnake said:

thanks for the help! ran into an issue with the aggro snippet

add using System.Linq; to the top of your file

13 hours ago, The Smokie. said:

why use bag slot instead of the meat or food name / ID?

The reason in this case is to avoid having a food list. That code tries to feed the pet any item in the main backpack, until it is no longer hungry. It is however EXTREMELY inefficient the way it's been written and should be removed from your FC.

13 hours ago, antisnake said:

0 addons, it still dismounts me tho

Are you sure it isn't dismounting because of something else? You can add little Logging.Write("I made it here"); checks to your code to make sure it got into that statement.

I thought someone updated FNV's pet feeder plugin? That likely also only contains foods for vanilla though.

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