Advertisement
Guest User

sugarcane

a guest
Sep 20th, 2014
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. print("Please specify how long the field is")
  2. local x = read()
  3. print("is this a sugarcane farm or a melon/pumpkin farm")
  4. print("1 = sugarcane")
  5. print("2 = pumpkins/melons")
  6. local y = read()    
  7. while x ~= 0 do
  8.    for i =1, 16 do
  9.       turtle.select(i)
  10.       turtle.dropDown()
  11.    end
  12.    turtle.select(1)
  13.    if turtle.getFuelLevel() <= 3*x
  14.    then
  15.       turtle.suckDown()
  16.       turtle.refuel(32)
  17.    end
  18.    for i =1, 2 do
  19.       for i =1, x+1 do
  20.          turtle.forward()
  21.          turtle.turnLeft()
  22.          if turtle.detect() == true
  23.          then
  24.             turtle.dig()
  25.          end
  26.          turtle.turnRight()
  27.       end
  28.       turtle.turnLeft()
  29.       for i =1,2*y+1 do
  30.          turtle.forward()
  31.       end
  32.       turtle.turnLeft()
  33.    end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement