Advertisement
Guest User

filler

a guest
Aug 12th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1.  
  2. function checkFuel()
  3. if turtle.getFuelLevel() < 5 then
  4. print("I need Fuel please")
  5. print("fuel slot 16")
  6. turtle.select(16)
  7. turtle.refuel(64)
  8. turtle.getFuelLevel()
  9. if turtle.getFuelLevel() >5 then
  10.   print(turtle.getFuelLevel())
  11.   print("thanks I was thirsty")
  12.  elseif turtle.getFuelLevel() >5 then
  13.  turtle.foward()
  14.    end
  15.    end
  16.    end
  17.    
  18.    
  19.  function turtleFoward()
  20.     if turtle.forward() == true then
  21.     turtle.placeDown()
  22.     turtle.detect()
  23. elseif turtle.forward == false then
  24.   turtle.dig()
  25.   turtle.forward()
  26.   turtle.place()
  27.     end
  28.  end
  29.  
  30.   function turtleLeft()
  31.   if turtle.turnLeft() == true then
  32.   turtle.turnLeft()
  33.   turtle.forward()
  34.   return
  35.           end
  36.   end
  37.  
  38.  
  39.  
  40.  term.write("how Long do you need:   ")
  41.   blocks = read()
  42.  
  43.  
  44.   term.write("how many spaces wide:   ")
  45.   block = read()
  46.   for i =1,blocks do
  47.  turtleFoward()
  48.   end
  49.   for i =1,block do
  50.  turtleLeft()
  51.   end
  52.   checkFuel()
  53.   turtleForward()
  54.   turtleLeft()
  55.   turtleForward()
  56.   turtleLeft()
  57.   turtleForward()
  58.   turtleLeft()
  59.   turtleFoward()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement