Pet Crafting

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Pet Crafting

#1 Post by MiesterMan » Thu Sep 09, 2010 11:37 am

I kept doing serches but didn't find what I was looking for, then it said you can't search anymore so I'll just go ahead and ask.

Does anyone know the function you use to set the type of Pet Crafting item from the dropdown?

I found everything else to make a pet crafting bot but I can't figure out the stupid dropdown, nothing I use works.

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

#2 Post by MiesterMan » Thu Sep 09, 2010 12:17 pm

Also, does anyone know the pet return function? The only way I'm able to feed my pet is by using the fastLoginRelog=true and waiting 60 seconds to send my pet feed macro then waiting another 8 seconds to resummon.

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

Re: Pet Crafting

#3 Post by S3v3n11 » Fri Sep 10, 2010 9:15 am

Maybe if you post what you have someone can help. :)

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

Re: Pet Crafting

#4 Post by taran » Sun Sep 12, 2010 5:14 am

I have yet to find a way to set the pet crafting dropdown from a commandline..

i also have yet to find a way to put a tool into the usage box for the pet with a command line..

i have however found the pet summon/return commands

/run SummonPet(#); (Summons pet-- # is equal to slot # of pet)

/run ReturnPet(#); (Returns Pet-- # is Equal to Slot # of pet)

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

#5 Post by MiesterMan » Sun Sep 12, 2010 10:02 am

Ah, thank you, I thought I tried that ReturnPet but it didn't work. Must have typed it wrong.

For the pet feed macro use:

Code: Select all

sendMacro("ClearPetFeedItem();");
yrest(200);
sendMacro("PickupBagItem(GetBagItemInfo(x));");
yrest(200);
sendMacro("ClickPetFeedItem();");
yrest(200);
sendMacro("FeedPet(1)");
yrest(200);
sendMacro("ClearPetFeedItem();");
Where x is the bagslot you've put your food in and 1 is the breeding slot of the pet you want to feed. I use a long macro in game but you can't squeeze it into one with sendMacro.

I'll try to make a function that searches the inventory for a specified food item later to make this cleaner. As for pet crafting I'll have to start over. My settings were cleared by frogster again and I lost all my test macros.

Edit: As usual I misnamed the function, it's PickupBagItem...

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

Re: Pet Crafting

#6 Post by taran » Mon Sep 13, 2010 12:04 am

Ok you got me curious now, i got a FDB extractor to pull out the pet frame UI interface :)

I would love to make this an "addon" that throws in tools based you telling it to do mining/harvesting/woodchoping (or all 3)

i found a way to set the dropdown, but you have to do one of two things first (and u may know how to get around this or make it 1 line)
You have to open up the pet menu and click on the egg you want to use, or you have to do a
/run PET_CURRENT_ITEM = # (Egg slot # can force default variable) the PET_CURRENT_ITEM variable is one the set in the pet frame UI to tell which Egg slot your using for everything.

to set the dropdown variable on the pet harvesting it is this line

/run UIDropDownMenu_SetSelectedID(PetCraftTypeDropDown, #); # = Set selected Production type 1-15 ATM


BTW i don't know jack shit about coding i just read and then poke/prod and see what does what..

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

Re: Pet Crafting

#7 Post by S3v3n11 » Mon Sep 13, 2010 6:03 am

Good stuff guys!

Thanks for your hard work!

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

Re: Pet Crafting

#8 Post by taran » Tue Sep 14, 2010 5:02 am

I have run into one issue turning this into a bot that can automatically do everything with 0 mouse input (so it works in background)

and that is the PickupBagItem command, i believe that HAS to be used to pick up a tool from your bag and place it into the box for the pet to use. I have dug around and i don't really
see any Micromacro scripts using that, most call to directly use an item, but pick up and item and then use it someplace else.

Anyone have any experience with that? The pickupbagitem calls an ID in game for the bag slot, but i know those bag slots can change and/or even if they don't change i would rather it picked up the items based on the unique ID of the item like follows
Small Spade 204230
Small Hoe 204228
small hatchet 204232
That way no matter what inventory slot or bag slot the tool was in it could grab one (as long as one was available) and use it.

I am hoping someone more experienced than myself has an idea of how to use the PickupBagItem command in game OR a command for micromacro that will pick up the item to use.


I am still hovering between it being possible to make an Addon out of all this or simply a mouseless way to harvest/craft with pet using Micromacro

Thanks for any input! :)

redcrux
Posts: 5
Joined: Tue Jul 14, 2009 9:28 pm

Re: Pet Crafting

#9 Post by redcrux » Wed Sep 15, 2010 12:38 am

well, if im understanding this correctly, one of you has everything exept the dropdown menu, and one of you has the dropdown menu then it should be all good right?

now just gotta collaborate and release a sweet pet mod :D

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

Re: Pet Crafting

#10 Post by S3v3n11 » Wed Sep 15, 2010 5:50 am

redcrux wrote:well, if im understanding this correctly, one of you has everything exept the dropdown menu, and one of you has the dropdown menu then it should be all good right?

now just gotta collaborate and release a sweet pet mod :D
Yes please! :)

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

Re: Pet Crafting

#11 Post by rock5 » Wed Sep 15, 2010 7:57 pm

What would be really cool is an egg pet class, with maybe the pet values gotten from memory. And commands for the pet as functions of that class.
  • 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

#12 Post by taran » Thu Sep 16, 2010 3:31 am

Hahaha i gotta admit what Rock5 said went way over my head.. i assume he was talking about integrating the egg/pet and harvesting process directly into micromacro :)

I have come up with a way to harvest with the pet without using the mouse finally... ATM i have this one set to use bag slot 5 and the 1st slot in bag slot 5 for the tools, i also have it set to use the 3rd tier of harvesting for the pet which is the level 11+ stuff i tried to put notes on each command so you could see what it was doing and also so you could change the bag it used and the tier it is harvesting at..

ATM the store bought tools that come in stack of 99 always stack to the top of the bag if your resort it.. so the trick i am using it calling the 1st slot of bag 5 (121) and after it is done i resort bag 5 so a new tool falls to the 1st slot :) cheap and dirty but hey! it works!

Btw the waypoint is inside your house.. i would love to get this running without ANY waypoint so it could run in the background as i played :)

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<!-- #  1 --><waypoint x="-34" z="31">
		yrest(5000)
		RoMScript("PickupBagItem(GetBagItemInfo(121));"); -- Pick up 1st item in 5th bag slot
		yrest(2000)
		RoMScript("ClickPetCraftItem(1);"); -- uses current picked up item on pet #1 tool slot
		yrest(2000)
		RoMScript("UIDropDownMenu_SetSelectedID(PetCraftTypeDropDown, 3);"); -- sets level of item to harvest with the #
		yrest(2000)
		RoMScript("PetCraftStartButton_OnClick();"); -- Starts harvesting
		yrest(1090000) -- the long pause it for length using 99 tools
		RoMScript("PetCraftHarvestButton_OnClick();"); -- Collects harvested material
		yrest(2000)
		RoMScript("RefreshBag(5);"); -- Resorts bag 5
		yrest(2000)
	</waypoint>
</waypoints>
i will try to answer any questions anyone has but remember i am a "noob" at this!


*EDIT*
oh btw those LONG Yrest pauses were all for when i had this working 100% with mouse clicks alone, i suspect now those could be reduced a LOT if not eliminated in some places! i just had no time
to test it tonight with server going down

Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: Pet Crafting

#13 Post by Starrider » Thu Sep 16, 2010 6:14 am

is it possible to have more than one bagslot with tools for the pet? So is it possible to scan the inventory for the objectID an then to return the slotnumber where one is inside (true), and then take this tools dynamic with the script.

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

Re: Pet Crafting

#14 Post by taran » Thu Sep 16, 2010 6:21 am

That is actually want i would like to do.. i know the ID's of all the tools.. but you can't use the PickupBagItem command with a name, only with a ID # of the bag, and those ID #'s change aparently so you have to call the GetBagItemInfo command to guarantee you get the right bag slot #.

I know Rock5 could do this, he does the same thing in the fusion program, creating a table of the slot #'s of the items to use when doing tier stone creation.

I suspect this could be accomplished with a simple function added to the addon folder of the game, but i am afraid it may be beyond me, but i know it IS possible, and i know using Micromacro it would be easy to tell it which one to scan for using commands such as

if inventory:getItemCount(204230) < 1 then
etc etc....

you could if nothing else have 3 bags of 1 type of tools each and use If statements like above to tell it which bag to pull a tool from, that would increase the time needed before needing to buy more tools if nothing else..


Hopefully some others have more input on this, but at least we are getting somewhere with it! :)

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

#15 Post by MiesterMan » Thu Sep 16, 2010 10:41 am

I'm sorry, I hadn't been paying attention to the forum and completely forgot about this thread. What you were asking before is what I was talking about making a function for. Using the rombot inventory class and searching the known inventory for a bagslot containing the item needed for use. I'll look it up and post it so this can be completed.

Edit: Ok, this should do it. (modded from itemTotalCount)

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

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

#16 Post by MiesterMan » Thu Sep 16, 2010 12:42 pm

Taking a break but here's what I got so far:

petCraft.xml:

Code: Select all

<harvestable>
	<!-- Mining -->
	<harvest tool="Small Hoe" name="Zinc Mine" level="1" index="1" />
	<harvest tool="Small Hoe" name="Tin Mine" level="8" index="2" />
	<harvest tool="Small Hoe" name="Superior Tin Mine" level="11" index="3" />
	<harvest tool="Small Hoe" name="Iron Mine" level="1" index="4" />
	<harvest tool="Small Hoe" name="Copper Mine" level="1" index="5" />
	<harvest tool="Small Hoe" name="Dark Crystal Mine" level="1" index="6" />
	<harvest tool="Small Hoe" name="Superior Dark Crystal Mine" level="1" index="7" />
	<harvest tool="Small Hoe" name="Silver Mine" level="1" index="8" />
	<harvest tool="Small Hoe" name="Wizard-Iron Mine" level="1" index="9" />
	<harvest tool="Small Hoe" name="Superior Wizard-Iron Mine" level="1" index="10" />
	<harvest tool="Small Hoe" name="Moonsilver Mine" level="1" index="11" />
	<harvest tool="Small Hoe" name="Abyss-Mercury Mine" level="1" index="12" />
	<harvest tool="Small Hoe" name="Rune Obsidian Mine" level="1" index="13" />
	<harvest tool="Small Hoe" name="Superior Rune Obsidian Mine" level="1" index="14" />
	
	<!-- Herbalism -->
	<harvest tool="Small Spade" name="Mountain Demon Grass Thicket" level="1" index="1" />
	<harvest tool="Small Spade" name="Beetroot Thicket" level="8" index="2" />
	<harvest tool="Small Spade" name="Superior Beetroot Thicket" level="11" index="3" />
	<harvest tool="Small Spade" name="Bitterleaf Thicket" level="14" index="4" />
	<harvest tool="Small Spade" name="Moxa Thicket" level="20" index="5" />
	<harvest tool="Small Spade" name="Dusk Orchid Thicket" level="26" index="6" />
	<harvest tool="Small Spade" name="Superior Dusk Orchid Thicket" level="31" index="7" />
	<harvest tool="Small Spade" name="Barsleaf Thicket" level="32" index="8" />
	<harvest tool="Small Spade" name="Moon Orchid Thicket" level="38" index="9" />
	<harvest tool="Small Spade" name="Superior Moon Orchid Thicket" level="41" index="10" />
	<harvest tool="Small Spade" name="Sinners Palm Thicket" level="44" index="11" />
	<harvest tool="Small Spade" name="Dragon Mallow Thicket" level="50" index="12" />
	<harvest tool="Small Spade" name="Thorn Apple Thicket" level="56" index="13" />
	<harvest tool="Small Spade" name="Superior Thorn Apple Thicket" level="61" index="14" />
	
	<!-- Woodcutting -->
	<harvest tool="Small Hatchet" name="Ash Forest" level="1" index="1" />
	<harvest tool="Small Hatchet" name="Willow Forest" level="8" index="2" />
	<harvest tool="Small Hatchet" name="Superior Willow Forest" level="11" index="3" />
	<harvest tool="Small Hatchet" name="Maple Forest" level="14" index="4" />
	<harvest tool="Small Hatchet" name="Oak Forest" level="20" index="5" />
	<harvest tool="Small Hatchet" name="Pine Forest" level="26" index="6" />
	<harvest tool="Small Hatchet" name="Superior Pine Forest" level="31" index="7" />
	<harvest tool="Small Hatchet" name="Holly Forest" level="32" index="8" />
	<harvest tool="Small Hatchet" name="Yew Forest" level="38" index="9" />
	<harvest tool="Small Hatchet" name="Superior Yew Forest" level="41" index="10" />
	<harvest tool="Small Hatchet" name="Tarslin Demon Wood Forest" level="44" index="11" />
	<harvest tool="Small Hatchet" name="Dragonlair Forest" level="50" index="12" />
	<harvest tool="Small Hatchet" name="Ancient Spirit Oak Forest" level="56" index="13" />
	<harvest tool="Small Hatchet" name="Duperior Ancient Spirit Oak Forest" level="61" index="14" />
	
</harvestable>
petCraft.lua:

Code: Select all

petCraft = {}
function petCraft.load()
	local root = xml.open(getExecutionPath() .. "/database/petCraft.xml");
	local elements = root:getElements();

	for i,v in pairs(elements) do
	    local tool, name, level, index;
		local tmp = {};

		tool = v:getAttribute("tool");
		name = v:getAttribute("name");
		level = v:getAttribute("level");
		index = v:getAttribute("index");

		if (type) then tmp.Type = type; end;
		if (name) then tmp.Name = name; end;
		if (level) then tmp.Level = level; end;
		if (index) then tmp.Index = id; end;

		petCraft[index] = tmp;
	end
end

function petCraft.Craft()
Also, I'm modifying what you have above to work with ingame addons. When you have that many romscripts it's a lot faster to have a function in an addon doing most of it. For now I have stuff I gotta do so stopping here.

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

#17 Post by MiesterMan » Thu Sep 16, 2010 8:14 pm

Ok, I guess it's time for an update since I'll be taking a break soon. After following taran's lead with an FDB extractor and found that the dropdown is unnecessary. I've also made function to return all viable pet information that one might want to use for a whole bunch of things. Still writing it so I'm not posting it yet. Also, can anyone confirm if I was creating the class right? I'm not going to get indexing errors because I was formatting it wrong am I?

(my bot is currently not working so I can't test anything aside from my ingame functions)

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

Re: Pet Crafting

#18 Post by rock5 » Thu Sep 16, 2010 11:24 pm

MiesterMan wrote:I'm sorry, I hadn't been paying attention to the forum and completely forgot about this thread. What you were asking before is what I was talking about making a function for. Using the rombot inventory class and searching the known inventory for a bagslot containing the item needed for use. I'll look it up and post it so this can be completed.

Edit: Ok, this should do it. (modded from itemTotalCount)

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
Is the idea of this that it is supposed to return the slot number so you can use it with ingame function 'PickupBagItem'? If so, it won't work. The returned 'slot' value does not correspond with the ingame slotnumber. It used to but not anymore. The slotnumber is supposed to be stored in 'item.SlotNumber' but VoidMain was not able to figure out how to get that value from memory so they all have '-1' as the value.

If you install my mail mods
http://www.solarstrike.net/phpBB3/viewt ... =21&t=1561
you can use the function 'updateSlotNumbers()' to update all the slot numbers. Then you could use item.SlotNumber with 'PickupBagItem'. It takes a few seconds to run but shouldn't need to be run often as the slot numbers don't usually change.
  • 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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Pet Crafting

#19 Post by MiesterMan » Fri Sep 17, 2010 12:25 am

Edit: nm, I think I understand what you're saying. Man, that wonk.
Edit: well, I wrote a search function in the game so it will find the first available one. I think I'm going to make it all in the ingame functions save for the initiate command.

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

Re: Pet Crafting

#20 Post by rock5 » Fri Sep 17, 2010 3:37 am

MiesterMan wrote:Edit: well, I wrote a search function in the game so it will find the first available one. I think I'm going to make it all in the ingame functions save for the initiate command.
That's a good idea because it would run a lot quicker.
  • 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: Ahrefs [Bot], Semrush [Bot] and 57 guests