Advertisement
AleksHSE

Untitled

Jan 17th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.07 KB | None | 0 0
  1. -- Variables
  2. local args = {...}
  3. local mode = args[1]
  4.  
  5. -- Functions
  6.  
  7.     showInfo = function()
  8.         print(info)
  9.     end
  10.  
  11.     setup = function()
  12.         turtle.select(5)
  13.         go()
  14.         right()
  15.         turtle.digDown()
  16.        
  17.         left();
  18.        
  19.         for i=1, 11 do
  20.             turtle.digDown()
  21.             turtle.placeDown()
  22.             go();
  23.         end
  24.         turtle.digDown()
  25.         turtle.placeDown()
  26.         right()
  27.         turtle.digDown()
  28.         turtle.placeDown()
  29.         go()
  30.         turtle.digDown()
  31.         turtle.placeDown()
  32.         go()
  33.         turtle.turnRight()
  34.         for i=1, 12 do
  35.             turtle.digDown()
  36.             turtle.placeDown()
  37.             go()
  38.         end
  39.         turtle.digDown()
  40.         turtle.placeDown()
  41.         right()
  42.         turtle.digDown()
  43.         turtle.placeDown()
  44.         go()
  45.         turtle.digDown()
  46.         turtle.placeDown()
  47.         go()
  48.         turtle.placeDown()
  49.         turtle.turnRight()
  50.         print("Done...");
  51.  
  52.     end
  53.  
  54.     start = function()
  55.         go()
  56.         for i=1, 11 do
  57.             placeSappling()
  58.             go();
  59.         end
  60.         right()
  61.         go()
  62.         go()
  63.         right();
  64.         for i=1, 11 do
  65.             placeSappling()
  66.             go()
  67.         end
  68.         right()
  69.         go()
  70.         go()
  71.         turtle.turnRight();
  72.         print("Done...");
  73.     end
  74.  
  75.  
  76.     left = function()
  77.         turtle.turnLeft()
  78.         go()
  79.     end
  80.  
  81.     right = function()
  82.         turtle.turnRight()
  83.         go()
  84.     end
  85.  
  86.     go = function()
  87.         turtle.forward()
  88.     end
  89.  
  90.  
  91.     placeSappling = function()
  92.         turtle.turnRight();
  93.         local block = turtle.detect();
  94.  
  95.         if block then
  96.             turtle.turnLeft()
  97.         else
  98.             turtle.select(1)
  99.             turtle.place();
  100.             turtle.turnLeft()
  101.         end
  102.    
  103.     end
  104.  
  105.  
  106. -- Main
  107. print("Starting up...");
  108. showInfo();
  109. if mode == "setup" then
  110.     print("Preparing area...")
  111.     setup();
  112. elseif mode == "start" then
  113.     start();
  114. else
  115.     start();
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement