SHARE
TWEET

farming

a guest Apr 23rd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function refresh()
  2.   term.clear()
  3.   term.setCursorPos(1,1)
  4. end
  5.  
  6. term.setBackgroundColor(colors.green)
  7. term.setTextColor(colors.white)
  8. refresh()
  9. print("Field Size: ")
  10. local size = io.read()
  11. refresh()
  12.  
  13. while true do
  14.  
  15. if(turtle.getFuelLevel()<100) then
  16.   turtle.select(16)
  17.   turtle.refuel()
  18.   turtle.select(1)
  19. end
  20.  
  21. for i=0,size-1 do
  22.   for j=0,size-1 do
  23.     turtle.forward()
  24.     local succes, data = turtle.inspectDown()
  25.     if succes then
  26.       if data.name == "minecraft:wheat" then
  27.         if data.metadata == 7 then
  28.           turtle.digDown()
  29.           turtle.placeDown()
  30.         end
  31.       end
  32.     else
  33.       turtle.digDown()
  34.       turtle.placeDown()
  35.     end
  36.   end
  37.   if(i%2==0) then
  38.     turtle.forward()
  39.     turtle.turnRight()
  40.     turtle.forward()
  41.     turtle.turnRight()
  42.   else
  43.     turtle.forward()
  44.     turtle.turnLeft()
  45.     turtle.forward()
  46.     turtle.turnLeft()
  47.   end
  48. end
  49. if size%2 == 0 then
  50.   turtle.turnLeft()
  51.   for i=0,size-1 do
  52.     turtle.forward()
  53.   end
  54.   turtle.turnRight()
  55. else
  56.   for i=0,size do
  57.     turtle.forward()
  58.   end
  59.     turtle.turnRight()
  60.   for i=0,size-1 do
  61.     turtle.forward()
  62.   end
  63.   turtle.turnRight()
  64. end
  65.  
  66. for i=2,15 do
  67.   turtle.select(i)
  68.   turtle.dropDown()
  69. end
  70. for i=0,600 do
  71.   refresh()
  72.   print("Time remaining")
  73.   print(600-i)
  74.   os.sleep(1)
  75. end
  76. --while end
  77. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top