Advertisement
Blackhome

3x3_Tunnler

Jan 6th, 2025 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. --Tunneldistance
  2. distance = ...
  3. if not distance then
  4.     distance = 50
  5. else
  6.     distance = tonumber(distance)
  7. end
  8.  
  9. local move = require("move")
  10.  
  11. -- turns into tunnel or back out in starting direction
  12. function takeTurn()
  13.     if tunnelSide == "left" then
  14.         turtle.turnLeft()
  15.     else
  16.         turtle.turnRight()
  17.     end
  18. end
  19.  
  20. function tunnelRow()
  21.    
  22. end
  23. --tunnel 3x3 for (start left bottom one block outside tunnel)
  24. function buildTunnel()
  25.     for cnt = 1, distance, 1 do
  26.         move.Forward()
  27.         if cnt % 2 == 1 then
  28.             turtle.turnRight()
  29.             move.Up()
  30.             move.Up()
  31.             move.Forward()
  32.             move.Down()
  33.             move.Down()
  34.             move.Forward()
  35.             move.Up()
  36.             move.Up()
  37.             turtle.turnLeft()
  38.         else
  39.             turtle.turnLeft()
  40.             move.Down()
  41.             move.Down()
  42.             move.Forward()
  43.             move.Up()
  44.             move.Up()
  45.             move.Forward()
  46.             move.Down()
  47.             move.Down()
  48.             turtle.turnRight()
  49.         end
  50.     end
  51. end
  52.  
  53. buildTunnel()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement