Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local SLOT_COUNT = 16
- local CRAFT_SLOTS = {1, 2, 5, 6}
- function getItemIndex(itemName)
- for slot = 1, SLOT_COUNT, 1 do
- local item = turtle.getItemDetail(slot)
- if(item ~= nil) then
- if(item["name"] == itemName) then
- return slot
- end
- end
- end
- return 17
- end
- function lookForSb()
- if (getItemIndex("minecraft:stone_bricks") < 16 ) then
- return true
- else
- return false
- end
- end
- while true do
- turtle.select(1)
- for slot = 1, 4, 1 do
- turtle.select(CRAFT_SLOTS[slot])
- turtle.suckUp()
- end
- turtle.craft(64)
- -- Looks for stone bricks in the turtle inv
- -- and drops them into a storage in front of it
- while lookForSb() do
- sbSlot = getItemIndex("minecraft:stone_bricks")
- if (sbSlot < 16) then
- turtle.select(sbSlot)
- turtle.drop()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement