Jump to content

[Solved] Need Pet happiness macro!


Recommended Posts

if GetPetHappiness() < 3 then
  CastSpellByName("Feed Pet")
  UseItemByName("FoodName")
end  

Haven't tested this. Instead of CastSpellByName and UseItemByName you can also just do
RunMacroText("/cast Feed Pet")
RunMacroText("/use FoodName")

Link to comment
Share on other sites

8 hours ago, Matenia said:

if GetPetHappiness() < 3 then
  CastSpellByName("Feed Pet")
  UseItemByName("FoodName")
end  

Haven't tested this. Instead of CastSpellByName and UseItemByName you can also just do
RunMacroText("/cast Feed Pet")
RunMacroText("/use FoodName")


Hello Matenia,

I am really noob with this lol. Okay so where do I enter that script? If you can direct me please. I just want to know where to put it in the Wrobot and how to run it.

I have the 2nd macro you mentioned, but as level changes, food strength changes. So I want the bot to spam the macro every 2 minutes, and it only feeds when pet is not happy.

Link to comment
Share on other sites

You don't have to spam it every 2 minutes. It will only feed your pet, if its happiness is below the highest level.

You can set it anywhere in your fightclass as Lua code. Out of combat, while not moving, of course

Link to comment
Share on other sites

On 7/7/2017 at 2:42 PM, Matenia said:

You don't have to spam it every 2 minutes. It will only feed your pet, if its happiness is below the highest level.

You can set it anywhere in your fightclass as Lua code. Out of combat, while not moving, of course

Thank you! I still don't know how to put this

if GetPetHappiness() < 3 then
  CastSpellByName("Feed Pet")
  UseItemByName("FoodName")
end  

 

Can you give me basic instructions please? like when I open my fightclass, where do I go, where do I put it? Sorry, but I am new to all of this lol

Link to comment
Share on other sites

  • 2 months later...

Hello there, found this really useful! There is this thing ... I am working on Questing profile for hunter which will level automatically to max level and there is constant need to change the food for this character so I looked into API and LUA and made this simple modification

if UnitLevel("pet") < 18 then
	if GetPetHappiness() < 3 then
		CastSpellByName("Feed Pet")
		UseItemByName("Tough Jerky")
	end
elseif UnitLevel("pet") > 17 and UnitLevel("pet") < 30 then
	if GetPetHappiness() < 3 then
		CastSpellByName("Feed Pet")
		UseItemByName("Tough Jerky")
	end
else

end

this is just little example for now... I will probably end up using elseif all the time... I want to ask you whether you could help me and think of better solution. Maybe better looking or more efficient (efficiency > looks). 

Thanks!

I can think of making bot check the pet level only when character levels up? also maybe create functions.... This is my first time playing with LUA

Link to comment
Share on other sites

  • 4 weeks later...
Good. You could explain where to use the macros. As I read, they are used in fightclass, but I do not know how to put them. You could tell me how to use it or for better, you could upload a FightClass file. Thank you
Link to comment
Share on other sites

what you see written here, coppy that into spell name and scroll down and set it up as LUA script, and thats all, u can alter some more but this is what you need to get it to work

Link to comment
Share on other sites

I have done what you have told me and tries to feed, but it does not give to the food that I have put to it. Something is not working right or I'm doing wrong. I could send a screenshot 
or upload a FightClass
 . Thank you
Link to comment
Share on other sites

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