Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local anvil = peripheral.wrap("right")
- local xpTable = peripheral.wrap("left")
- xpTable.setAutoCollect(true)
- function combineItems(slotOne, slotTwo)
- if xpTable.getLevels() >= anvil.getRepairCost(slotOne, slotTwo) then
- turtle.select(1)
- if turtle.compareTo(2) then
- if anvil.repair(slotOne, slotTwo) then
- print("Repaired, dropping.")
- turtle.select(slotOne)
- turtle.drop()
- else
- print("Can't repair that.")
- turtle.select(slotOne)
- turtle.drop()
- turtle.select(slotTwo)
- turtle.drop()
- end
- else
- print("Not the same.")
- turtle.select(1)
- turtle.drop()
- turtle.select(2)
- turtle.drop()
- end
- else
- sleep(1)
- end
- end
- -------------
- while true do
- -------------
- for i = 1,2 do
- if turtle.getItemCount(i) == 0 then
- turtle.select(i)
- turtle.suckUp()
- end
- end
- combineItems(1,2)
- sleep(.5)
- ---
- end
- ---
Advertisement
Add Comment
Please, Sign In to add comment