Posted 08 September 2014 - 02:24 AM
--# plantwheat
--# move to the right, maintain facing
local function slideRight()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
end
local function plant1Field()
for row = 1,6 do
for col=1,5 do
if (row == 1) and (col == 3) then
--# we're at the piston, so skip it
slideRight()
else
turtle.select(1)
turtle.dig()
turtle.place()
--# don't want to go right at last column or we'd hit the wall
if col ~= 5 then
slideRight()
end
end
end
if row ~= 6 then
turtle.back()
turtle.turnLeft()
for x=1,4 do
turtle.forward()
end
turtle.turnRight()
end
end
end
local function firstPosition()
--# get up over torches
turtle.up()
turtle.up()
--# move to 1st position on the field
for x = 1,7 do
turtle.forward()
end
--# get down on the 1st spot
turtle.down()
end
local function secondPosition()
--# turn to face field to the left
turtle.turnLeft()
--# move to the next field
for x = 1,10 do
turtle.forward()
end
--# turn to face piston side of field
turtle.turnRight()
--# move to 1st position on the field
for x = 1,5 do
turtle.forward()
end
end
local function returnHome()
turtle.up()
turtle.back()
turtle.back()
slideRight()
slideRight()
turtle.down()
turtle.down()
end
local function doPlanting()
--# begin sitting on top of seed chest
--# should verify seeds are full
firstPosition()
plant1Field()
secondPosition()
plant1Field()
returnHome()
end
while true do
sleep(30)
if rs.getInput("back") then
doPlanting()
turtle.select(1)
turtle.suckDown()
sleep(600)
end
end
Edited on 09 September 2014 - 08:59 PM