Savage_Me55iah

wither things

Feb 28th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. turtletype = 1
  2.  
  3. function check()
  4. for num=1,3 do
  5. if turtle.getItemCount(num) < 2 then
  6. run = false
  7. end
  8. end
  9. end
  10.  
  11. function move(dir)
  12. if dir == "up" then
  13. if not turtle.up() then
  14. turtle.select(3)
  15. turtle.refuel(1)
  16. turtle.up()
  17. end
  18. else
  19. if not turtle.down() then
  20. turtle.select(3)
  21. turtle.refuel(1)
  22. turtle.down()
  23. end
  24. end
  25. turtle.select(1)
  26. end
  27.  
  28.  
  29.  
  30. while true do
  31. run = true
  32. os.startTimer(120)
  33. if turtle.getItemCount() > 1 and turtletype == 1 then
  34. turtle.select(1)
  35. turtle.place()
  36. elseif turtletype > 1 then
  37. check()
  38. if turtletype == 3 and not redstone.getInput("right") then run = false end
  39. if run and not turtle.detect() then
  40. turtle.select(1)
  41. turtle.place()
  42. move("up")
  43. turtle.select(2)
  44. turtle.place()
  45. move("down")
  46. end
  47. end
  48. os.pullEvent()
  49. end
Advertisement
Add Comment
Please, Sign In to add comment