How can i feed the pet?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
wil32
Posts: 36
Joined: Tue Jun 01, 2010 9:21 pm

How can i feed the pet?

#1 Post by wil32 » Tue Nov 23, 2010 11:02 am

How can i feed the pet?

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: How can i feed the pet?

#2 Post by jduartedj » Tue Nov 23, 2010 6:40 pm

wil32 wrote:How can i feed the pet?
C'MON!

there's a Meat symbol next to summon and release pet buttons!!
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

wil32
Posts: 36
Joined: Tue Jun 01, 2010 9:21 pm

Re: How can i feed the pet?

#3 Post by wil32 » Tue Nov 23, 2010 7:24 pm

C'MON!!

WITH THE BOT!!

Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: How can i feed the pet?

#4 Post by Alkaiser » Tue Nov 23, 2010 8:08 pm

I created my own custom function for pet feeding.

Code: Select all

function findItemBagSlot(itemNameOrId)
	inventory:update()
	for slot,item in pairs(inventory.BagSlot) do
		if item.Id == itemNameOrId or item.Name == itemNameOrId then
			return slot
		end
	end
end

function feedPet(_petslot, _time)
	_petslot = _petslot or 1
	local feedtime = os.difftime(os.time(), _time)
	if( feedtime < 1200 ) then
		return false
	end
	local foodslot = findItemBagSlot("Miller\'s Special Cake")
	if( foodslot == nil ) then
		return false
	else
		RoMScript("ReturnPet('".._petslot.."')")
		yrest(500)
		RoMScript("ClearPetFeedItem()")
		yrest(500)
		RoMScript("PickupBagItem(GetBagItemInfo('"..foodslot.."'))")
		yrest(500)
		RoMScript("ClickPetFeedItem()")
		yrest(500)
		feedtime = feedtime / 1200
		feedtime = math.floor(feedtime,0.5)
		printf("Feed pet %s cakes\n",feedtime)
		for i = 1, feedtime do
			RoMScript("FeedPet('".._petslot.."')")
			yrest(500)
		end
		RoMScript("ClearPetFeedItem()")
		yrest(500)
		RoMScript("SummonPet('".._petslot.."')")
		yrest(8000)
		return true
	end
end
In your waypoint file you would have something like this:

Code: Select all

<onLoad>
	timer = os.time()

	if( feedPet(1,timer) ) then
		timer = os.time()
	end
</onLoad>
OR place it at the waypoint where the feeding should take place (hopefully a safe place).

If at least 20 minutes have past, the pet in slot 1 is unsummoned, fed a Miller's Cake (one for every 20 minutes elapsed time, so if the pet was out for 40 minutes the script would feed the pet twice), and then re-summoned.
I don't consider myself to be an expert so there may be better ways to do it... but it works.

wil32
Posts: 36
Joined: Tue Jun 01, 2010 9:21 pm

Re: How can i feed the pet?

#5 Post by wil32 » Tue Nov 23, 2010 10:57 pm

where do you save the function?

EDIT: must be in userfunctions.lua in the root rombot directory i think?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: How can i feed the pet?

#6 Post by Administrator » Wed Nov 24, 2010 12:53 am

You can also create a new file in the 'userfunctions' folder named addon_whatever.lua (where 'whatever' is obviously whatever you want to name it). Paste the code there and save it.

wil32
Posts: 36
Joined: Tue Jun 01, 2010 9:21 pm

Re: How can i feed the pet?

#7 Post by wil32 » Wed Nov 24, 2010 7:40 pm

it doesnt work. im a noob...

i got addon_feedPet.lua in the userfunctions folder and added this code on top of my waypoint so the first few lines look lke this

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
   timer = os.time()

   if( feedPet(1,timer) ) then
      timer = os.time()
   end
</onLoad>
	<!-- #  1 --><waypoint x="

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How can i feed the pet?

#8 Post by rock5 » Thu Nov 25, 2010 8:55 am

wil32 wrote:it doesnt work. im a noob...

i got addon_feedPet.lua in the userfunctions folder and added this code on top of my waypoint so the first few lines look lke this

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
   timer = os.time()

   if( feedPet(1,timer) ) then
      timer = os.time()
   end
</onLoad>
	<!-- #  1 --><waypoint x="
I can't see that working, as the feedpet function is run immediately after setting the timer so not enough time has passed for it to trigger. I think the way it is supposed to be set up is in the onload event you first set the timer then the rest of the code goes into a safe waypoint where it would be safe to feed the pet.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
   timer = os.time()

