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