Pet Crafting
Re: Pet Crafting
So to take this a little further could we use BuyItemByName(); to buy the tools?
Re: Pet Crafting
I think so. It is still a store interface right?S3v3n11 wrote:So to take this a little further could we use BuyItemByName(); to buy the tools?
- 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: Pet Crafting
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
- MiesterMan
- Posts: 543
- Joined: Tue Jul 06, 2010 9:15 pm
- Location: Between the Second and Third Circles of Hell
Re: Pet Crafting
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.
Edit: If anyone has experience building XML frames for add-ons and wants to help, please PM me.
My RoM Bot toys:
- Object Viewer: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2619
Teleporter Functions: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2605
Waypoint Finder: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2616
Mail Functions: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2612
Equipment Swapper(TempFixed): http://www.solarstrike.net/phpBB3/viewt ... =27&t=2571
Re: Pet Crafting
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.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.
- 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: Pet Crafting
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*
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*
Re: Pet Crafting
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.
Here is a companion function that returns the first slot that has a pet tool.
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
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
Re: Pet Crafting
Any progress on this? ...really looking forward to this one.
- MiesterMan
- Posts: 543
- Joined: Tue Jul 06, 2010 9:15 pm
- Location: Between the Second and Third Circles of Hell
Re: Pet Crafting
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.
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.
My RoM Bot toys:
- Object Viewer: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2619
Teleporter Functions: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2605
Waypoint Finder: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2616
Mail Functions: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2612
Equipment Swapper(TempFixed): http://www.solarstrike.net/phpBB3/viewt ... =27&t=2571
Re: Pet Crafting
Why edit the consumables.xml file? Just create code to buy what you want. Actually let me find my function.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.
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
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
Re: Pet Crafting
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
Check it out and maybe we can borrow some code from there.
http://rom.curse.com/downloads/rom-addo ... tinfo.aspx
Re: Pet Crafting
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.
Edit: Of course includes the autobuy of tools.
Re: Pet Crafting
There are eggpet crafting options. Check out default profile. Eg,
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.
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
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. -->
Code: Select all
<option name="EGGPET_HOE" value="99" />
<option name="EGGPET_SPADE" value="99" />
<option name="EGGPET_HATCHET" value="99" />
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
Who is online
Users browsing this forum: Google [Bot] and 3 guests