Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- e = peripheral.wrap("left")
- e.setAutoCollect(true)
- hasBooks = true
- function unload()
- turtle.turnRight()
- for i = 2, 16 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.select(1)
- turtle.turnLeft()
- end
- function checkFull()
- if turtle.getItemCount(16) > 0 then
- unload()
- end
- end
- function hasBook()
- if turtle.getItemCount(1) == 1 and turtle.getItemDetail(1).name == "minecraft:book" then
- return true
- else
- return false
- end
- end
- function depositBook()
- turtle.turnLeft()
- turtle.drop()
- turtle.turnRight()
- end
- function enchant()
- if e.getLevels() >= 30 and hasBook() then
- turtle.select(1)
- e.enchant(30)
- depositBook()
- turtle.suckDown(1)
- end
- end
- while true do
- enchant()
- checkFull()
- turtle.attack()
- turtle.suck()
- end
Add Comment
Please, Sign In to add comment