Guest User

attack.lua

a guest
Apr 10th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 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. while true do
  21.     if e.getLevels() >= 30 then
  22.         turtle.select(1)
  23.         e.enchant(30)
  24.         sleep(1)
  25.         turtle.suckDown(1)
  26.     end
  27.     checkFull()
  28.     turtle.attack()
  29.     print(e.getLevels())
  30. end
Advertisement
Add Comment
Please, Sign In to add comment