Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --For use with the Advanced Macros Minecraft mod
- function HarvestTree.selectItem(sitem, prefSlot, optInv)
- return HarvestTree.selectItemD(sitem, -1, prefSlot, optInv)
- end
- --select with damage value
- function HarvestTree.selectItemD(sitem, sdmg, prefSlot, optInv)
- local inv = optInv or openInventory()
- local map = inv.mapping.inventory
- prefSlot = prefSlot or 1
- for i,j in pairs(map.hotbar) do
- local item = inv.getSlot(j)
- if item and( item.id==sitem and( sdmg==-1 or sdmg==item.dmg)) then
- setHotbar(i)
- return j
- end
- end
- for i,j in pairs(map.main) do
- local item = inv.getSlot( j )
- if item and (item.id==sitem and( sdmg==-1 or sdmg==item.dmg)) then
- setHotbar(prefSlot)
- local p = map.hotbar[prefSlot]
- inv.click(j)
- sleep(40)
- inv.click(p)
- sleep(40)
- if inv.getHeld() then
- inv.click(j)
- sleep(40)
- end
- if not optInv then inv.close() end
- return prefSlot
- end
- end
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement