Jump to content




AutoTreeFarm Program V2

turtle wireless utility

28 replies to this topic

#1 Anonomit

  • Members
  • 67 posts

Posted 12 August 2012 - 05:24 AM

EDIT: New, far superior program can be found here: http://bit.ly/Q6zqCt

Credit for original code to BikerEleven

EDIT: BikerEleven has stopped playing minecraft, and has given me permission to take credit for any updates.

Original forum thread can be found here:
http://bit.ly/NYbb3u

This is an update for BikerEleven's [1.3]AutoTreeFarm program

Here are a few of the changes:
Spoiler


You got my attention, so what do I do?
Spoiler

How do I install these programs?
Spoiler

Where can I get these programs?
Spoiler

What about the bonus programs that will make tree farming so much easier? I must have them!
Spoiler

Edit:

--Code Updated!

Spoiler


#2 Bushido

  • New Members
  • 13 posts

Posted 08 September 2012 - 03:02 AM

Can u add when it is full it returns to empty it's inventory and to refill it's saplings some how? other wise it is awesome bro

#3 Anonomit

  • Members
  • 67 posts

Posted 14 September 2012 - 09:04 PM

if you're using tekkit, set up an advanced wooden transport pipe to suck out only the wood.
make sure the turtle is set to 'output redstone on cycle'. press 's' to recreate settings.
as for refilling saplings, the problem is that if i were to add that in, the turtle would need to be refilled before EVERY trip, manually or with pipes.
maybe i'll release an update that gives an option to refill saplings.
for now though, the saplings will need to be refilled manually, sorry :)/>

Edit:
--if updating, press 's' to recreate settings, otherwise you will get an error.
--turtle now has an option to wait for full saplings between cycles.
--the turtle will output redstone on the bottom, left and right sides.
--make the redstone power a redstone engine, powering a pipe that brings saplings to the turtle.
--depending on how long the pipe is, the turtle will have to throw away a couple saplings if he gets too many.
--use a transposer to automatically pick up any extra saplings.
--turtle will not wait for full saplings unless 'output redstone on cycle' is selected.

--this code is not ideal, but it works if you really want that small amount more automation.
--if not, do not select 'Wait for full saplings'

#4 hi_tech_guy_18

  • New Members
  • 1 posts

Posted 21 September 2012 - 11:25 PM

You need to add a refuel command at the begging so it self refuels pref from the last slot

#5 Bushido

  • New Members
  • 13 posts

Posted 23 September 2012 - 05:27 AM

Computer craft keeps spitting out this http://pastebin.com/RmQSrPG8. The turtle will place saplings and cycle redstone signal and stop when saplings are full but it will stop while trying to harvest the trees.



Edit: Fixed the chat error spam Nocheat doesn't like mining turtles.

#6 Xanafrim

  • New Members
  • 1 posts

Posted 27 September 2012 - 04:42 AM

I JUST started trying out Computer Craft and I found this program. I have installed it and it was working fine but then I fixed the ground a bit where it dropped a level. After I did this I hit "r" and he went on another round. However, ever since then he only takes 2 logs per tree and leaves the rest for me to clean up. I did not alter any of the code so I am no sure what might have happened.

Possibly it is connected to lag as that is an issue for me. I run a single core processor right now, no hyperthreading, 2 GB ram. That's the max this laptop can hold. However, I also am the admin of a paid server that runs tekkit and that is the only place I play. The server does have 1 GB of ram. I am running the current Tekkit pack.

Thanks for any help on this.

#7 Bushido

  • New Members
  • 13 posts

Posted 27 September 2012 - 06:35 AM

At least yours gets some logs all mine does is run into the tree and stop lol.

#8 Anonomit

  • Members
  • 67 posts

Posted 27 September 2012 - 03:54 PM

 Xanafrim, on 27 September 2012 - 04:42 AM, said:

I JUST started trying out Computer Craft and I found this program. I have installed it and it was working fine but then I fixed the ground a bit where it dropped a level. After I did this I hit "r" and he went on another round. However, ever since then he only takes 2 logs per tree and leaves the rest for me to clean up. I did not alter any of the code so I am no sure what might have happened.

Possibly it is connected to lag as that is an issue for me. I run a single core processor right now, no hyperthreading, 2 GB ram. That's the max this laptop can hold. However, I also am the admin of a paid server that runs tekkit and that is the only place I play. The server does have 1 GB of ram. I am running the current Tekkit pack.

Thanks for any help on this.

That's strange. Is it possible that you accidentally moved the turtle to a different starting location? The turtle should harvest up a tree until the block above him is not wood. If he stops harvesting early, maybe there is lag, which could be making him check the block too soon. It's a theory. Could you try it out on single player and let me know if there's still a problem?

#9 Anonomit

  • Members
  • 67 posts

Posted 27 September 2012 - 03:55 PM

 Bushido, on 27 September 2012 - 06:35 AM, said:

At least yours gets some logs all mine does is run into the tree and stop lol.

Hi Bushido, it sounds like your turtle is eaither not a mining turtle or doesn't have permission to break the tree blocks. If this is on a server, check with the server admin to make sure that the area isn't protected from players of minimum rank. perhaps he can OP the fakeplayer [ComputerCraft]?

#10 Bushido

  • New Members
  • 13 posts

Posted 28 September 2012 - 01:39 AM

well im the admin of the server and it is a mining turtle so the only answer left is that the protection zone i have in place is preventing it from mining it thank you i feel stupid that i didn't think of that

#11 Anonomit

  • Members
  • 67 posts

Posted 28 September 2012 - 02:42 AM

If you're using worldguard, try using the command:
/rg addowner regionname [ComputerCraft]

If that doesn't work, try checking the turtle config file, and make sure the fakeplayer login is enabled. This thread explains why that's important: http://bit.ly/QJqXBF

EDIT: I forgot, it depends what your config setting is for fakeplayer whether you can op all turtles at once or have to allow permissions to each one separately

#12 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 28 September 2012 - 03:08 AM

If using residence, the command would be /res pset plotname [computercraft]turtleid flag true

#13 Lost Ninja

  • Members
  • 39 posts

Posted 16 October 2012 - 09:14 AM

Is it possible to have this work prior to getting going with wireless systems?

I tried just using the logger program on it's own but it just chops anything placed above it but does nothing else (and no helpful error messages either).

I don't want/need all the other wireless functionality. Just a turtle that farms trees. :/ (No criticism intended.) (And I'm too lazy/thick to write my own.)

#14 slay_mithos

  • New Members
  • 22 posts

Posted 21 October 2012 - 09:02 PM

It is quite a nice script, even without wireless and all, but looking at the code, I found some strange things, like using only 9 slots and wasting 2 units of fuel per tree when cutting.

I wanted to know if you would mind that I change bits to accommodate with my own usage, or if I need to create a blank project for it.

To be honest, I just want a turtle to farm the trees, replant them, and deposit the wood, take some fuel if needed, then wait for 5-10 minutes and go again, with the startup script launching it, and this seems to be working well enough to save me part of the work.

No hard feeling if you decline, or find me rude.

#15 Anonomit

  • Members
  • 67 posts

Posted 24 October 2012 - 12:02 AM

 Lost Ninja, on 16 October 2012 - 09:14 AM, said:

Is it possible to have this work prior to getting going with wireless systems?

I tried just using the logger program on it's own but it just chops anything placed above it but does nothing else (and no helpful error messages either).

I don't want/need all the other wireless functionality. Just a turtle that farms trees. :/ (No criticism intended.) (And I'm too lazy/thick to write my own.)

This program is not updated for turtles that require fuel, sorry. It's intended of CC 1.3 (for tekkit use). It sound like that may be the problem you're experiencing.

 slay_mithos, on 21 October 2012 - 09:02 PM, said:

It is quite a nice script, even without wireless and all, but looking at the code, I found some strange things, like using only 9 slots and wasting 2 units of fuel per tree when cutting.

I wanted to know if you would mind that I change bits to accommodate with my own usage, or if I need to create a blank project for it.

