Advertisement
Guest User

startup

a guest
Apr 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. e = peripheral.wrap("left")
  2. e.setAutoCollect(true)
  3.  
  4. function unload()
  5.     turtle.turnRight()
  6.     for i = 2, 16 do
  7.         turtle.select(i)
  8.         turtle.drop()
  9.     end
  10.     turtle.select(1)
  11.     turtle.turnLeft()
  12. end
  13.  
  14. function checkFull()
  15.     if turtle.getItemCount(16) > 0 then
  16.         unload()
  17.     end
  18. end
  19.  
  20. function depositBook()
  21.         turtle.turnLeft()
  22.         turtle.drop()
  23.         turtle.turnRight()
  24. end
  25.    
  26.  
  27. function enchant()
  28.         if e.getLevels() >= 30 then
  29.         turtle.select(1)
  30.         e.enchant(30)
  31.                 depositBook()
  32.         turtle.suckDown(1)
  33.     end
  34. end
  35.  
  36. while true do
  37.     enchant()
  38.     checkFull()
  39.     turtle.attack()
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement