Advertisement
Guest User

recolte canne a sucres

a guest
Jul 24th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. function a()
  2.     for i=0,6 do
  3.         turtle.forward()
  4.         turtle.turnRight()
  5.         turtle.dig()
  6.         turtle.turnLeft()
  7.         turtle.turnLeft()
  8.         turtle.dig()
  9.         turtle.turnRight()
  10.     end
  11. end
  12. function Left()
  13.     for i=0,5 do
  14.         if i==1 or i==5 then
  15.             turtle.turnLeft()
  16.         else
  17.             turtle.forward()
  18.         end
  19.     end
  20. end
  21. function Right()
  22.     for i=0,5 do
  23.         if i==1 or i==5 then
  24.             turtle.turnRight()
  25.         else
  26.             turtle.forward()
  27.         end
  28.     end
  29. end
  30.  
  31. continue=true
  32.  
  33. while continue do
  34.     if turtle.getFuelLevel()<=80 then
  35.         if turtle.suckDown(1) then
  36.             turtle.refuel(1)
  37.         else
  38.             continue=false
  39.             term.clear()
  40.             term.setCursorPos(1,1)
  41.             term.write("NO FUEL")
  42.         end
  43.     end
  44.     if continue then
  45.         a()
  46.         Left()
  47.         a()
  48.         Right()
  49.         a()
  50.         Left()
  51.         a()
  52.         turtle.forward()
  53.         turtle.turnLeft()
  54.         for i=0,8 do
  55.             if i==6 then
  56.                 turtle.dropDown()
  57.             end
  58.             turtle.forward()
  59.         end
  60.         turtle.turnLeft()
  61.         sleep(120)
  62.     end
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement