AlphaSheepPig

CC Turtle Basic Enchanter

Jul 2nd, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. --[[
  2. A simple item enchanter
  3. by Alphanumeric Sheep Pig
  4.  
  5. The turtle will collect XP and wait.
  6. Whenever it reaches level 30, it
  7. will enchant a book and place it in
  8. a chest on its left. If it is out of
  9. books, it will take a stack from a
  10. chest on its right.
  11. ]]
  12.  
  13. p = peripheral.wrap("right")
  14.  
  15. p.setAutoCollect(true)
  16.  
  17. while true do
  18.     sleep(5)
  19.     print("At level ",p.getLevels())
  20.     if p.getLevels()>= 30 then
  21.         if turtle.getItemCount(16)==0 then
  22.             turtle.select(16)
  23.             turtle.turnRight()
  24.             if not turtle.suck() then
  25.                 exit()
  26.             end
  27.             turtle.turnLeft()
  28.         end
  29.         turtle.select(16)
  30.         turtle.transferTo(1,1)
  31.         turtle.select(1)
  32.         p.enchant(30)
  33.         turtle.turnLeft()
  34.         turtle.drop()        
  35.         turtle.turnRight()
  36.     end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment