Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = peripheral.wrap("right")
- local enchants = 0
- p.setAutoCollect(true)
- while true do
- local curLevel = p.getLevels()
- term.clear()
- term.setCursorPos(1,1)
- print("Level: " .. curLevel)
- print("Enchants: " .. enchants)
- if curLevel >= 30 then
- enchants = enchants + 1
- print("Enchanting!")
- turtle.select(1)
- turtle.suck()
- local count = turtle.getItemCount(1)-1
- if count < 0 then
- print("Ran out of books!")
- while count < 0 do
- turtle.suck()
- count = turtle.getItemCount(1)-1
- sleep(5)
- end
- end
- turtle.drop(turtle.getItemCount(1)-1)
- p.enchant(30)
- turtle.drop()
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement