This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
pual11's profile picture

easy sugar cane farm

Started by pual11, 16 May 2015 - 10:41 PM
pual11 #1
Posted 17 May 2015 - 12:41 AM
hi i made this super easy sugar cane farm program

to get it pastebin get NneNLQLC


just place sugar cane like this
http://prntscr.com/761gwh

place a chest at Back of the turtle


you can make it longer
if you want to open the program and at the top it says
SiseFarm = 4
you can change the number to anything you want


fuel in the last slot and it works

code :

--cane
fuel = turtle.getFuelLevel()
SiseFarm = 4
i = 0
function refrech()
fuel = turtle.getFuelLevel()
	i = 0
end

function refuel()
if fuel < 100 then
  turtle.select(16)
  turtle.refuel(64)
  turtle.select(1)
  fuel = turtle.getFuelLevel()
  if fuel < 100 then
   print("need more fuel")
   error()
  else
  end
else
  print("fuel is ")
  write(fuel)
end
end
function goToPos()
turtle.up()
turtle.up()
turtle.forward()
end
function mineTop()
for i = 1,SiseFarm do
turtle.turnRight()
turtle.dig()
turtle.turnRight()
turtle.turnRight()
turtle.dig()
turtle.turnRight()
turtle.forward()
	end
end
function goPos2()
turtle.down()
turtle.turnRight()
turtle.turnRight()
end
function mineDown()
for i = 1,SiseFarm do
turtle.turnRight()
turtle.dig()
turtle.turnRight()
turtle.turnRight()
turtle.dig()
turtle.turnRight()
turtle.forward()
end
end
function dropItem()
turtle.down()
turtle.select(1)
turtle.drop()
turtle.turnRight()
turtle.turnRight()
end
while true do
refrech()
refuel()
goToPos()
mineTop()
goPos2()
mineDown()
dropItem()
term.clear()
sleep(240)
end
Waitdev_ #2
Posted 17 May 2015 - 10:32 AM
this looks like something you could use loops, but why. they are way too complicated to go in like this B)/>