</onLoad>
	<!-- #  1 --><waypoint x="1" z="1">
	   if( feedPet(1,timer) ) then
	      timer = os.time()
	   end
	</waypoint>
This way every time it reaches waypoint 1, if 20 minutes has passed, it feeds the pet and resets the timer.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: How can i feed the pet?

#9 Post by Alkaiser » Thu Nov 25, 2010 9:48 am

Oops! If I have multiple waypoint files, I handle it with this:

Code: Select all

<onLoad>
	if( player.free_counter2 == 0 ) then
		player.free_counter2 = os.time();
	end
	if( feedPet(1,player.free_counter2) ) then
		player.free_counter2 = os.time();
	end
</onLoad>
The timer value survives the transition from one waypoint file to another. In this case, the pet would be fed when this waypoint file is loaded and 20 minutes have passed since the timer was set/reset. I usually include:

Code: Select all

<onLoad>
	if( player.free_counter2 == 0 ) then
		player.free_counter2 = os.time();
	end
</onLoad>
in every waypoint file.

wil32
Posts: 36
Joined: Tue Jun 01, 2010 9:21 pm

Re: How can i feed the pet?

#10 Post by wil32 » Thu Nov 25, 2010 11:39 am

I am not sure im getting your last part.

like the difference between those 2.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How can i feed the pet?

#11 Post by rock5 » Thu Nov 25, 2010 6:37 pm

I think what he is saying is he has it feed the pet only when he is loading a waypoint file, if 20 minutes has passed.

It might work well for him as he probably has waypoint files stringed together that don't individually last very long.

For everyone else who uses just 1 waypoint file or waypoint files that last a long time, this would not work well.

As an all round solution this is how I would do it.

First I would change the feedpet function so all the timing is done in the function, like this.

Code: Select all

function findItemBagSlot(itemNameOrId)
	inventory:update()
	for slot,item in pairs(inventory.BagSlot) do
		if item.Id == itemNameOrId or item.Name == itemNameOrId then
			return slot
		end
	end
end

function feedPet(_petslot)
	time = time or os.time()
	_petslot = _petslot or 1
	local feedtime = os.difftime(os.time(), time)
	if( feedtime < 1200 ) then
		return false
	else
		time = os.time()
	end
	local foodslot = findItemBagSlot("Miller\'s Special Cake")
	if( foodslot == nil ) then
		return false
	else
		RoMScript("ReturnPet('".._petslot.."')")
		yrest(500)
		RoMScript("ClearPetFeedItem()")
		yrest(500)
		RoMScript("PickupBagItem(GetBagItemInfo('"..foodslot.."'))")
		yrest(500)
		RoMScript("ClickPetFeedItem()")
		yrest(500)
		feedtime = feedtime / 1200
		feedtime = math.floor(feedtime,0.5)
		printf("Feed pet %s cakes\n",feedtime)
		for i = 1, feedtime do
			RoMScript("FeedPet('".._petslot.."')")
			yrest(500)
		end
		RoMScript("ClearPetFeedItem()")
		yrest(500)
		RoMScript("SummonPet('".._petslot.."')")
		yrest(8000)
		return true
	end
end
If feeding the pet should only be done in safe places then I would put 'feedPet(1)' in as many safe waypoints as I like or else I would put it in the onLeaveCombat.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: How can i feed the pet?

#12 Post by jduartedj » Thu Nov 25, 2010 7:34 pm

rock5 wrote: or else I would put it in the onLeaveCombat.

Just one small note....

If he's in a safe place he probably isn't fighting! so putting it under onLeaveCombat would actually put him on an UNSAFE place! ... because he was just fighting.

A specific waypoint would be safer, don't you agree?
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How can i feed the pet?

#13 Post by rock5 » Thu Nov 25, 2010 7:43 pm

jduartedj wrote:
rock5 wrote: or else I would put it in the onLeaveCombat.

Just one small note....

If he's in a safe place he probably isn't fighting! so putting it under onLeaveCombat would actually put him on an UNSAFE place! ... because he was just fighting.

A specific waypoint would be safer, don't you agree?
Isn't that what I said?

If you want to do it in a safe place put it in a safe waypoint

or else..

put it in onleavecombat.

In other words, if you are not scared of the monsters around you, you can put it in onleavecombat. That's assuming that being attacked doesn't interrupt your feeding.