To be honest, I just want a turtle to farm the trees, replant them, and deposit the wood, take some fuel if needed, then wait for 5-10 minutes and go again, with the startup script launching it, and this seems to be working well enough to save me part of the work.

No hard feeling if you decline, or find me rude.

By all means, edit away! Feel free to post any improvements if you'd like. I may end up making one from scratch eventually to weed out the bugs that have cropped up recently.

#16 slay_mithos

  • New Members
  • 22 posts

Posted 25 October 2012 - 08:36 PM

I made two changes to the program:

The first being I changed the harvestTree a bit to prevent the down() dig() forward() up() that wasted 2 fuel for each tree, replaced by a simple dig() forward() digDown(), and changed step to 3 for the rest to continue working as expected
    local function harvestTree()
		   
		    steps = 3
            turtle.select(3)
            if turtle.detect() then
						    turtle.dig()
				    end
				    while not turtle.forward() do
						    turtle.dig()
				    end
            
            turtle.digDown()
            turtle.select(3)
            tryMove( "up" )
            
		    while turtle.compareUp() do
           		 tryMove( "up" )
				    steps = steps + 1
                    if steps == 20 then
                   		 break
                    end
		    end
		    turtle.select(1)
		    while steps > 2 do
                    turtle.select(1)
				    tryMove( "down" )
                    turtle.select(1)
				    steps = steps - 1
		    end
            if outOfSaplings == 0 then
                    plantTree()
            end
     
    end

For my personnal use, I removed the while true at the end and replaced it with my standard "drop items and refuel" to make it loop every 5 minutes, but that is because of my personnal preferences, so I won't be imposing this on anyone, seing as your program, when used with rednet, is way more robust in its handling.

#17 ChunLing

  • Members
  • 2,027 posts

Posted 26 October 2012 - 01:53 AM

How about if the turtle spun around and dug in the various directions to try and catch some saplings (or errant logs from oak trees)?

#18 Anonomit

  • Members
  • 67 posts

Posted 26 October 2012 - 04:23 PM

I started work on a 1.4.1 version that makes use of the relatively newer APIs. I've previously wanted to keep this program compatible with 1.3, as this is the version Tekkit is running. When I get around to finishing, the turtle will be a lot smarter, and worry about fuel consumption. The 1.4.5 update added the transferTo() function in the turtle API, which will be extremely useful for sucking in saplings and not clogging up item spaces, but I'll see if I can make this work without it first. Maybe I'll have it check the running OS to determine what it can call, but if somebody's using a custom OS I would have to assume it isn't updated any farther than 1.3. Or I could ask the user to input the OS version if it's a custom one. I'll see how it turns out.

#19 Taiine

  • New Members
  • 4 posts

Posted 27 October 2012 - 08:36 PM

Hello! I've been using this and am enjoying it very much and plan to include it in my soon to be tekkit playthough. However I ran into an issue.

The turtles are supose to stop sending out a redstone signal when all but the first two invatory slots are empty. However mine continue to send out a signal even when I remove everything from them.

I'm using redstone engines with advanced wooden pips to pull the items out, it works great as as soon and the turtle lands it powers the engines however it doesn't stop... leading to a few exploshions Is this a bug, or something I am doing wrong?

#20 Anonomit

  • Members
  • 67 posts

Posted 29 October 2012 - 02:19 AM

If I recall, the version right now (I guess I should start numbering them) has a couple options that may be the problem. Try pressing the 's' key to recreate the settings. If you have 'wait for full saplings' turned on, the turtle will continue outputting redstone until slot 1 is full of saplings. I personally don't recommend this option, but it does allow a degree more automation in cunjunction with buildcraft. Unless you're pumping saplings into the turtle, or plan to manually refill him every cycle, I suggest you leave that particular option turned off. The 'output redstone on cycle' option however, should, of course, remain turned on. Btw, what exploded? Anyway, let me know if this was the problem, and if it wasn't, re-post with your CC version and as much information on how to reproduce this and I'll see if I can figure out what's up.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users