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

Little Farming Turtle -LFT- Ver2

Started by BigSHinyToys, 28 July 2012 - 04:34 PM
BigSHinyToys #1
Posted 28 July 2012 - 06:34 PM
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.

Pictures
Spoiler
Script version 2

pastebin get 9iWXU3r1 Farm2
http://pastebin.com/9iWXU3r1
Spoiler

--[[
	    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
Known bug turtle can't tell if wheat is grown so harvests all.
When first starting turtle must be manually feed seeds into the first slot after this it will collect enough seeds to be self sufficient.
DarkSnake #2
Posted 29 July 2012 - 06:49 PM
Hmm… a suggestion :)/>/>! You should put a pastebin link so we can download it easily ingame :ph34r:/>/>.
(I'm gonna do it :3, Private Link, if you want it to be used by everyone, I can make it public :)/>/> )
BigSHinyToys #3
Posted 29 July 2012 - 06:57 PM
Hmm… a suggestion :)/>/>! You should put a pastebin link so we can download it easily ingame :ph34r:/>/>.
(I'm gonna do it :3, Private Link, if you want it to be used by everyone, I can make it public :)/>/> )
Never thought it would be "popular" any way new links in OP
DarkSnake #4
Posted 29 July 2012 - 07:04 PM
well… tested it and it just turns around itself tilling and trampling, doesnt plant anything, doesnt move :ph34r:/>/>
BigSHinyToys #5
Posted 29 July 2012 - 07:10 PM
well… tested it and it just turns around itself tilling and trampling, doesnt plant anything, doesnt move :ph34r:/>/>
this is a new feature of CC turtles require fuel place coal in turtle and run refuel program then run my script or disable fuel in the computer craft config
I personally load it with 64 coal so i never have to worry about it. If i make a ver two I will add fuel gauge
DarkSnake #6
Posted 29 July 2012 - 07:13 PM
woops! thank you XD… I forgot fuelstuffs was added :ph34r:/>/>
ReconTurtle #7
Posted 29 July 2012 - 07:33 PM
First off, this program is genius, thank you for putting the time into making it. But how did you increase the size of the turtle's inventory?
BigSHinyToys #8
Posted 29 July 2012 - 07:37 PM
First off, this program is genius, thank you for putting the time into making it. But how did you increase the size of the turtle's inventory?
that was not me it was Dan200 all new turtles have bigger inventories cool ha.
ReconTurtle #9
Posted 29 July 2012 - 07:45 PM
First off, this program is genius, thank you for putting the time into making it. But how did you increase the size of the turtle's inventory?
that was not me it was Dan200 all new turtles have bigger inventories cool ha.

Oh damn, Tekkit needs to update SOON.
DarkSnake #10
Posted 29 July 2012 - 07:46 PM
I like it! :ph34r:/>/>
Only problem is, it uses only the first slot to replant… :/
EDIT: the 12x12 is moved by 1 block every run. :/

EDIT2:
BigSHinyToys #11
Posted 29 July 2012 - 07:51 PM
I like it! :ph34r:/>/>
Only problem is, it uses only the first slot to replant… :/
while this is not ideal it works fine because when collecting wheat it refills as it goes with seeds. when you first plant out you have to follow it and manually put seeds into the first slot.

If i make a v2 i will have to think something up for how to distinguish seeds from wheat.
BigSHinyToys #12
Posted 29 July 2012 - 07:57 PM
I have run this a couple of times and it worked file for me. it goes across the field parks on the other side waits 40 then returns to its start pos. any chance you could try it in creative flat map and see if it works properly.
dcleondc #13
Posted 30 July 2012 - 06:28 AM
make it so it says how many mins are left.
BigSHinyToys #14
Posted 30 July 2012 - 02:52 PM
LFT ver 2 change log

New and Improved
* Blocking turtle will not cause errors in movement turtle will wait for obstacle to move
* Shows the fuel level currently if it is 0 you need to run refuel and increase the levle
- Not tested with fuel disabled
* Added countdown to show how long to next plow.

———————————————————
I would like to thank you for using my little script and hope with your input I can make it into a real Grade A program.

I am releasing this code under NO licensing Use it or any part of it for what ever you would like too this code is Public domain and Open source
evilguard #15
Posted 29 August 2012 - 04:10 AM
Hellow!

First let me tank you for that programs. I just find it and use it and… really nice. Its easy, simple, and work like a charm. So is that possible to make it better? I think you can. Here is what i would love to see you add into that programs :

#1 : Chest drop and chest take. I would like the turtle to have a basic "waiting" point" where he can use chest. in a first one he can deposite inv slot 2 to 15. In other chest he can feed back slot 16 with fuel.

#2 : Option! i would like to decide if the turtle need fuel or not. And maybe add some other simple thing? using chest or not.

#3 : Refuel!!! Yeah i love the idea of using fuel since i think that a "magical" turtle that run on nothing is pretty bad.

#4 : since your programs is the most simple and easy to use i would like to suggest you to make same thing with a tree farm. Cause there is lot of programs for tree cutting but they all are over complicated. Right now i use lettuce mining to cut wood in row since its easier.

So you can make the same thing. It could plant tree (any kind) in a space, and making a path that will cut leave and wood. That could not be harder.

But yeah, your programs is really nice. So keep the good work :D/>/>
Alasdair #16
Posted 02 December 2012 - 07:47 AM
Hi, I made some modifications to your programme.

-77 minutes rather than 40 is optimal for farming in this arrangement. yes i did the calculations

-previously it was having some issues selecting seeds if it was not in the right slot. now you may place seeds in any slot and it will use them.

-it will actually refuel now - place the coal in any slot.

-at the end, it will dump its entire inventory in an inventory to its right, and pick up 2 stacks of the inventory to the left. i do this to prevent seeds clogging it up. i use a relay on the right, leading to a seed-filter and chest on the left, the wheat goes to another chest entirely.



--[[
		    12 X 12 farm
]]--
local function move()
    turtle.digDown()
    slot=1
    while not turtle.placeDown() do
turtle.select(slot)
	    slot=slot+1
  if slot>16 then
		  break
		 end
    end
    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 = 77
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)
    for i = 1,16 do
	 turtle.select(i)
	 turtle.refuel()
    end
    plow()
    turtle.turnRight()
    for slot=1,16 do
	 turtle.select(slot)
	 sleep(0.1)
	 turtle.drop()
    end
    turtle.turnLeft()
    turtle.turnLeft()
    sleep(5)
    for i = 1,3 do
	 sleep(1)
	 turtle.suck()
    end
    turtle.turnRight()
    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
doctorwhofan92 #17
Posted 30 June 2018 - 08:32 AM
Hi, I made some modifications to your programme.

-77 minutes rather than 40 is optimal for farming in this arrangement. yes i did the calculations

-previously it was having some issues selecting seeds if it was not in the right slot. now you may place seeds in any slot and it will use them.

-it will actually refuel now - place the coal in any slot.

-at the end, it will dump its entire inventory in an inventory to its right, and pick up 2 stacks of the inventory to the left. i do this to prevent seeds clogging it up. i use a relay on the right, leading to a seed-filter and chest on the left, the wheat goes to another chest entirely.

I tried to use the program and set stuff up so that it would output to the right but it doesn't work with the pastebin provided
BrunoZockt #18
Posted 15 July 2018 - 01:06 AM
Hi, I made some modifications to your programme.

-77 minutes rather than 40 is optimal for farming in this arrangement. yes i did the calculations

-previously it was having some issues selecting seeds if it was not in the right slot. now you may place seeds in any slot and it will use them.

-it will actually refuel now - place the coal in any slot.

-at the end, it will dump its entire inventory in an inventory to its right, and pick up 2 stacks of the inventory to the left. i do this to prevent seeds clogging it up. i use a relay on the right, leading to a seed-filter and chest on the left, the wheat goes to another chest entirely.

I tried to use the program and set stuff up so that it would output to the right but it doesn't work with the pastebin provided

I don't know how I ended up here but anyways…
The pastebin link leads to the original program, if you want to use the modified version by Alasdair you have to copy and paste. And btw. this program is almost 6 years old, there are very likely better programs out there by now ;)/>