Posted 01 June 2014 - 06:29 PM
I understand there are way better versions of this, but i like to program on my own. This program was working fine when i just had it farm R3 (top row of sugar cane)
then when i added returning to start row 2, refueling, and depositing items the turtle spins. Any help is appreciated :)/>
then when i added returning to start row 2, refueling, and depositing items the turtle spins. Any help is appreciated :)/>
local function BreakSugarCane()
turtle.dig()
turtle.forward()
end
local function NextRowR()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.turnRight()
end
local function NextRowL()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnLeft()
end
local function BreakRow()
for i = 1,14 do
BreakSugarCane()
end
end
local function Break2Row()
BreakRow()
NextRowR()
BreakRow()
NextRowL()
end
local function FarmSugarCaneR3()
for i = 1, 2 do
turtle.up()
end
for i=1 ,3 do
Break2Row()
end
end
local function FarmSugarCaneR2()
turtle.up()
for i=1, 3 do
Break2Row()
end
end
local function ReturnToStartR3()
turtle.turnLeft()
for i=1,12 do
turtle.forward()
end
turtle.down()
turtle.down()
turtle.turnRight()
end
local function ReturnToStartR2()
turtle.turnLeft()
for i=1,12 do
turtle.forward()
end
turtle.down()
turtle.turnRIght()
end
local function FarmingSC()
FarmSugarCaneR3()
ReturnToStartR3()
FarmSugarCaneR2()
ReturnToStartR2()
end
term.setCursorPos(1,1)
term.write("Place fuel in slot 1")
sleep(2)
term.clear()
turtle.select(1)
turtle.refuel()
sleep(5)
FarmingSC()
turtle.turnRight()
turtle.turnRight()
turtle.drop()
turtle.turnLeft()
turtle.turnLeft()
Edited by