Jump to content




(Video) Andy Logger Deluxe Felling Turtle! (CC 1.52 Compatible)

turtle lua

91 replies to this topic

#1 Andrakon

  • Members
  • 37 posts

Posted 09 April 2013 - 08:47 PM

Paste this in to your Felling Turtle:
pastebin get HanjL7Mz logger
and type logger to start the program.

If you want your Felling Turtle to restart itself in the event of a server restart or it's chunk unloads paste this code too!
pastebin get nDgxjQas startup


Andy Logger Felling Turtle! - By Andrakon
Version 1.72

1.72 Bug fix
Version 1.71 introduced a bug where the turtle would thing it's slots and output chest were full when they were not. It is now fixed

1.71 Bug workaround
Now works with CC 1.52! Found a work around for a bug in computer craft 1.52 where dropping items from an empty slot drops items from the wrong slot! Also the work around makes dropping off items faster. This is done by checking to see if the slot is empty before trying to drop from it.

1.5 IMPORTANT NEW FEATURE!
Andy Logger can now be made to restart on its own, and if it restarts in the field it will finish chopping its tree and find its way home!
You can do this by renaming the logger program to "startup" or by getting my andy logger startup program with "pastebin get nDgxjQas startup"
  • All settings configurable with a GUI
  • Custom farm sizes, gaps between trees, gaps between turtle and first row, offset first row to the left or right
  • Will build the farm for you
  • Can recover from restarts in the field if startup script is installed or if named startup
  • Knows if fuel usage has been disabled or not automatically!
  • Makes its own charcoal with a furnace (optional)
  • Can be configured to use a Powered Furnace (optional)
  • Picks up saplings from a nearby chest (optional)
  • Drops off excess inventory to another nearby chest (optional)
  • Slots are configurable
  • Time between logging runs is configurable
  • Saves settings to a file
  • Automatically names your turtle, name can be changed within the menu
  • Keeps track of how many saplings are planted, trees felled, and charcoal made
  • Does not use a modem
  • Cuts 1x1 trees only, works great with Forestry bred trees!
  • Can handle farms up to 127 trees!
See it in action!


See the code on Pastebin


Layout:
Posted Image

Todo: Rednet

Changelog:
Spoiler


#2 superaxander

  • Members
  • 609 posts
  • LocationHolland

Posted 10 April 2013 - 01:30 AM

Looks good!

#3 unobtanium

  • Members
  • 505 posts

Posted 10 April 2013 - 01:47 AM

LOL

Well done ^^
Tought about adding such a tree farm into my own tree farm program last days :D

#4 superaxander

  • Members
  • 609 posts
  • LocationHolland

Posted 10 April 2013 - 01:48 AM

View PostUNOBTANIUM, on 10 April 2013 - 01:47 AM, said:

LOL
?

#5 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 10 April 2013 - 02:40 AM

This is awesome man. I thought this was your regular tree logger, turns out is the most editable one.

Great job!

#6 Andrakon

  • Members
  • 37 posts

Posted 10 April 2013 - 08:45 AM

View Postsuperaxander, on 10 April 2013 - 01:30 AM, said:

Looks good!

View PostUNOBTANIUM, on 10 April 2013 - 01:47 AM, said:

LOL

Well done ^^
Tought about adding such a tree farm into my own tree farm program last days :D

View PostEngineer, on 10 April 2013 - 02:40 AM, said:

This is awesome man. I thought this was your regular tree logger, turns out is the most editable one.

Great job!

Thanks a bunch! With over 1500 lines of code I tried to make it as editable and user friendly as I could! This is actually my first turtle program and I am happy to get feedback on it! I have spent nearly 2 weeks on it trying to make a quality product.

#7 Locrin

  • Members
  • 3 posts

Posted 11 April 2013 - 12:18 PM

It's not working right for me. it goes around and acts like it is placing dirt and saplings but it's not placing anything.

#8 Andrakon

  • Members
  • 37 posts

Posted 11 April 2013 - 09:35 PM

View PostLocrin, on 11 April 2013 - 12:18 PM, said:

It's not working right for me. it goes around and acts like it is placing dirt and saplings but it's not placing anything.

You have to put the resources it asks for in the slots it asks for. If you put the wrong stuff in the wrong slots it won't work. Otherwise I would have no clue what could have caused that behavior. I've been running one for over a week and never had a problem.

#9 Locrin

  • Members
  • 3 posts

Posted 13 April 2013 - 04:19 AM

I've put everything in the right slots.

#10 spyman68

  • Members
  • 155 posts

Posted 13 April 2013 - 04:54 AM

This doesn't work

#11 Andrakon

  • Members
  • 37 posts

Posted 13 April 2013 - 05:13 AM

Just loaded up a new turtle and did some testing. Found a bug where if you turned the output chest option off the turtle program would crash. Fixed it.
Also realized I had the default number for rowOffset set to 2 when it should have been set to zero.
Turtle program is now v 1.2!

Conclusion: Works Perfectly! :D
If you find a bug please tell me the error code and what options you had.

#12 queezle

  • Members
  • 6 posts

Posted 16 April 2013 - 04:26 AM

Hey, your Program looks awesome! But I got one litte (big?) problem! When I start my Turtle it runs around and trys to place the saplings and dirt. But it wont do it. Then it returns to its base and waits its sleep time and starts over all again without placing its dirt and saplings. No error no nothing. Just burning through all my fuel :-) Maybe you got an idea how to fix that issue?

#13 Andrakon

  • Members
  • 37 posts

Posted 16 April 2013 - 06:08 AM

Bug fix update
Changelog:
1.3: Automatically checks to see if fuel is set to unlimited, does not crash if it is unlimited and the fuel option is not off.

#14 Andrakon

  • Members
  • 37 posts

Posted 16 April 2013 - 06:11 AM

View Postqueezle, on 16 April 2013 - 04:26 AM, said:

Hey, your Program looks awesome! But I got one litte (big?) problem! When I start my Turtle it runs around and trys to place the saplings and dirt. But it wont do it. Then it returns to its base and waits its sleep time and starts over all again without placing its dirt and saplings. No error no nothing. Just burning through all my fuel :-) Maybe you got an idea how to fix that issue?

I have never had that issue so I have no idea how it could happen. I would have to probably have a screenshot of its inventory before it set out to do things to troubleshoot with or something. Did you have everything in the right slots? Did you try breaking the turtle and placing it back down? Sometimes that fixes "Computercraft" glitches that are out of my control.

Also I have no idea if this program works in older versions of computercraft.

#15 queezle

  • Members
  • 6 posts

Posted 16 April 2013 - 07:27 AM

I think the server im playing on has some problems with the turtles. When I try in lua turtle.place() with a block in the first slot I get a false back. Looks like its not your error ;-)

#16 Andrakon

  • Members
  • 37 posts

Posted 16 April 2013 - 11:14 AM

View Postqueezle, on 16 April 2013 - 07:27 AM, said:

I think the server im playing on has some problems with the turtles. When I try in lua turtle.place() with a block in the first slot I get a false back. Looks like its not your error ;-)

Ahh, great! Thank you for letting me know! Sorry that you may not be able to use the turtles right now though. Maybe when your server updates next time it will be better. :)

#17 Andrakon

  • Members
  • 37 posts

Posted 17 April 2013 - 02:29 AM

1.4 Major Update! I took a look at a video of a turtle made by Anonomit and realized they used a much better way to check for saplings! So now instead of the turtle comparing the sapling in its hand to the one on the ground (unreliable), it tries to place a dirt block there instead. If it can then there is no sapling there, so it checks for dirt below it first, then it plants a sapling. Thank you Anonomit for your accidental contribution lol!

With some testing I realized I could get the same ammount of wood in half the time with forestry trees since the logger no longer breaks forestry saplings as it does its logging. So I reduced the base wait between logging runs by 300 seconds and changed the wait time auto calculation to reduce the wait time by 5 seconds per tree instead of 10 seconds per tree.

While I was at it I made the turtle check to see if the server had the fuel off every time the program is run. And realized it would make charcoal if the fuel was off but the use furnace option was still on, so I fixed that too.

And besides some code clean up, I also fixed part of the GUI disappearing if you opened the menu.

#18 queezle

  • Members
  • 6 posts

Posted 17 April 2013 - 09:20 AM

Its running now and I love it. What happens when I logg off from the server and the chunk gets unloaded? Is it possible that the turtle remembers its state and just continues its work? Because at the moment it looks like I have to start the program every time I log on (or when I move too far away)

#19 Andrakon

  • Members
  • 37 posts

Posted 17 April 2013 - 02:17 PM

View Postqueezle, on 17 April 2013 - 09:20 AM, said:

Its running now and I love it. What happens when I logg off from the server and the chunk gets unloaded? Is it possible that the turtle remembers its state and just continues its work? Because at the moment it looks like I have to start the program every time I log on (or when I move too far away)

If the chunk the turtle or computer is in gets unloaded it will stop running and reboot the next time it's chunk is loaded. There are a couple options. The best option is a chunk loader, if your running FTB there are several options, such as a world anchor, or a chickenchunks chunk loader. Another good option is a Misc Peripherals chunk loader upgrade, it also doubles as a modem! Most FTB versions also have Misc Peripherals installed. http://www.computerc...peripherals-31/

However a chunk loader will not help if the server restarts. For this I wrote a small script that will make the turtle run the logger program when it reboots but it does have a small risk. If the turtle reboots while it is out logging it will assume it is at its starting position when it is rebooted. This could cause your turtle to build another farm in in the wrong place if it has bad luck! Most of the time the turtle will be sitting at home so you have probably a 10% chance of this happening.

USE WITH CAUTION!
This will start the logger program automatically if the turtle reboots.
pastebin get nDgxjQas startup


#20 queezle

  • Members
  • 6 posts

Posted 17 April 2013 - 07:25 PM

Yes, thats what I was looking for <3

I know that austinKK has such a funktion in his turtle-quarry too. I tried to look into his code ( http://pastebin.com/3mkeUzby , http://www.computerc...tle-ore-quarry/ ) and he writes his positions into a file and loads it from there when the turtle reboots. I havent done a lot of programming yet with the turtles, so im not sure if this is possible what I am thinking. But maybe, the turtle can remember where the base is (with coordinates) and writes it into a file. Then, everytime it reboots and the startup is done, it checks his actual possition (this is the part I'm not sure with ;-) ) and checks if it is his base. If not, navigate back to base and go back to his normal program. If it is already in base, well, nothing happens.
Just an idea and maybe you like it :-)

*edit* btw, Im asking for this because I dont want to use chunkloaders. On a multiplayer server it can produce a lot of lag if you have too much of them :-(





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users