API
Spoiler
The latest revision of my program saw me splitting common program features into a sub-API which is usable over many different programspastebin code : fcEn6qgf
- Feature List
- cls() - Clear Screen and Set Cursor to the start
- saveTable(filename,data) - Saves Specified Table
- loadTable(filename) - Loads Table
- uploadTable(id,table) - Sends table information over rednet
- setSpace(msg) - Used for my basic GUI's, thats what creates my formatting like so "|| Parmos V2"
- setTitle(msg) - Sets the Title for the pages
- checkLabel - Checks if computer has a label, if not, prompts you to enter one
- title() - Prints title with the setspace like demonstrated above
- inputNUM(msg) - Validates an input if its a number, if not, asks again
- inputYN(msg) - Validates a y/yes|n/no input, if not, asks again
- inputSTR(msg,str1,str2) - Asks you to pick one of the two options defined by str1 and str2
- up() - Turtle Up
- down() - Turtle Down
- forward() - turtle forward
- back () - turtle back
- digMoveForward() - keeps digging forward until it can move forward
- digMoveUp() - keeps digging up until it can move up
- digMoveDown() - keeps digging down until it can move down
- dig(delay) - Digs forward, sleeps for delay, if block still there, repeats
- digUp(delay) - Digs up, sleeps for delay, if block still there, repeats
- digDown(delay) - Digs down, sleeps for delay, if block still there, repeats
- digUpForward(delay) - Does the same as digUp and Dig but it combines them both and checks
- digUpDown(delay) - Does the same as digUpForward, but different directions
- digAll(delay) - Combines all three checks
- posRotate(dir) - parses string input, if string equals right, turns right, if string equals left, turns left
- negRotate(dir) - parses string input, if string equals right, turns left, if string equals left, turns right
- dropSlots(first,last,side) - drops slots, starting at the first, up to last, with a side, which can be up,down,front
- pbGET(code,filename) - My Own GUI less pastebin grabber
- dbGET(userNumber,code,filename) - My Own dropbox file grabber, specify user number, then the code, then specify the name of the file to save as
- sendTable(id,table) - Sends table to a rednet ID
- loadSTR(filename) - Retrieves all text contained within a file
Simply place down your computer / turtle, right click on it to bring up the computer window, then type what is in quotes, but where it says <program name>, that means you can call it UncleSam for all I care, just remember what the name is, as that is what you will need to type in to run the program
pastebin get 4M3pgDrM <program name>
Features
- Extensive GUI for the basic user (computercraft illiterate persons)
- Contains 2 Main programs to be run from main menu, along with 3 basic programs for ease of use, saves you guys learning the console commands, with intuitive prompts
- Sub-Programs
- Mine
- Efficient use of fuel
- Digs Either 1 layer(blocks on its level only) or 3 layers(1 Above, its level, 1 Below)
- Definable Depth, work out how many blocks it will dig by multiplying the levels by the layers, eg 2*3 = 6 blocks deep
- Drop Block Functionality, no longer do you have to check up on your turtle to empty the chest of all that pesky cobble!, just choose how many slots you want dropped, and then place one of each of the items you don't want collected in each respective slot, when its mining it will drop those useless items on the ground saving you your precious and highly coveted chest space
- Place Torch Functionality - Places torches on the last layer of its mining job if you tell it to do so, handy for bedrock mining where it gets really dark and scary
- Efficient gravel detection already implemented, no longer will turtles be broken due to gravel or sand interrupting their mining operation
- Turtle will only return home as well if it thinks its inventory is full at the end of each line, or it has finished mining a layer, where it will return home, dump the items, then proceed to dig down if more layers are defined
- Don't worry about your turtle crashing or dying mid-mine due to lack of fuel, a fuel calculation system has been implemented that tells you how much more fuel the turtle needs to do the job before it even starts! so you are pretty much guaranteed an uneventful mining operation while you do other stuff around your base
- The program also supports uploading its information to a server if a) it has a wireless modem on it, and you have defined a server id to upload to
- This will allow you to check up on your turtle without trying to find it if it is within wireless range of the receiving computer
- If nothing comes through, its not of any fault of my program, there is a range limitation as can be found out here http://computercraft.../Wireless_Modem
- I actually forgot about this last feature, haha, I added in an option to deposit into an enderchest rather than returning home, you place an enderchest, referring generally to modpack ones, rather than vanilla enderchests unless of course you have an auto chest clearer on the other end, it then places the enderchest above it when it needs to empty its inventory, then removes it when done.
- Warning please, Yes there is a persistance function, no, it doesnt work properly, use at your own risk, also this means no leaving the vicinity, sorry, If you read how my program is structured you would too figure out that persistance is too tricky to make without remaking the whole program (again) from scratch (no way)(too lazy)(only interested in programming lua periodically nowdays, this change would require days of work)
- Server
- No longer do you have to check up on your turtles manually, using this simple program you can see the real time statuses of each and every turtle, of course only if using my program, would be silly and too inconvenient for me to implement a universal system now wouldn't it
- Good News Everyone! you don't need a computer for this, you can actually configure another turtle with a wireless modem to be your server as well!, doesn't mean you can't use a normal computer though, just if you do, place a wireless modem on the right of the computer
- Not to mention you can either use an external monitor for this program, or not, your choice, so get mining!!!
- Refuel
- Prompts you to fill as many slots as you can with fuel types
- Fuel types can mean anything from wood!!! BURN BABY BURN!!!, to coal, charcoal, and depending on your modpack, say with IndustrialCraft 2 you can use batteries, or in fact lava buckets, if you have copious amounts of lava i would recommend this one, 1 bucket of lava gives your best friend the ability to travel 1000 blocks.
- Update
- Not much more to say about this, pretty straight forward other than it updates the program :P/>
- Reset
- Cleans all the stored memory data by the turtle, allowing you to start fresh, due to the way I have coded the programs this seems pretty defunct then, don't ask!!!
29/08/2013
- Fixed Torch Placing
- Added in support for the server for the new datatype
- Added Program "server"
- General Tweaks to the code
- None, other projects are requiring my attention, not to mention I haven't played minecraft in weeks now
Important Please Read
This program is not being updated anymore, so if you want to use this program, just letting you know its not supported, you cannot cross-use the two programs either, they are completely different, the newer being a complete rewrite, although if you want to use the tree program from V1, go right ahead, its perfectly bug free, lacks persistance though, but that program has had the most extensive testing of any, use it all the time for turning mindcrack 2x2 fir trees into charcoal with natural tree growth, needless to say i have ended up with over 640 stacks of charcoal without touching it…
Changelog
- 11/07/2013
- Added refuel sub-program
- Added update sub-program (updates the whole program)
- Added reset sub-program (resets all saved fields)
- Added in option to the mining program to drop up to the first 8 inventory slots, whilst keeping one of every item in them
- This allows for dumping of whatever you don't want to collect, E.G. setting it to 3, and putting cobble,gravel,dirt in first 3 slots so as to not collect them, instead they are dropped onto the ground
- After a reset/fresh install of the program, it will no longer ask to send data to the server if the turtle has no modem
- 10/07/2013: fixed turtle tree program destroying saplings when leaf block above it hence blocking movement
- Mining program hangs at random positions occasionally, unknown as to the cause, would fix if i knew the cause
- Rewrite of mining program to use path of least fuel usage and also having automated refuel from the coal it mines
- multi-layer mining
This program has been a long running project, started when Feed The Beast first came out, and has been changing ever since.
The turtle program contains 6 sub programs with an easy to use GUI to navigate and quickly get information for the task the turtle is doing.
Since the initial program was made, it has gone through 3 complete rewrites to make it easier to use, and to natively support the new features I had been learning about in relation to ComputerCraft and LUA.
The program from my reckoning is complete as far as i am concerned with features, and it has been extensively bug tested, I hand out mining turtles to people on the Mindcrack server I play on.
Furthermore, When i wrote the third iteration, I designed it to be modular, and adaptable so that new programs can be added with ease without interfering with other programs. Feel free to go through my code, and adapt and or add new sub programs to it, same with the GUI, its entirely copy and paste-able with minimal changes being needed. Just please do give credit if you decide to use as I have been working on this for months. Thanks
Pastebin Links
Note: where there is <program name>, that means you can write anything there
Main Turtle Program
pastebin get zzTafMvn <program name>
Server
pastebin get 7k6ea0gh <program name>
If you need more help setting up the server please say so
Usage
After downloading the main turtle program onto the turtle, you will need to provide fuel for the turtle, simply run the main turtle program you downloaded, and run the program called refuel
Steps for mining turtle
- Type in "pastebin get zzTafMvn <program name>" into the turtle where <program name> is whatever you wish, this is the main program
- Type the name that you saved the main program as into the window
- Run the sub-program "refuel" and follow the on-screen prompts
- Since this will be your first time running it, if the turtle is a wireless turtle, it will prompt you to send data to the server
- If you say yes to this prompt, please Follow Steps for server first to get needed information
- Enter the ID you got from the server so that it knows to send only to your server computer
- This means you can send realtime data to a server to be displayed on a screen
- Since the turtle won't have a name/label associated with it, the program will prompt you to assign a name
- This can be anything you wish, you can name your turtle anything Example, you can call your turtle "Steve"
- The main program page will then show up with a list of all existing programs
- Type in one of the displayed programs to run, then follow the GUI prompts to set the options
- If it asks you a direct question which requires a yes or no answer, inputting either yes,y,no,n is acceptable
- Type in "pastebin get 7k6ea0gh <program name>" into the computer where <program name> is whatever you wish, this is the server
- Ensure that there are at least 2 high and 3 wide rectangle of monitors above the computer, whilst touching it
- Generally 3 high,5 wide is a good size for that program
- Ensure there is a Wireless Modem attached to the bottom face of the server computer
- Type the following into the server computer where <program name> is the name that you saved the server program as
- monitor top <program name>
- The ID of the server computer will print to the screen, you will need to know that ID when setting up the Wireless Mining Turtles
- Then refer to Steps for mining turtle
Main
- All the programs support uploading all their information to a server which the program I have created, which prints information related to the program running, and supports many turtles, I have tested up to 8 running simultaneously
- All the programs save their data into a cfg. So in the case of the tree chopper, it will keep track of wood cut, trees cut, etc
- Optional Tree Size 1x1 or 2x2
- Optional to use bonemeal or natural tree growth
- Selection, Either it can use vanilla chests, or the barrels from the Feed the Beast Modpack
- Can Pause the program and wait for a redstone signal - this is configurable so that a redstone signal can either make the turtle go or pause, allowing to say log off or leave the chunks without breaking the program. IMPORTANT — Redstone Signal MUST come from underneath where the turtle returns, as its set to check Down.
- Runs Indefinately as long as
- The turtle has enough fuel remaining or the chest above it has fuel still
- If the bonemeal option is enabled, then if there is bonemeal still there
- That there are saplings remaining in the chest behind it
- Tests I have done on the program before have yielded 1500 stacks of Fir wood logs, the giant 2x2 trees on Mindcrack - FTB without any intervention from myself from a few hours of leaving it chopping
- Supports Variable Tree Height
- Intelligently Manages it's inventory so that Items don't get mixed up in different slots
- Has not bugged so far with many weeks of running
- Returns to the starting location after every row to dump items into a chest that is placed directly behind its starting position
- Can either mine its current layer (the layer its on) or 3 layers (the layer above it, the layer its on, and the layer below it)
- Variable Length and Width, (Unless you have a large amount of chunks loaded, don't use 100x100 or else the turtle unloads)
- Can Place torches beneath it as it goes along, with 7 block spacing between them
- Outputs to the Server if setup
- Is able to drop up to any 8 items, when set, place the items in the initial slots up to how many you set to drop
- Can set the amount of stacks of wheat to farm using bonemeal
- Draws bonemeal from above it, and deposits wheat and excess seeds in a chest to its right
- Checks every slot in the turtles inventory for usable fuel
- Refuels as much as possible from what is provided
- Once run, will automatically update the program to the latest version
- Once run, will automatically reset all data
Images
Spoiler
Apologies for the images being links, I tried the BBcode image tag and it wouldn't let meTurtle Setup - Tree Program - Chests
http://db.tt/8HdA8YZ3
Turtle Setup - Tree Program - Barrels
http://db.tt/2Aywix14
Turtle - Miner at Work
http://db.tt/oZJFQjQP
Turtle - Main Program Interface
http://db.tt/4KK1TRxo
Turtle - Tree program Options
http://db.tt/NwilaK4t
Tree Program Options Filled Out
http://db.tt/svS4iVw3
Turtle Server That Prints Information
http://db.tt/YEn3vEYP