Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Feeding Pet

Featured Replies

I've been trying for a while now on how to get the bot to feed my hunters pet. I've tried the following spell and keep getting an error. 

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

image.thumb.png.730ee7ec49b7b0cdeeb3f6700fb43047.png

 

  • Author

Ok. Well I've also made a macro in the game: feedpet

/run local c=CastSpellByName;if GetPetHappiness()~=nil and GetPetHappiness()~=3 then c("Feed Pet");PickupContainerItem(0,1) end
 

Clicking this macro works and feeds the pet.

When I use 

RunMacroText("/cast feedpet");

 

This also doesn't work. Am I doing something wrong or does this method also not work in Vanilla? 

Your in-game macro is not using UseItemByName, it's taking what you have in container slot 0,1. This means it will only try to feed your pet with whatever is in that slot.

You can do the same with your bot with the following Code:

if GetPetHappiness() < 3 then
  CastSpellByName("Feed Pet")
  PickupContainerItem(0,1)
end  

This will make the bot feed the pet with whatever you have in slot 0,1 in your bags (like your macro) if the pet is not happy. :)

Edit: For the first code snippet to work, you could make a foreach loop and check every slot in your bag for itemname. :)

Edited by Ordush

On 12/10/2017 at 11:54 AM, Ordush said:

Your in-game macro is not using UseItemByName, it's taking what you have in container slot 0,1. This means it will only try to feed your pet with whatever is in that slot.

You can do the same with your bot with the following Code:


if GetPetHappiness() < 3 then
  CastSpellByName("Feed Pet")
  PickupContainerItem(0,1)
end  

This will make the bot feed the pet with whatever you have in slot 0,1 in your bags (like your macro) if the pet is not happy. :)

Edit: For the first code snippet to work, you could make a foreach loop and check every slot in your bag for itemname. :)

Where you put this at? As a spell with a lua code or what? 

  • 1 year later...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.