Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chest = peripheral.wrap('bottom')
- local chest2 = peripheral.wrap('top')
- local slotList = {3, 5, 6, 7, 9, 10, 11}
- turtle.select(1)
- function reset()
- for i = 2, 16 do
- local info = turtle.getItemDetail(i)
- if info and info.name == 'minecraft:redstone_block' then
- turtle.select(i)
- turtle.dropDown()
- elseif info and info.name == 'minecraft:nether_star' then
- turtle.select(i)
- turtle.dropUp()
- end
- end
- turtle.select(1)
- end
- function find(id, inv)
- for i = 1, 27 do
- local meta = inv.getItemMeta(i)
- if meta and meta.name == id then
- return i
- end
- end
- return false
- end
- while true do
- reset()
- local star = find('minecraft:nether_star', chest2)
- local reds = find('minecraft:redstone_block', chest)
- local book = turtle.getItemDetail(1)
- if star and book and book.damage < 744 then
- chest2.pushItems('down', star)
- print(turtle.craft())
- chest2.pullItems('down', 2, 1)
- turtle.select(2)
- turtle.drop()
- turtle.select(1)
- end
- if reds then
- chest.pushItems('up', reds, 8)
- local redsCount = turtle.getItemCount(2)
- turtle.select(2)
- if redsCount > 1 then
- for _, i in pairs(slotList) do
- turtle.transferTo(i, 1)
- if _ == redsCount - 1 then
- break
- end
- end
- end
- turtle.select(1)
- turtle.craft()
- end
- end
- --Tome from reliquary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement