How can i feed the pet?
How can i feed the pet?
How can i feed the pet?
Re: How can i feed the pet?
C'MON!wil32 wrote:How can i feed the pet?
there's a Meat symbol next to summon and release pet buttons!!
Thanks for reading! ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Re: How can i feed the pet?
C'MON!!
WITH THE BOT!!
WITH THE BOT!!
Re: How can i feed the pet?
I created my own custom function for pet feeding.
In your waypoint file you would have something like this:
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.
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
Code: Select all
<onLoad>
timer = os.time()
if( feedPet(1,timer) ) then
timer = os.time()
end
</onLoad>
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.
Re: How can i feed the pet?
where do you save the function?
EDIT: must be in userfunctions.lua in the root rombot directory i think?
EDIT: must be in userfunctions.lua in the root rombot directory i think?
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: How can i feed the pet?
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.
Re: How can i feed the pet?
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
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="
Re: How can i feed the pet?
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.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 thisCode: 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="
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>
- 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
Re: How can i feed the pet?
Oops! If I have multiple waypoint files, I handle it with this:
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:
in every waypoint file.
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>
Code: Select all
<onLoad>
if( player.free_counter2 == 0 ) then
player.free_counter2 = os.time();
end
</onLoad>
Re: How can i feed the pet?
I am not sure im getting your last part.
like the difference between those 2.
like the difference between those 2.
Re: How can i feed the pet?
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.
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.
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
- 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
Re: How can i feed the pet?
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! ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Re: How can i feed the pet?
Isn't that what I said?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?
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.
![Mad :x](./images/smilies/icon_mad.gif)
- 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
Re: How can i feed the pet?
my waypoint is more then 20 minutes so i went like this
and at the end of my waypoint, approx 22-23 minutes i went like this
Code: Select all
<onLoad>
timer = os.time()
</onLoad>
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>
-
- Posts: 316
- Joined: Wed Jun 16, 2010 8:16 am
Re: How can i feed the pet?
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?
-
- Posts: 3
- Joined: Sun Apr 03, 2011 7:51 pm
Re: How can i feed the pet?
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
And in in the pet function I have
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..
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>
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
Re: How can i feed the pet?
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
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
-
- Posts: 3
- Joined: Sun Apr 03, 2011 7:51 pm
Re: How can i feed the pet?
Sorry for been such a noob but I dont see an option to feed.. i do see to craft and others...
Re: How can i feed the pet?
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
-
- Posts: 3
- Joined: Sun Apr 03, 2011 7:51 pm
Re: How can i feed the pet?
Working like a charm... Thank you..
Who is online
Users browsing this forum: No registered users and 2 guests