No wait! I see it could be understood the way you read it. Sorry. And I always try to be so clear. :x
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

wil32
Posts: 36
Joined: Tue Jun 01, 2010 9:21 pm

Re: How can i feed the pet?

#14 Post by wil32 » Fri Nov 26, 2010 8:37 am

my waypoint is more then 20 minutes so i went like this

Code: Select all

<onLoad>
   timer = os.time()
</onLoad>
and at the end of my waypoint, approx 22-23 minutes i went like this

Code: Select all

	<!-- # 52 --><waypoint x="yourmom" z="butthole">
      if( feedPet(1,timer) ) then
         timer = os.time()
      end	
	if( player.Fights-player.free_counter1 > 250 ) then
		player.free_counter1 = player.Fights;
		load_paths("why_dont_you_repair_my_thangs");  ' This mount a mount... for faster repair TRAVEL time
	end
</waypoint>

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: How can i feed the pet?

#15 Post by swietlowka » Fri Nov 26, 2010 2:02 pm

as i see the feed function, i suppose someone allready made similiar function to supply crafting tools, reload them get crafts and such, or am i wrong?

graveangel
Posts: 3
Joined: Sun Apr 03, 2011 7:51 pm

Re: How can i feed the pet?

#16 Post by graveangel » Sun Apr 03, 2011 7:59 pm

Has anybody got this working... this is what i have so far...

In my waypoint file which is a good 15-20 min run.. I have

Code: Select all

<waypoints>
	<onLoad>
   		timer = os.time()
	</onLoad>
	<!-- #  1 --><waypoint x="xxx" z="xxx">      
		if( feedPet(1,timer) ) then
         	timer = os.time()
      	end	
		if( player.Fights-player.free_counter1 > 300 ) then
		player.free_counter1 = player.Fights;
		load_paths("somewhere");
	end
	</waypoint>
And in in the pet function I have

Code: Select all

function findItemBagSlot(itemNameOrId)
   inventory:update()
   for slot,item in pairs(inventory.BagSlot) do
      if item.Id == itemNameOrId or item.Name == itemNameOrId then
         return slot
      end
   end
end

function feedPet(_petslot)
   time = time or os.time()
   _petslot = _petslot or 1
   local feedtime = os.difftime(os.time(), time)
   if( feedtime < 1200 ) then
      return false
   else
      time = os.time()
   end
   local foodslot = findItemBagSlot("Miller\'s Special Cake")
   if( foodslot == nil ) then
      return false
   else
      RoMScript("ReturnPet('".._petslot.."')")
      yrest(500)
      RoMScript("ClearPetFeedItem()")
      yrest(500)
      RoMScript("PickupBagItem(GetBagItemInfo('"..foodslot.."'))")
      yrest(500)
      RoMScript("ClickPetFeedItem()")
      yrest(500)
      feedtime = feedtime / 1200
      feedtime = math.floor(feedtime,0.5)
      printf("Feed pet %s cakes\n",feedtime)
      for i = 1, feedtime do
         RoMScript("FeedPet('".._petslot.."')")
         yrest(500)
      end
      RoMScript("ClearPetFeedItem()")
      yrest(500)
      RoMScript("SummonPet('".._petslot.."')")
      yrest(8000)
      return true
   end
end
This is not working for me.. the only thing it does is unsummons the pet and 2 seconds after resummons the pet.. but it does not feed the pet... anyone has any idea what am i doing wrong..

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How can i feed the pet?

#17 Post by rock5 » Sun Apr 03, 2011 8:18 pm

This post is way out of date. There is an eggpet class now and settings you can set in your profile.

Checkout the EggPet settings under Profile Options in the wiki.
http://www.solarstrike.net/wiki/index.p ... _-_Options
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

graveangel
Posts: 3
Joined: Sun Apr 03, 2011 7:51 pm

Re: How can i feed the pet?

#18 Post by graveangel » Sun Apr 03, 2011 10:13 pm

Sorry for been such a noob but I dont see an option to feed.. i do see to craft and others...

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How can i feed the pet?

#19 Post by rock5 » Sun Apr 03, 2011 11:19 pm

If you have food and an 'assist' pet it will automatically keep it fed.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

graveangel
Posts: 3
Joined: Sun Apr 03, 2011 7:51 pm

Re: How can i feed the pet?

#20 Post by graveangel » Wed Apr 06, 2011 9:57 pm

Working like a charm... Thank you..

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests