Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xp=peripheral.wrap("right")
- run=true
- enchantCount=0
- while run == true do
- xp.setAutoCollect(true)
- if(xp.getLevels() >= 30) then
- turtle.suck()
- if(turtle.getItemCount(1) == 0) then
- run=false
- print("out of books")
- else
- turtle.drop(turtle.getItemCount(1)-1)
- if(not xp.enchant(30)) then
- run=false
- print("enchant failed")
- end
- enchantCount=enchantCount+1
- print("Enchanted "..enchantCount.." books")
- turtle.drop()
- end
- end
- os.sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment