Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
Spoon

Auto farm crops

Question

Description:
I would like an auto potato farm, or an auto farm for most crops.

Function: 

 I would like the robot that I have built, to farm a 5x25 rectangle area, it hovers above the crops and mines it, then places the crops again in the soil and keeps the rest in its inventory until its full, or the crops need to grow back, then it sleeps to re-charge or wait for the crops to grow.

Deadline: 

Not too worried about the deadline, im still trying to learn OpenComputers.

Additional Information: 

Like stated above, im very new to this mod and would love to learn more about it, such as writing a program and designing my own, I've read the tutorials but im still a little stumped, some tips would be very appreciated :) thank you!

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Here is a farm program I wrote that should work with most robots:

local robot = require("robot")
 
function moveToStart()
  -- modify this if the charger is in a different place
end
 
function moveToCharger()
  robot.turnAround()
  for i = 1, 25 do
    robot.forward()
  end
  robot.turnRight()
  for i = 1, 4 do
    robot.forward()
  end
  robot.turnRight()
end
 
function plant()
  robot.forward()
  robot.swingDown()
  robot.suckDown()
  robot.placeDown()
end
 
function plantRow()
  for i = 1, 25 do
    plant()
  end
end
 
function reverseRight()
  robot.forward()
  robot.turnRight()
  robot.forward()
  robot.turnRight()
end
 
function reverseLeft()
  robot.forward()
  robot.turnLeft()
  robot.forward()
  robot.turnLeft()
end
 
while true do
  moveToStart()
  plantRow()
  reverseRight()
  plantRow()
  reverseLeft()
  plantRow()
  reverseRight()
  plantRow()
  reverseLeft()
  plantRow()
  moveToCharger()
  os.sleep(2400)
end

You can also download it from pastebin: https://pastebin.com/RxNB6bjC

Note: For some reason, the robot will only pick up items properly if there is an item in the tool slot. (It can be any item, such as a block of dirt, a stick, etc.)

Video: https://youtu.be/xRiBUSI-1TM

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.