uepyon

makefloor.lua

Jun 28th, 2023 (edited)
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if turtle.getFuelLevel() <= 80 then
  2.   turtle.select(1)
  3.   turtle.refuel(5)
  4. end
  5. local fuel = turtle.getFuelLevel()
  6. print("fuel:"..tostring(fuel))
  7.  
  8. local function PutLine(n)
  9.   for i=1, tonumber(n) do
  10.     if not turtle.detectDown() then
  11.       print("place")
  12.       turtle.placeDown()
  13.     else
  14.       print("skip")
  15.     end
  16.     turtle.forward()
  17.   end
  18. end
  19.  
  20. local function MakeFloor(d, w)
  21.   d = tonumber(d)
  22.   w = tonumber(w)
  23.   for i=1, w do
  24.     PutLine(d)
  25.     if i % 2 == 1 then
  26.       turtle.turnRight()
  27.       turtle.forward()
  28.       turtle.turnRight()
  29.     else
  30.       turtle.turnLeft()
  31.       turtle.forward()
  32.       turtle.turnLeft()
  33.     end
  34.     turtle.forward()
  35.   end
  36.  
  37.   if w % 2 == 1 then
  38.     for i=1, d do
  39.       turtle.forward()
  40.     end
  41.     turtle.turnRight()
  42.     turtle.turnRight()
  43.   end
  44.   turtle.turnLeft()
  45.   for i=1, w do
  46.     turtle.forward()
  47.   end
  48.   turtle.turnRight()
  49. end
  50.  
  51. turtle.select(2)
  52. turtle.forward()
  53. turtle.up()
  54. MakeFloor(8, 6)
  55. turtle.back()
  56. turtle.down()
  57.  
Tags: ccTweaked
Advertisement
Add Comment
Please, Sign In to add comment