Advertisement
dady172172

Untitled

Dec 15th, 2015
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. print("How many section to build?")
  2. local number = read()
  3. for i = 1,number/4 do
  4.     if turtle.getFuelLevel() < 160 then
  5.         turtle.select(16)
  6.         if turtle.refuel(10) then
  7.         else
  8.             turtle.select(15)
  9.             turtle.refuel(10)
  10.         end
  11.     end
  12.    
  13.     function fdown()
  14.         turtle.forward()
  15.         turtle.down()
  16.     end
  17.    
  18.     function chkblock()
  19.         if turtle.detectDown() then
  20.         else
  21.             turtle.select(5)
  22.             turtle.placeDown()
  23.         end
  24.     end
  25.    
  26.     function upplace()
  27.         turtle.up()
  28.         turtle.select(1)
  29.         turtle.placeDown()
  30.     end
  31.     function torchplace()      
  32.         turtle.turnRight()
  33.         turtle.forward()
  34.         chkblock()
  35.         turtle.back()
  36.         turtle.select(9)
  37.         turtle.place()
  38.         turtle.turnLeft()
  39.    
  40.     end
  41.     for i = 1,4 do
  42.         upplace()
  43.         fdown()
  44.         chkblock()
  45.         upplace()
  46.         fdown()
  47.         chkblock()
  48.         upplace()
  49.         fdown()
  50.         chkblock()
  51.         torchplace()
  52.        
  53.        
  54.     end
  55.    
  56.    
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement