Advertisement
NoobieDoobie

Untitled

Feb 24th, 2021
674
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.65 KB | None | 0 0
  1. function Mf()
  2.   while turtle.detect() or turtle.detectUp() do
  3.     turtle.dig()
  4.     turtle.digUp()
  5.   end
  6.   if not turtle.detectDown() then
  7.     turtle.select(2)
  8.     turtle.placeDown()
  9.   end
  10.   turtle.turnLeft()
  11.   if not turtle.detect() then
  12.     turtle.select(2)
  13.     turtle.place()
  14.   end
  15.   turtle.turnRight()
  16.   turtle.turnRight()
  17.   if not turtle.detect() then
  18.     turtle.select(2)
  19.     turtle.place()
  20.   end
  21.   turtle.turnLeft()
  22.   turtle.up()
  23.   if not turtle.detectUp() then
  24.     turtle.select(2)
  25.     turtle.placeUp()
  26.   end
  27.   turtle.turnLeft()
  28.   if not turtle.detect() then
  29.     turtle.select(2)
  30.     turtle.place()
  31.   end
  32.   turtle.turnRight()
  33.   turtle.turnRight()
  34.   if not turtle.detect() then
  35.     turtle.select(2)
  36.     turtle.place()
  37.   end
  38.   turtle.turnLeft()
  39.   turtle.down()
  40.   while turtle.forward() == false do
  41.     turtle.dig()
  42.     turtle.attack()
  43.   end
  44. end
  45.  
  46. function Mfnum(num)
  47.   for x=0,num,1 do
  48.     Mf()
  49.   end
  50. end
  51.  
  52. function Coal()
  53.   if turtle.getFuelLevel() < 40 and turtle.getItemCount(1) <1 then
  54.     print "Please put some coal in slot 1"
  55.   end
  56. end
  57.  
  58. function Refuel()
  59.   if turtle.getFuelLevel() < 80 then
  60.     turtle.refuel()
  61.   end
  62. end
  63.  
  64. function Spiral(num)
  65.   Mfnum(num)
  66.   turtle.turnRight()
  67.   while num>=3 do
  68.     Coal()
  69.     Refuel()
  70.     Mfnum(num)
  71.     turtle.turnRight()
  72.     Mfnum(num)
  73.     turtle.turnRight()
  74.     num = num - 3
  75.   end
  76. end
  77.  
  78. print "Length?"
  79. len=tonumber(read())
  80. print "Number of Platforms?"
  81. d=tonumber(read())
  82.  
  83. for x=0,d,1 do
  84.   Spiral(len)
  85.   turtle.digUp()
  86.   turtle.digDown()
  87.   turtle.down()
  88.   turtle.digDown()
  89.   turtle.down()
  90.   turtle.digDown()
  91.   turtle.down()
  92. end
  93. for y=0,d*3,1 do
  94.   turtle.digUp()
  95.   turtle.up()
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement