Advertisement
NoobieDoobie

Untitled

Feb 24th, 2021
867
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.81 KB | None | 0 0
  1. function Mf(isFirst)
  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() and not isFirst 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() and not isFirst 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.     if x==0 then
  49.       Mf(true)
  50.     else
  51.       Mf(false)
  52.     end
  53.   end
  54. end
  55.  
  56. function Coal()
  57.   if turtle.getFuelLevel() < 40 and turtle.getItemCount(1) <1 then
  58.     print "Please put some coal in slot 1"
  59.   end
  60. end
  61.  
  62. function Refuel()
  63.   if turtle.getFuelLevel() < 100 then
  64.     turtle.select(1)
  65.     turtle.refuel(turtle.getItemCount()-1)
  66.   end
  67. end
  68.  
  69. function Spiral(num)
  70.   Refuel()
  71.   Mfnum(num)
  72.   turtle.turnRight()
  73.   while num>=3 do
  74.     Coal()
  75.     Refuel()
  76.     Mfnum(num)
  77.     turtle.turnRight()
  78.     Refuel()
  79.     Mfnum(num)
  80.     turtle.turnRight()
  81.     num = num - 3
  82.   end
  83. end
  84.  
  85. print "Length?"
  86. len=tonumber(read())
  87. print "Number of Platforms?"
  88. d=tonumber(read())
  89.  
  90. for x=0,d,1 do
  91.   Spiral(len)
  92.   turtle.digUp()
  93.   turtle.digDown()
  94.   turtle.down()
  95.   turtle.digDown()
  96.   turtle.down()
  97.   turtle.digDown()
  98.   turtle.down()
  99. end
  100. for y=0,d*3+5,1 do
  101.   turtle.digUp()
  102.   turtle.up()
  103. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement