New EggPet class.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

New EggPet class.

#1 Post by rock5 » Wed Dec 01, 2010 7:38 am

I'm most of the way through the coding for a eggpet class. Mainly it collects lots of info via memory addresses and does actions via RoMScript commands.

These are the functions I have so far.
CEggPet:update()
CEggPet:feed(foodNameOrId, number)
CEggPet:Summon()
CEggPet:Return()
CEggPet:craft(craftType, indexLevel)
CEggPet:harvest()

An example onLeaveCombat script.

Code: Select all

mypet=CEggPet(1)
if mypet.Nourishment < 80 and inventory:itemTotalCount("Miller's Special Cake") > 0 then
    repeat
        mypet:feed("Miller's Special Cake",5) -- 1 at a time is too slow
    until mypet.Nourishment == 100 or inventory:itemTotalCount("Miller's Special Cake") == 0
end
or

Code: Select all

mypet=CEggPet(1)
if mypet.Crafting == false then
    mypet:craft(MINING) -- Defaults to highest mining level
end
I'm not big on pets so are there any pet lovers out there that see the need for more functions?

Please feel free to make suggestions or ask questions.
  • 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

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

Re: New EggPet class.

#2 Post by swietlowka » Wed Dec 01, 2010 7:52 am

CEggPet:craft(craftType, indexLevel)

IndexLevel? Is it what it should make from the list? Is there a way for it to auto take the highest possible?

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

Re: New EggPet class.

#3 Post by jduartedj » Wed Dec 01, 2010 7:53 am

rock5 wrote:
I'm not big on pets so are there any pet lovers out there that see the need for more functions?

Please feel free to make suggestions or ask questions.
This DOES answer my question in the previous post! :D thx
btw check that post, that pawnPetPtr Error is pissing me off!


EDIT :
Oh I have a suggestion!
Pet merging! Very usefull to lvl pets.
So:
1 - Place an egg in a pet slot.
2 - Select the appropriate mergers (Merger and merged or whatever they are called)
3 - Click merge button.

Also There is this 'trick' to merge as many pets as you want in a day (usually its 3x a day) that should be included and goes like this:
-You need 2 free slots.
1.From all the pets you wanna merge Select the 2 lowest lvl and merge them.
2.Them place the next lowest egg in a slot (that should b higher or same as the previous) and merge that and the previous.
3. Repeat 2. until you have used all the eggs and have 1 pet left.
4. Merge your pet with the pet that is left.
*Beware only to use pets of equal or lower lvl than your main pet*

Using a different pet for each merge bypasses the limit of 3 because this limit is pet specific.
EDIT2: The pets accumulate the stats as they are merged.

EDIT3: Just saying, but shouldn't the class be CPet? Because the petegg is the item you have in the bag, and we're working w/ the pet itself, in the breeding slot (not an egg anymore)... it makes sense to me.
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: New EggPet class.

#4 Post by rock5 » Wed Dec 01, 2010 9:42 am

swietlowka wrote:CEggPet:craft(craftType, indexLevel)

IndexLevel? Is it what it should make from the list? Is there a way for it to auto take the highest possible?
It defaults to taking the highest level as I said in my example ("mypet:craft(MINING) -- Defaults to highest mining level"). You specify a level if you want a specific mat for what ever reason.
jduartedj wrote:btw check that post, that pawnPetPtr Error is pissing me off!
I was aware of that error but I was working on this and didn't want to break my train of thought. It's not related to egg pets anyway as I believe that pointer is for warden pets.
swietlowka wrote:EDIT :
Oh I have a suggestion!
Pet merging! Very usefull to lvl pets.
I wasn't going to do pet merging as I didn't see the reason to bot it but I'd forgotten about the leveling trick. I'm not convinced of the benefits but I'll add merge functions. I'm not sure yet, though, if I'll add a function that does the merging trick or i I'll leave it to the user.

I just remembered, I didn't find the pet element type. We would need that so I'll have to look for it.
jduartedj wrote:EDIT3: Just saying, but shouldn't the class be CPet? Because the petegg is the item you have in the bag, and we're working w/ the pet itself, in the breeding slot (not an egg anymore)... it makes sense to me.
But there are so many types of pets. How would anyone distinguish between them? eg, If someone decided to add a warden pet class, what would we call that? So I called it an eggpet as apposed to a warden pet. And yes a petegg is the egg but a eggpet is the pet that's from an egg. Get it?
  • 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

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

