Posted 24 September 2012 - 12:22 AM
So tried ComputerCraft for the first time today. And decided to create a Auto Farming BOT, that plows a field, plants a wheat, and then uses bonemeal to instant grow the crop, then takes the wheat..
When the Seeds or bonemeal reaches 1, it will turn to the chests, replenish items, and store wheat.
PLEASE NOTE:
Sourceforge Link: https://sourceforge.net/projects/ccawf/?source=navbar
1.4
1.5.1
Please view attached image to see the setup you must follow to accomplish this.
[attachment=479:auto farm bot.png]
When the Seeds or bonemeal reaches 1, it will turn to the chests, replenish items, and store wheat.
PLEASE NOTE:
- The turtle must have a pickaxe, not a hoe.
- There musn't be a field/crop in-front of the turtle like in the pic, otherwise the turtle will spin in circles looking for a place to plant
Sourceforge Link: https://sourceforge.net/projects/ccawf/?source=navbar
1.4
term.clear()
term.setCursorPos(1,1)
print("X90 Farming Robot")
while turtle.detect() do
turtle.turnRight()
end
function getSeeds()
turtle.turnLeft()
turtle.select(1)
turtle.drop()
while turtle.getItemCount(1) < 10 do
turtle.suck()
end
turtle.turnRight()
end
function getBone()
turtle.turnRight()
turtle.select(2)
turtle.drop()
while turtle.getItemCount(2) < 10 do
turtle.suck()
end
turtle.turnLeft()
end
function StoreItems()
turtle.turnLeft()
for i=3,16 do
turtle.select(i)
if turtle.compareTo(1) then
turtle.drop()
end
end
turtle.turnRight()
turtle.turnRight()
for i=3,16 do
turtle.select(i)
if turtle.compareTo(2) then
turtle.drop()
end
end
turtle.turnLeft()
turtle.turnRight()
turtle.turnRight()
for i=3,16 do
turtle.select(i)
turtle.drop()
end
turtle.turnLeft()
turtle.turnLeft()
end
Farm = turtle.getItemCount(1)
Bone = turtle.getItemCount(2)
if Farm > Bone then
doTill = Bone
else
doTill = Farm
end
if Farm <= 1 or Bone <= 1 then
StoreItems()
getSeeds()
getBone()
end
i = 1
while i < doTill do
turtle.dig()
turtle.select(1)
turtle.place()
turtle.select(2)
turtle.place()
turtle.dig()
i = i+1
end
os.reboot()
1.5.1
term.clear()
term.setCursorPos(1,1)
print("X90 Farming Robot")
while turtle.detect() do
turtle.turnRight()
end
function getSeeds()
turtle.turnLeft()
turtle.select(1)
if turtle.getItemCount(1) > 0 then
turtle.drop()
end
while turtle.getItemCount(1) < 10 do
turtle.suck()
end
turtle.turnRight()
end
function getBone()
turtle.turnRight()
turtle.select(2)
if turtle.getItemCount(2) > 0 then
turtle.drop()
end
while turtle.getItemCount(2) < 10 do
turtle.suck()
end
turtle.turnLeft()
end
function StoreItems()
turtle.turnLeft()
for i=3,16 do
turtle.select(i)
if turtle.compareTo(1) then
if turtle.getItemCount(i) > 0 then
turtle.drop()
end
end
end
turtle.turnRight()
turtle.turnRight()
for i=3,16 do
turtle.select(i)
if turtle.compareTo(2) then
if turtle.getItemCount(i) > 0 then
turtle.drop()
end
end
end
turtle.turnRight()
for i=3,16 do
turtle.select(i)
if turtle.getItemCount(i) > 0 then
turtle.drop()
end
end
turtle.turnLeft()
turtle.turnLeft()
end
Farm = turtle.getItemCount(1)
Bone = turtle.getItemCount(2)
if Farm > Bone/3 then
doTill = Bone/3
else
doTill = Farm
end
if Farm <= 1 or Bone <= 3 then
StoreItems()
getSeeds()
getBone()
end
i = 1
while i < doTill do
turtle.dig()
turtle.select(1)
turtle.place()
turtle.select(2)
turtle.place()
turtle.place()
turtle.place()
turtle.dig()
i = i+1
end
os.reboot()
Please view attached image to see the setup you must follow to accomplish this.
[attachment=479:auto farm bot.png]