Advertisement
notfuji

Untitled

Nov 16th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. local arg = { ... }
  2.  
  3. function handleLava( isUp )
  4.  
  5. if isUp == 1 then
  6. local iSuccess, iData = turtle.inspectUp()
  7. if iSuccess then
  8. if iData.name == "minecraft:lava" then
  9. print("yes")
  10. turtle.select(1)
  11. sleep(0.5)
  12. turtle.placeUp()
  13. end
  14. end
  15. else
  16. local iSuccess, iData = turtle.inspect()
  17. if iSuccess then
  18. if iData.name == "minecraft:lava" then
  19. turtle.select(1)
  20. sleep(0.5)
  21. turtle.place()
  22. end
  23. end
  24. end
  25. end
  26.  
  27. function digFront()
  28. turtle.dig()
  29. turtle.forward()
  30. handleLava(0)
  31. turtle.digUp()
  32. handleLava(0)
  33. handleLava(1)
  34. turtle.down()
  35. end
  36.  
  37. function checkFront()
  38. handleLava(0)
  39. turtle.up()
  40. handleLava(0)
  41. handleLava(1)
  42. turtle.down()
  43. end
  44.  
  45. for i = 0, arg[1] do
  46. digFront()
  47. turtle.turnLeft()
  48. digFront()
  49. turtle.turnRight()
  50. checkFront()
  51. turtle.turnRight()
  52. turtle.forward()
  53. digFront()
  54. turtle.turnLeft()
  55. checkFront()
  56. turtle.turnLeft()
  57. turtle.forward()
  58. turtle.turnRight()
  59. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement