Page 1 of 1
How to put items into arcane transmutor?
Posted: Wed Aug 15, 2012 7:48 am
by Jandrana
I'd like to make a script to put certain items into the arcane transmutor.
I tried to understand the elementfuser script, but currently I'm only confused.
In the script I only find "item:pickup()" methods. How to drop items?
Could somebody pls explain the steps in this routine?
Code: Select all
local function Fuse(id,num)
-- Move items to magic box
local need = num
local magicslot = 51
for i = 61,240 do
local item = inventory.BagSlot[i]
item:update()
if item.Available and (not item.Empty) and item.Id == id then
if item.ItemCount > need then
RoMScript("SplitBagItem("..item.BagId..","..need..")")
need = 0
else
item:pickup()
need = need - item.ItemCount
end
yrest(200)
inventory.BagSlot[magicslot]:pickup() yrest(200)
magicslot = magicslot + 1
end
if need == 0 then break end
end
yrest(500)
-- Press 'Confirm'
RoMScript("MagicBoxRequest()");
yrest(500)
EmptyMagicbox()
inventory:update()
end
Thank you!
Re: How to put items into arcane transmutor?
Posted: Wed Aug 15, 2012 8:08 am
by lisa
in a nut shell you want to pickup the item and then pickup the slot to put it in.
Transmutor is BagSlot 51-55
Code: Select all
item = inventory:findItem("Moonlight Pearl")
toslot = inventory.BagSlot[55]
item:pickup()
toslot:pickup()
That would move the MoonlightPearl to the last slot in transmuter regardless of if anything is in that slot. If something is there then it swaps with it.
So in the code you posted there are lots of checks to deal with that ( I didn't read it all though) So basically it would check if the slot is empty or not. No doubt a check for if the item you want to move is in an available blagslot, rent may have expired.
Hopefully the little code I posted helps you in some way =)
Re: How to put items into arcane transmutor?
Posted: Wed Aug 15, 2012 9:04 am
by rock5
After you have the item you can move it to the transmutor by using the moveTo function.
Code: Select all
item = inventory:findItem("Moonlight Pearl")
if item then
item:moveTo("magicbox")
end
Benefit of this is you don't have to look for an empty and it will merge if it can.
Re: How to put items into arcane transmutor?
Posted: Wed Aug 15, 2012 6:52 pm
by lisa
hmm when I looked through item.lua I didn't see any bag = "magicbox"
Ahhh I get it now, getInventoryRange designates magicbox to 51-60.
Re: How to put items into arcane transmutor?
Posted: Sat Jun 22, 2013 12:46 pm
by Cindy
Code: Select all
for i = 1,10 do
item = inventory:findItem("Small Hoe")
if item then
item:moveTo("magicbox") end
item = inventory:findItem("Small Spade")
if item then
item:moveTo("magicbox") end
item = inventory:findItem("Small Hatchet")
if item then
item:moveTo("magicbox") end
end
.. does not seem to do anything (i have Small Hoes in the backpack).
Also, any way to trigger auto purchase in Pet Auto Craft via the bot? Basically at the start of my Golden Egg farm, I'd like to buy 10 stacks of tools (exact type to be determined from a profile setting?) and move them into the transmutor for out-of-sight storage. I'd love for all this to happen automatically, right now I do everything manually.
Re: How to put items into arcane transmutor?
Posted: Sat Jun 22, 2013 1:32 pm
by rock5
The only thing I can see wrong with the code is that the magic box is included by default in items searches so it might be finding items that are already in the magic box. Try limiting the searches to the bags, eg.
Code: Select all
item = inventory:findItem("Small Hoe","bags")
Yes there are options to have your pet auto craft. Have a look in the default.xml profile to see the main ones. Mainly you need
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. -->
The profile is missing the options for buying though. They are
Code: Select all
<option name="EGGPET_HOE" value="99" />
<option name="EGGPET_SPADE" value="99" />
<option name="EGGPET_HATCHET" value="99" />
These work the same as potion and arrow buying options.
MRC_Optimized is set up to use these settings to automatically go buy more tools when needed.
Re: How to put items into arcane transmutor?
Posted: Sun Jun 23, 2013 7:03 pm
by lolita
Cindy maybe this will help for moving items
Code: Select all
function test_move_to_transmutor()
local move_list = {
"Small Hatchet",
"Small Spade",
"Small Hoe"
}
for k,v in pairs(move_list) do
repeat
local item = inventory:findItem(v,"bags")
if item then
item:moveTo("magicbox")
end
until not item or inventory:itemTotalCount(0,"magicbox") == 0
end
end
Re: How to put items into arcane transmutor?
Posted: Tue Jun 25, 2013 11:01 am
by Cindy
Thank you!
Re: How to put items into arcane transmutor?
Posted: Tue Jun 25, 2013 11:01 am
by Cindy
Thank you!
Re: How to put items into arcane transmutor?
Posted: Fri Dec 06, 2013 12:07 pm
by noobbotter
I have a related follow up question. If I have the bot put two items in the transmutor and I want to combine them, How would I do that? I got the part where it puts the two items (a stone and a piece of equipment) but how to I transmute them? I didn't see a way to do that using the fusion mod by Rock 5. I just need to be able to press the button to fuse and then I can do the code to move the resulting stone from the transmutor. Thanks.
Re: How to put items into arcane transmutor?
Posted: Sat Dec 07, 2013 2:34 am
by rock5
Well, the userfunction never 'clicks' the magicbox fuse button. It only uses the fusion addon start button. To see the right command you would have had to have a look in the fusion addon.
Anyway, the command is,
Re: How to put items into arcane transmutor?
Posted: Sat Dec 07, 2013 10:30 am
by noobbotter
Awesome. Thanks. That worked for me.