Pet Crafting

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
S3v3n11
Posts: 91
Joined: Thu Jul 09, 2009 7:37 am

Re: Pet Crafting

#21 Post by S3v3n11 » Fri Sep 17, 2010 7:25 am

So to take this a little further could we use BuyItemByName(); to buy the tools?

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

Re: Pet Crafting

#22 Post by rock5 » Fri Sep 17, 2010 7:47 pm

S3v3n11 wrote:So to take this a little further could we use BuyItemByName(); to buy the tools?
I think so. It is still a store interface right?
  • 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

affirm
Posts: 14
Joined: Sun Sep 19, 2010 5:33 pm

Re: Pet Crafting

#23 Post by affirm » Sun Sep 19, 2010 5:37 pm

Ok, so I'm completely new to this stuff but I've managed to set up this bot... Now i'm just wondering, is it possible (if so and how) to talk to the housekeeper, open up my bank box, and do the "resort" then take the first item in the bank and put it into bag 5 so that I can use all the spades in my bankbox aswell as the ones in my bag 5 so that I only need to check back once a day. Thanks

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Pet Crafting

#24 Post by MiesterMan » Sun Sep 19, 2010 5:45 pm

Update for this, I've pretty much completed the necessary in-game functions to make this work but I ran into an issue where if the pet interface hadn't been opened before the commands are used it fails to put the tool into the tool slot. Since the only thing I've been able to get to work are egg scripts that's what I've been running to make up for not being able to do my daily routines. So I don't have a pc to work on this at the moment. I promise to post it if I do finish it though.

Edit: If anyone has experience building XML frames for add-ons and wants to help, please PM me.

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

Re: Pet Crafting

#25 Post by rock5 » Sun Sep 19, 2010 10:02 pm

MiesterMan wrote:Update for this, I've pretty much completed the necessary in-game functions to make this work but I ran into an issue where if the pet interface hadn't been opened before the commands are used it fails to put the tool into the tool slot.
You could check to see if the frame is visible before continuing but you would need to know the name of the frame which is not easy to find.
  • 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

taran
Posts: 13
Joined: Wed Aug 04, 2010 5:33 pm

Re: Pet Crafting

#26 Post by taran » Sun Sep 19, 2010 11:22 pm

If ya want Misterman give me a crack at your code, i wonder why it wouldn't work if you didn't open pet window first, that ALMOST sounds like you might not be setting the default pet value...

If any of the api's your calling use PET_CURRENT_ITEM as default that will need to be set to the Egg slot # first or it will freak all out (in fact if you set that to a slot you don't have it crashes the game when you open pet window *rofl*

S3v3n11
Posts: 91
Joined: Thu Jul 09, 2009 7:37 am

Re: Pet Crafting

#27 Post by S3v3n11 » Mon Sep 20, 2010 11:25 am

Not sure if this will help or not but I got this from another addon. You pass it an item id and it will return the slot #. It only scans the first 60 slots but it would be easy to mod it to look at all your slots.

Code: Select all

function igf_GetBagIndex(_ItemID)

   local i;
   local BagSlotIndex = 0;
   
   local ItemCount = GetBagItemCount(_ItemID);
   
   if ( ItemCount > 0 ) then

      for i=1, 60 do
   
         local invNr = GetBagItemInfo(i);
         local itemLink = GetBagItemLink(invNr);
         if (itemLink) then
            local _, itemData, itemName = ParseHyperlink(itemLink);
        local _, _, itemID = string.find(itemData, "^(%x+)");
        itemID = tonumber(itemID, 16);
     
        if ( itemID == _ItemID ) then
           BagSlotIndex = i;
           break;
        end
        
     
         end
      end
   end
   
   return BagSlotIndex;
   
end
Here is a companion function that returns the first slot that has a pet tool.

Code: Select all

function igf_GetFirstPetTool()

   local i;
   local FirstPetToolIndex = 0;
   local PetToolType = "";
   local MatIDs = { 204228, 204230, 204232 };
   
   for i=1,3 do
      DEFAULT_CHAT_FRAME:AddMessage("i = " .. i);
      FirstPetToolIndex = igf_GetBagIndex(MatIDs[i]);
      if ( FirstPetToolIndex > 0) then
         if ( i == 1 ) then PetToolType = "MINING" end
     if ( i == 2 ) then PetToolType = "HERB" end
     if ( i == 3 ) then PetToolType = "WOOD" end
         break;
      end
         
   end
   
   return FirstPetToolIndex,PetToolType ;
   
end
   

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

Re: Pet Crafting

#28 Post by Alkaiser » Sat Sep 25, 2010 2:06 pm

Any progress on this? ...really looking forward to this one.

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Pet Crafting

#29 Post by MiesterMan » Tue Oct 12, 2010 6:42 pm

I've got a working version i've been using but I keep getting stuck on the finishing touch. As of now the addon for in the game only has one problem relating to the dropdown list. Even though the command includes the particular list type the UIDropDown list will use the existing values if any have been loaded or will use nil values if none have been. So what I've been doing is opening the pet craft menu and hitting the dropdown arrow to make it load the correct list.

Despite all the additions I've made and all the time I've spent looking through the PetCraft code file I've been unable to find the method used to load the petcrafting tool dropdown info so I still don't want to post it since I consider this to be a major bug.

A second problem I have with this mod has to do with buying items. I made a second function to buy items specific to pet crafting and it works but I was unable to load a seperate XML file to mode the existing consumables list so at current this mod will require you to add items to the consumables.xml file.

Anyone that knows a way around either or both of these problems please let me know. I've burned myself out searching the files a couple dozen times now so any help would be great.

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

Re: Pet Crafting

#30 Post by rock5 » Tue Oct 12, 2010 9:07 pm

MiesterMan wrote:A second problem I have with this mod has to do with buying items. I made a second function to buy items specific to pet crafting and it works but I was unable to load a seperate XML file to mode the existing consumables list so at current this mod will require you to add items to the consumables.xml file.
Why edit the consumables.xml file? Just create code to buy what you want. Actually let me find my function.

Code: Select all

function BuyItemByName(itemname, num)
------------------------------------------------
-- Buy number of items by item name
-- itemname = name of item to buy
-- num = number of items to buy
-- Store should already be open
------------------------------------------------
    if num == nil then num = 1 end -- Assume you want to buy 1

    counter = 1
    icon, name = RoMScript("GetStoreSellItemInfo("..counter..")")
    while name do
        if string.find(name,itemname,0,"plain") then
            for i = 1, num do
                sendMacro("StoreBuyItem("..counter..")"); yrest(1200);
            end
            return true
        end
        counter = counter + 1
        icon, name = RoMScript("GetStoreSellItemInfo("..counter..")")
    end
    return false
end
To use this you need to open the store first, so

Code: Select all

player:target_NPC("npcname")
RoMScript("ChoiceOption(1);")
  • 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

Paton
Posts: 28
Joined: Fri Sep 03, 2010 12:23 pm

Re: Pet Crafting

#31 Post by Paton » Wed Oct 13, 2010 10:08 am

A new Addon for Pets is out and it has some nice functions, including a button on the NPC menu to buy tools.

Check it out and maybe we can borrow some code from there.

http://rom.curse.com/downloads/rom-addo ... tinfo.aspx

Aron
Posts: 39
Joined: Tue Feb 19, 2013 10:30 am

Re: Pet Crafting

#32 Post by Aron » Thu Oct 24, 2013 8:52 am

Is there a complete function for this kind of bot now? For example to place your character at the Pet Hunter and declare which gather skill you want to level, example Herb/Mining/Wood in the XML file. Havent red the entire thread yet, but this kind of bot would be great.
Edit: Of course includes the autobuy of tools.

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

Re: Pet Crafting

#33 Post by rock5 » Thu Oct 24, 2013 9:29 am

There are eggpet crafting options. Check out default profile. Eg,

Code: Select all

		<option name="EGGPET_ENABLE_CRAFT"	value="true" />		<!-- If using same slot for assist and craft, onlt 1 can be enabled. -->
		<option name="EGGPET_CRAFT_SLOT"	value="1" />
		<option name="EGGPET_CRAFT_RATIO"	value="1:1:1" /> 		<!-- mining:woodworking:herbalism ratio to produce. -->
As for buying tools, there are options for that too but they weren't included in the default profile but they are buy options similar to the pots and arrow buy options.

Code: Select all

		<option name="EGGPET_HOE"		value="99" />
		<option name="EGGPET_SPADE"		value="99" />
		<option name="EGGPET_HATCHET"	value="99" />
They tell the bot how many tools to buy when you use the player:merchant() command.

With the pet crafting settings set you only need to do player:merchant every now and then to buy more tools.

Although there may be addons that can do this such as this one, http://www.curse.com/addons/rom/pet-auto-craft
  • 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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 48 guests