ComputerCraft Archive

Little Farming Turtle -LFT- Ver2

turtle mining unknown forum

Description

A small program that farms a 12X12 section of ground.just put the farming turtle in the spot designated in the picture and it will till and plant out a 12X12 section.PicturesSpoilerScript version 2 pa...

Installation

Copy one of these commands into your ComputerCraft terminal:

Pastebin:pastebin get 9iWXU3r1 little_farming_turtle_-lft-_ver2
wget:wget https://pastebin.com/raw/9iWXU3r1 little_farming_turtle_-lft-_ver2
Archive:wget https://cc.shobie.xyz/cc/get/pb-9iWXU3r1 little_farming_turtle_-lft-_ver2
Quick Install: wget https://cc.shobie.xyz/cc/get/pb-9iWXU3r1 Little Farming Turtle -LFT- Ver2

Usage

Run the program after downloading

Tags

turtleminingforumturtle-programs

Source

View Original Source

Code Preview

--[[
		12 X 12 farm
]]--

local function move()
	turtle.digDown()
	turtle.placeDown()
	while not turtle.forward() do
		sleep(1)
	end
end

local function move2()
	while not turtle.forward() do
		sleep(1)
	end
end
local function plow()
	while not turtle.up() do
		sleep(1)
	end
	move2()
	for o = 1,6 do

		for i = 1,12 do
			move()
		end
		turtle.turnRight()
		move()
		turtle.turnRight()
		move()
		for i = 1,12 do
			move()
		end
		turtle.turnLeft()
		move2()
		turtle.turnLeft()
		move2()
	end
	for i = 1,12 do
		move()
	end
	move()
	while not turtle.down() do
		sleep(1)
	end
	turtle.turnLeft()
	turtle.turnLeft()
end
local iRepeat = 0
local iMin = 40
local iCount = 0
local spacer = ""
while true do
	term.clear()
	term.setCursorPos(1,4)
	print("Fuel Remaning : "..tostring(turtle.getFuelLevel()))
	term.setCursorPos(1,1)
	iRepeat = iRepeat+1
	print("plowing   :"..iRepeat)
	plow()
	term.setCursorPos(1,4)
	print("Fuel Remaning : "..tostring(turtle.getFuelLevel()))
	iCount = iMin
	while true do
		iCount = iCount-1
		term.setCursorPos(1,2)
		term.clearLine()
		print("sleeping "..iMin.." minuites")
		for i = 59,0,-1 do
			sleep(1)
			term.setCursorPos(1,3)
			term.clearLine()
			if i < 10 then
				spacer = "0"
			else
				spacer = ""
			end
			write("To go    "..iCount..":"..spacer..i)
		end
		if iCount == 0 then
			break
		end
	end
end