Ranger1230

Enchanter Turtle

Jun 29th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. xp=peripheral.wrap("right")
  2. run=true
  3. enchantCount=0
  4. while run == true do
  5.     xp.setAutoCollect(true)
  6.     if(xp.getLevels() >= 30) then
  7.         turtle.suck()
  8.         if(turtle.getItemCount(1) == 0) then
  9.             run=false
  10.             print("out of books")
  11.         else
  12.             turtle.drop(turtle.getItemCount(1)-1)
  13.             if(not xp.enchant(30)) then
  14.                 run=false
  15.                 print("enchant failed")
  16.             end
  17.             enchantCount=enchantCount+1
  18.             print("Enchanted "..enchantCount.." books")
  19.             turtle.drop()
  20.         end
  21.     end
  22.     os.sleep(5)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment