Advertisement
Crayder

Untitled

Jan 3rd, 2021 (edited)
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. turtle.select(1)
  2. turtle.refuel(64)
  3.  
  4. local hasChestUnderneath, data = turtle.inspectDown()
  5.  
  6. if hasChestUnderneath then
  7. if string.match(data.name, "chest") == nil then
  8. hasChestUnderneath = false
  9. end
  10. end
  11.  
  12. local c = 1
  13.  
  14. while true do
  15. local attacked = false
  16.  
  17. if turtle.attack() then
  18. attacked = true
  19. end
  20.  
  21. turtle.suckUp()
  22. turtle.suck()
  23. turtle.suckDown()
  24.  
  25. if c == 15 then
  26. turtle.forward()
  27.  
  28. if turtle.attack() then
  29. attacked = true
  30. end
  31.  
  32. turtle.suckUp()
  33. turtle.suck()
  34. turtle.suckDown()
  35.  
  36. turtle.back()
  37. end
  38.  
  39. if hasChestUnderneath then
  40. turtle.dropDown()
  41. end
  42.  
  43. print("tick"..(attacked and " and attacked" or "")..((c == 15) and " and moved" or ""))
  44.  
  45. c = ((c < 15) and (c + 1) or (1))
  46.  
  47. sleep(1)
  48. end
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement