Jump to content




Logger Program

turtle

21 replies to this topic

#1 Anonomit

  • Members
  • 67 posts

Posted 20 November 2012 - 04:14 PM

Hi, here's a tree farming program that's been in the works for awhile, and I finally decided to finish.

There are quite a few customizable options, such as:
  • mode (farm or bonemeal)
  • length and width of farm
  • options for delaying next cycle until logs are emptied, saplings are refilled, or both. This allows for other mods, like buildcraft, to automatically empty the logs.
  • ability to output a redstone signal (from fully customizable sides) upon completion, until ready for next cycle. Useful for powering pumps, or letting you know when the turtle has completed a cycle.
  • fuel can be turned off, simply by toggling a variable at the start of the code. This way the program won't throw an error if turtle fuel consumption is turned off.
  • Rednet compatibility comes in the form of two other programs, allowing you to start and monitor multiple loggers simultaneously, with ease.
This program was made and tested using ComputerCraft 1.47, and has not been tested on other versions. If you are not using version 1.47, there may be some bugs.

This program is a start-over-from-scratch update of this somewhat buggy, messy, 1.3-compatible version, found here: http://bit.ly/NhYPsp
That program is an updated verion of the original program, found here: http://bit.ly/NYbb3u
A video of the original program in action can be found here: http://bit.ly/NWJ84b *Note that the program has been drastically altered since this video was made, although the initial idea remains the same.

To go with this program are two others, which take advantage of the rednet capabilities.

Broadcast:

The broadcast program is meant to be run at startup on a dedicated computer with a modem. If enabled, it manages the turtles, monitors their states, and stores them for use in the Log program. This program will have debug mode on by default, so you can see what messages are being received and sent by the turtles. To turn it off, either run the program with the argument noDebug or change the value of the variable bDebugDefault to false. This variable can be found at the top of the code.

Broadcast can be found here: http://pastebin.com/q1h8UGyf

Log:

This program will start all nearby loggers that have connected to the broadcast console. Since all variables are handled by the broadcast console, it's possible to run this program from any computer with a modem and start your loggers, or retrieve information about them, such as how many are running out of saplings, and how many already have. If you have already set, but want to change the broadcast console that this program will communicate with, run the program with the argument recreate. If you only want to start certain loggers, I suggest connecting them to a different broadcast console. This way you could have multiple farms nearby, that would't interfere with each other, or a group of turtles who are set to bonemeal mode instead of farm mode, but still with rednet support.

Log can be found here: http://pastebin.com/mWeDt5NT

Logger:

The main program, it will work without the above two, but each turtle will need to be started manually, rather than by rednet. If your turtles don't consume fuel, change the value of the variable bUseFuel to false. If you are not considering using the Broadcast and Log programs, change the value of the bNoBroadcast variable to true. These variables can be found at the top of the code.

Logger can be found here: http://pastebin.com/QkW1kYqX


Please post if you find any bugs or have any suggestions, comments or questions.
That said, I hope you enjoy the programs!

#2 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 20 November 2012 - 04:16 PM

