eytixis

tur.lua (Computercraft mod)

Oct 30th, 2020 (edited)
795
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function square(leng)
  2.     local i,j
  3.     for i = 1,4 do
  4.         for j = 1,leng do
  5.             turtle.digDown()
  6.             if j == leng and i == 4 then break end
  7.             turtle.forward()
  8.         end
  9.         turtle.turnLeft()
  10.     end
  11. end
  12.  
  13. function area()
  14.     for l = 0,4 do
  15.         square(2*(4-l)+1)
  16.         turtle.forward()
  17.     end
  18.    
  19.     for i = 1,5 do
  20.         turtle.back()
  21.     end
  22.     turtle.turnRight()
  23.     for i = 1,5 do
  24.         turtle.forward()
  25.     end
  26.     turtle.turnLeft()
  27. end
  28.  
  29. function stair()
  30.     local turns = 0
  31.     while not turtle.inspectUp() do
  32.         turtle.forward()
  33.     end
  34.     while turtle.inspectUp() do
  35.         if not turtle.forward() then
  36.             turtle.turnLeft()
  37.             turns = turns + 1
  38.         end
  39.     end
  40.     turtle.down()
  41.     turtle.placeUp()
  42.     while turtle.back() do end
  43.     if turns > 0 then
  44.         for i = 1, turns do
  45.             turtle.turnRight()
  46.             while turtle.back() do end
  47.         end
  48.     end
  49. end
  50.  
  51. for cir = 1,10 do
  52.     area()
  53.     turtle.down()
  54. end
  55.  
  56.  
RAW Paste Data