Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- redstone.setOutput("bottom",true)
- xp = peripheral.wrap("right")
- term.clear()
- term.setCursorPos(1,1)
- turtle.select(1)
- if turtle.getItemCount(1) == 0 then
- print("Place books in the first slot")
- else
- write("Distributing books... ")
- for i = 2,16 do
- if turtle.getItemCount(i) == 0 then
- turtle.transferTo(i,1)
- end
- end
- print("Done")
- xp.setAutoCollect(true)
- for i = 2,16 do
- turtle.select(i)
- term.setCursorPos(1,2)
- term.clearLine()
- print(string.format("Enchanting book %d ",i-1))
- if turtle.getItemCount(i) > 0 then
- while not xp.enchant(30) do
- term.setCursorPos(1,3)
- term.clearLine()
- print(string.format("Current xp level: %d",xp.getLevels()))
- sleep(5)
- end
- end
- end
- xp.setAutoCollect(false)
- end
- redstone.setOutput("bottom",false)
Advertisement
Add Comment
Please, Sign In to add comment