Well done. Most Lua code I see is poorly or shoddily done. This is neither. /me stamps with approval.
:(/>

#3 Anonomit

  • Members
  • 67 posts

Posted 20 November 2012 - 04:28 PM

View Posttiin57, on 20 November 2012 - 04:16 PM, said:

Well done. Most Lua code I see is poorly or shoddily done. This is neither. /me stamps with approval.
:(/>
Thank you, although I think if you look closely you'll see a lot of unnecessary code. I modified some functions I've used in other programs, so there's still a lot of extra lines :(/>

#4 UrbanRedneck

  • New Members
  • 1 posts

Posted 23 November 2012 - 09:45 AM

Nice Program works great in FTB going over to ask a pro how to stop it when done.

#5 Anonomit

  • Members
  • 67 posts

Posted 23 November 2012 - 11:56 AM

How to stop it? If you're using the farm mode, just wait until it's finished its cycle, and it'll stop automatically. If you're in a rush, just terminate it or shut it down. That'll screw with the broadcast console if you're using it though, mind you. If you're using the bonemeal mode, follow the on-screen instructions and press any key to stop it.

#6 AdiCCted

  • New Members
  • 2 posts

Posted 01 December 2012 - 10:12 AM

Great program! I like all the options, and how easy it is to use i through rednet. I have 8 turtles running it around my house, and I can start them all at once from my master computer. So awesome to look out the window and see them all simultaneously start chopping down trees! Thanks!

#7 Poodmund

  • Members
  • 3 posts

Posted 05 January 2013 - 10:59 AM

Has something in the API changed to cause the "Log" program to fail? I can run the Logger program manually on the Turtle fine but when trying to initiate it via a networked computer I get the message, "Logger:688: attempt to index ? (a nil value)"?

#8 Hawkertech

  • Members
  • 9 posts

Posted 05 January 2013 - 11:27 AM

will this work with the larger redwood trees? 4 sapplins in one tree.

#9 Poodmund

  • Members
  • 3 posts

Posted 05 January 2013 - 11:29 AM

No it doesn't, I'd try searching the forums for another tree felling program specifically for 4 sapling trees.

#10 mauijim

  • Members
  • 2 posts

Posted 18 January 2013 - 09:44 AM

Would there be a way to make this to where it automatically runs when using farm mode, instead of having to start it manually? I have four farms set up and want it to run on its own, im using all three proframs.

#11 Yusunoha

  • Members
  • 8 posts

Posted 22 January 2013 - 05:20 AM

I've ran into a problem with the logger program
I am using the fir sapplings of ExtraBiomes XL and I set the turtle to bonemeal mode.
all is going fine till at a certain point the turtle stops chopping wood and goes down, without finishing chopping down the whole tree.
this cause the turtle to keep spamming sapplings and bonemeal when it gets down till the bonemeal runs out, because the sapplings can't grow because the top part of the last tree hasn't been chopped down yet.

#12 redwolv

  • New Members
  • 1 posts

Posted 28 January 2013 - 08:36 AM

OK I am running version 1.481, I have found a bug in which randomly at times the turtle will chop the first block of the tree they procede right no through the tree for the whole cycle. this is really bad cause then every tree has to be manually removed before the turtle will be able to plant saplings and chop trees again.

#13 Minithra

  • Members
  • 25 posts

Posted 08 February 2013 - 01:22 AM

Hello. I am trying to get this directly from pastebin, and I get the :92: error. pastebin:92: attempting to index ? (a nil value)

The command I'm trying to use is: pastebin get QkW1kYqX logger.


Halp! I have no chance of ever typing all of the code in :D Connecting to pastebin goes well, then this :/

#14 MinecraftFarms12

  • Members
  • 4 posts

Posted 23 February 2013 - 08:55 PM

Hey There is an error where My Computer need all Modems on The sides when i put broadcast and log on, cause this sucks man and really i want to run my turtles wirelessly. Also when the turtle says "use broadcast console" I put yes and it says no modem on top; what does that mean.
oh by the way I'm using CC version 1.5 Minecraft version 1.4.7 so yeah.
also there is an error on log that when i put the broadcast console id it says conflict between log and broadcast so wat does that mean.
Thanks MinecraftFarms12 :D

#15 BikerEleven

  • Members
  • 7 posts

Posted 07 March 2013 - 08:17 AM

Nice work you have done there, much better than my original mess of a program. I still wonder why I never used mod % instead of a toggle bool.

#16 Shadow_Assailant

  • Members
  • 23 posts

Posted 07 March 2013 - 03:48 PM

Disregard this post.

#17 MinecraftFarms12

  • Members
  • 4 posts

Posted 11 March 2013 - 09:46 PM

Anonomit's Program Edited A Little Bit

Logger: http://pastebin.com/6B3mVJGG

Log: http://pastebin.com/GMDCVGSz

Broadcast: http://pastebin.com/5Sn0r95E

All Credit Goes To Anonomit :D B)

#18 oxgon

  • Members
  • 22 posts

Posted 24 March 2013 - 08:18 AM

I don't know if this is still being worked with but I can't get it to work with bonemeal.

#19 jake5253

  • New Members
  • 1 posts

Posted 15 April 2013 - 09:51 AM

This is a great program! I really appreciate all the work that went into it, but it really bothers me there is no "exit" in Logger. I needed to refuel and couldn't figure out a way to refuel it manually without breaking the turtle and re-placing it; so, here is an edit with only 4 extra lines. I placed them where it lists "press r to begin, s to recreate, c to clear etc..":

                print( "Press 'x' to exit" )
			    if event == "char" and param1 == "x" then --exit on x keystroke
			    shell.run("clear")
			    return

http://pastebin.com/LZzgNEmx

#20 RustyDagger

  • Members
  • 5 posts

Posted 04 June 2014 - 02:45 PM

This would be great if it didnt insist on having a modem on every Gdam side of it????? WTF Its just none on XX side terminate... until you cover the whole thing dont you think thats a little excessive and makes it hard to use?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users