Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
112
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. turtle.placeUp()
  12. end
  13. end
  14. else
  15. local iSuccess, iData = turtle.inspect()
  16. if iSuccess then
  17. if iData.name == "minecraft:lava" then
  18. print("yes")
  19. turtle.select(1)
  20. turtle.place()
  21. end
  22. end
  23. end
  24. end
  25.  
  26. function digFront()
  27. turtle.dig()
  28. turtle.forward()
  29. turtle.digUp()
  30. turtle.up()
  31. turtle.down()
  32. end
  33.  
  34. function checkFront()
  35. handleLava(0)
  36. turtle.up()
  37. handleLava(0)
  38. handleLava(1)
  39. turtle.down()
  40. end
  41.  
  42. for i = 0, arg[1] do
  43. digFront()
  44. checkFront()
  45. turtle.turnLeft()
  46. digFront()
  47. checkFront()
  48. turtle.turnRight()
  49. checkFront()
  50. turtle.turnRight()
  51. turtle.forward()
  52. digFront()
  53. checkFront()
  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