Re: New EggPet class.

#5 Post by swietlowka » Wed Dec 01, 2010 10:32 am

swietlowka wrote:CEggPet:craft(craftType, indexLevel)

IndexLevel? Is it what it should make from the list? Is there a way for it to auto take the highest possible?

silly me, havent seen that part about defalult lol... anyway, since we are allready here, where would u put this crafting function in to your egg script, there no on leave combat, while feeeding or gathering or it just doesnt matter?

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

Re: New EggPet class.

#6 Post by jduartedj » Wed Dec 01, 2010 10:56 am

rock5 wrote:
swietlowka wrote:EDIT :
Oh I have a suggestion!
Pet merging! Very usefull to lvl pets.
rock5 wrote: I wasn't going to do pet merging as I didn't see the reason to bot it but I'd forgotten about the leveling trick. I'm not convinced of the benefits but I'll add merge functions. I'm not sure yet, though, if I'll add a function that does the merging trick or i I'll leave it to the user.

I just remembered, I didn't find the pet element type. We would need that so I'll have to look for it.
I would suggest, as you 'll have to do it anyway, to do a function for merging only and another specifically for leveling trick.
Like:

Code: Select all

CEggPet:merge(Agent_EggID,Reagent_EggID) --for merging 2 eggs, need ids because the names are all the same
CEggPet:PLevel(_mainpet_slot) -- as in PowerLeveling the pet to run the leveling trick.
Edited.
---

I do have to agree it might be expensive but one could have a bot farm for eggs only (or mostly) and in the end run CEggPet:PLevel(_petslotnr). making an imba pet in a matter of days i'd say. The only tricky part would be that you get pets of any element so some would be unusable making one discard or sell them on AH.
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: New EggPet class.

#7 Post by rock5 » Thu Dec 02, 2010 2:37 am

swietlowka wrote: where would u put this crafting function in to your egg script, there no on leave combat, while feeeding or gathering or it just doesnt matter?
Well you wouldn't need to feed your pet but if you wanted it to craft while you harvest eggs, you could just put some code in 1 of the waypoints to check the pet is still crafting.

Actually I'm contemplating having some profile settings.
eg.
EggPetEnabled = true or false
EggPetMode = "CRAFT" or "ASSIST"
EggPetFood = "Miller's Special Cake"
EggPetCraftSkill = "MINING" or "WOODWORKING" or "HERBALISM"
EggPetReturnAt = 60 -- Would return the pet when it's Nourishment reaches 60% but no more food

So if it is set to craft, it will craft and if it is set to assist, it will summon the pet to assist, regardless of what waypoint file you are running. What do you think?
jduartedj wrote:I would suggest, as you 'll have to do it anyway, to do a function for merging only and another specifically for leveling trick.
The way I was going to do it anyway was to do all the main functions first, eg. move eggs to the slots, merge the slots, maybe collect more info on that tab. Then if I did the trick I would use those functions.
jduartedj wrote:

Code: Select all

CEggPet:merge(Agent_EggID,Reagent_EggID) --for merging 2 eggs, need ids because the names are all the same
CEggPet:PLevel(_mainpet_slot) -- as in PowerLeveling the pet to run the leveling trick.
Edited.
The standard merge would be of slots and CEggPet already specifies an egg. So if we want to merge a slot to the pet described by the class it would look something like this.

Code: Select all

CEggPet:merge(Reagent_Slot) 
So the trick would just be about choosing the right egg from the inventory to put in the slot. Then do a merge and repeat or something like that. [/quote]
swietlowka wrote:I do have to agree it might be expensive but one could have a bot farm for eggs only (or mostly) and in the end run CEggPet:PLevel(_petslotnr). making an imba pet in a matter of days i'd say. The only tricky part would be that you get pets of any element so some would be unusable making one discard or sell them on AH.
Sure you could bot for eggs. It would be a standard waypoint file, using my catchcavy script. Then just run the trick function when you have enough eggs.

A problem I foresee is the item class doesn't provide the information necessary to choose the right egg. No Element, no Level, no Aptitude, no growth rates.
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: New EggPet class.

#8 Post by rock5 » Thu Dec 02, 2010 6:36 am

Looks like we can scrap the merging altogether. Not only can't I find any merge function in game but I can't even see how we can get the eggs in the eggslots.
  • 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: New EggPet class.

#9 Post by jduartedj » Thu Dec 02, 2010 7:46 am

rock5 wrote:Looks like we can scrap the merging altogether. Not only can't I find any merge function in game but I can't even see how we can get the eggs in the eggslots.
You probably tried that but....
Can't you use that pickup object function?

All I found was

Code: Select all

PetEggButton_OnClick
not sure what it does ...
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: New EggPet class.

#10 Post by rock5 » Thu Dec 02, 2010 9:06 am

jduartedj wrote:All I found was

Code: Select all

PetEggButton_OnClick
not sure what it does ...
Yeh I tried it but I couldn't figure out what values it accepted, so all I got were errors. It looks like it might be a table but a table of what, I have no idea.
  • 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: New EggPet class.

#11 Post by jduartedj » Thu Dec 02, 2010 9:18 am

rock5 wrote:
jduartedj wrote:All I found was

Code: Select all

PetEggButton_OnClick
not sure what it does ...
Yeh I tried it but I couldn't figure out what values it accepted, so all I got were errors. It looks like it might be a table but a table of what, I have no idea.
This might be asking a bit from you but could you post the values returned? maybe I (or someone else) can make some sense of it.

Have you tried giving it values? maybe PetEggButton_OnClick(i) in a for loop to test all values from -1 to 99 ?or maybe it takes petID(s)?

If you say it's a table maybe its a table referring to the new pet stats?

I'm just guessing now...
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: New EggPet class.

#12 Post by rock5 » Thu Dec 02, 2010 5:36 pm

jduartedj wrote:
rock5 wrote:
jduartedj wrote:All I found was

Code: Select all

PetEggButton_OnClick
not sure what it does ...
Yeh I tried it but I couldn't figure out what values it accepted, so all I got were errors. It looks like it might be a table but a table of what, I have no idea.
This might be asking a bit from you but could you post the values returned? maybe I (or someone else) can make some sense of it.

Have you tried giving it values? maybe PetEggButton_OnClick(i) in a for loop to test all values from -1 to 99 ?or maybe it takes petID(s)?

If you say it's a table maybe its a table referring to the new pet stats?

I'm just guessing now...
Yeh you are are asking too much. If it is a table, it could be a table with any number of elements and any type of values with an infinite variation. With no idea what it is, there is no chance. :)
  • 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: New EggPet class.

#13 Post by jduartedj » Thu Dec 02, 2010 6:24 pm

mehh... thanks anyway. We'll hav to wait for an update to rom wiki or something... :P maybe a leak xD
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: New EggPet class.

#14 Post by rock5 » Thu Dec 02, 2010 6:51 pm

I think the list of functions on the rom wiki get updated pretty quick. If there isn't a function there for merging then it doesn't exist. Maybe we can hope that they will add one, one day, in some future patch.
  • 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: New EggPet class.

#15 Post by jduartedj » Thu Dec 02, 2010 7:03 pm

true... thx Rock
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: New EggPet class.

#16 Post by rock5 » Thu Dec 02, 2010 10:33 pm

Just an update...

I tested the crafting the other night with some script in the onload section of a waypoint in my house. Ran it all night and the pet reached level 13 Mining.

Last night I tried the pet assist functions, by checking the pet.nourishment in the onLeaveCombat section of my profile and feeding it when necessary, while running a kill mob waypoint file. I'm fairly sure it ran all night, keeping the pet fed, but I can't be 100% sure because my client crashed this morning. I started it again about a couple of hours ago and it's still going, the pet is still out and it's nourishment is still above 80%. So it's working well.

Next test is to run a kill mob waypoint file while keeping the pet crafting. If all goes well I'll be about ready to commit.

At the moment I'm doing these tests by using the onLeaveCombat secton but I'd still like comments about my idea to have profile options for pets. The more I think about it the more I like it.
eg.

Code: Select all

EggPetEnabled = true or false
EggPetSlot = 1 -- The pet slot number to use.
EggPetMode = "CRAFT" or "ASSIST" -- Keep the bot crafting or keep it out to assist.
EggPetFood = "Miller's Special Cake" -- The food to use when the pet is 'assisting' you.
EggPetCraftSkill = "MINING" or "WOODWORKING" or "HERBALISM" or maybe "ANY" --The skill to use when crafting.
EggPetReturnAt = 60 -- When you have no more food, return the pet when it's Nourishment reaches 60%
  • 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: New EggPet class.

#17 Post by jduartedj » Thu Dec 02, 2010 10:57 pm

rock5 wrote:Just an update...

At the moment I'm doing these tests by using the onLeaveCombat secton but I'd still like comments about my idea to have profile options for pets. The more I think about it the more I like it.
eg.

Code: Select all

EggPetEnabled = true or false
EggPetSlot = 1 -- The pet slot number to use.
EggPetMode = "CRAFT" or "ASSIST" -- Keep the bot crafting or keep it out to assist.
EggPetFood = "Miller's Special Cake" -- The food to use when the pet is 'assisting' you.
EggPetCraftSkill = "MINING" or "WOODWORKING" or "HERBALISM" or maybe "ANY" --The skill to use when crafting.
EggPetReturnAt = 60 -- When you have no more food, return the pet when it's Nourishment reaches 60%
GOODIE!
I agree I had also thought about a couple of those when you said you were doing this class. As fot EggPetCraftSkill I think it could have all 4 optional values since ppl could specify one or just want to raise them all, or maybe use an array = {"MINING","WOODWORKING","HERBALISM"} (this is the same as any and people could include/remove the one they didn't like. Say for alchemy ppl only want "MINING" or "HERBALISM" , or only "HERBALISM" so = {"MINING","HERBALISM"} or just = {"HERBALISM"}.
this could be default:

Code: Select all

EggPetCraftSkill = {"MINING","WOODWORKING","HERBALISM"}

I don't know how you have coded your feed function but i was thinking instead of a time check (like check if 20min have passed) use a Nourishment check, eg if EggPet.Nourishment < 80 then (feed...) this is better in 1 way, you could start the game with the pet at 75% Nourishment. if So an EggPetLowNourishment option could also be included.

EDIT: then again you want to use if EggPet.Nourishment < 95 ALWAYS ... so EggPetLowNourishment doesnt make sense.

I take it Nourishment for EggPetReturnAt is to be checked at all times like player's HP?
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: New EggPet class.

#18 Post by rock5 » Fri Dec 03, 2010 5:09 am

jduartedj wrote: GOODIE!
I agree I had also thought about a couple of those when you said you were doing this class. As fot EggPetCraftSkill I think it could have all 4 optional values since ppl could specify one or just want to raise them all, or maybe use an array = {"MINING","WOODWORKING","HERBALISM"} (this is the same as any and people could include/remove the one they didn't like. Say for alchemy ppl only want "MINING" or "HERBALISM" , or only "HERBALISM" so = {"MINING","HERBALISM"} or just = {"HERBALISM"}.
this could be default:

Code: Select all

EggPetCraftSkill = {"MINING","WOODWORKING","HERBALISM"}
I like it. An array it is then with all of them as default. So it will depend on what tools you buy as to what craft is used.
jduartedj wrote:I don't know how you have coded your feed function but i was thinking instead of a time check (like check if 20min have passed) use a Nourishment check, eg if EggPet.Nourishment < 80 then (feed...) this is better in 1 way, you could start the game with the pet at 75% Nourishment.
Why would I use a time check if I know the nourishment level? :)
jduartedj wrote:if So an EggPetLowNourishment option could also be included.

EDIT: then again you want to use if EggPet.Nourishment < 95 ALWAYS ... so EggPetLowNourishment doesnt make sense.
Exactly, except if pet assist is 100% when nourishment is 80-100% then '< 80' might make more sense.
jduartedj wrote:I take it Nourishment for EggPetReturnAt is to be checked at all times like player's HP?
I was thinking it could just be checked when the player is updated. But I haven't thought it all through yet and actually haven't started any of the coding for the profile 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

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

Re: New EggPet class.

#19 Post by jduartedj » Fri Dec 03, 2010 8:55 am

rock5 wrote: Exactly, except if pet assist is 100% when nourishment is 80-100% then '< 80' might make more sense.
I didn't get this part fully... doesn't pet assist drop always w/ nourishment? anyway even if pet assist doesn't drop until nourishment < 80 you'd wanna keep feeding the pet whenever you have the chance so you don't allow it drop ever! And give that this is to be done at a safe place you might as well feed it right away so you don't risk dropping pet assist.

I was talking about a time check because of that user function that already exists with time check... but I get it'll be deprecated once the class is committed!

It's good to be of help! ;)
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
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: New EggPet class.

#20 Post by botje » Fri Dec 03, 2010 8:58 am

now make it talk with your pet when he wants to talk to you and your good to go xd

Botje

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest