Advertisement
Guest User

clemProgram.lua

a guest
Apr 4th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. function IshapeBottomOrTop()
  2.     for i = 1, 5 do
  3.         if turtle.detect() == false then
  4.             turtle.place()
  5.         else
  6.             turtle.dig()
  7.             turtle.place()
  8.         end
  9.    
  10.             turtle.turnRight()
  11.    
  12.         if turtle.detect() == false then  
  13.             turtle.forward()
  14.         else
  15.             turtle.dig()
  16.             turtle.forward()        
  17.         end
  18.    
  19.         turtle.turnLeft()
  20.         print("Current Position: "..i)    
  21.     end
  22. end
  23.  
  24. function IshapeMiddle()
  25.  
  26.     turtle.turnLeft()
  27.     for i = 1, 3 do
  28.         turtle.forward()
  29.     end
  30.     turtle.turnRight()
  31.     for i = 1, 5 do
  32.         turtle.up()
  33.         turtle.place()
  34.     end
  35.     turtle.up()
  36.     turtle.turnLeft()
  37.     for i = 1, 3 do
  38.         turtle.forward()
  39.     end
  40. end
  41.  
  42. print("Starting...")
  43.  
  44. IshapeBottomOrTop()
  45. IshapeMiddle()
  46. IshapeBottomOrTop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement