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

[In progress] Ultimate turtle (everything in one program)

Started by Elzear_Contelly, 16 July 2015 - 09:08 AM
Elzear_Contelly #1
Posted 16 July 2015 - 11:08 AM
CLEVER TURTLE 1.0

This is my program that can do anything, just by defining a path : just create a path on the ground, and the turtle will automatically follow it !
e. g. When the turtle will walk on a block of iron (for exemple), she'll turn right.
[Note : this is an early version, I will update this post in the future when more options will be implemented.]

— INITIALIZATION —
- Get the code -
Simply do "pastebin get EeQLTESi startup" in the turtle. Always credit "Elzear_Contelly" if you want to use it. If you have some issues or bugs with the code, contact me here : elzearcontelly2@gmail.com

- Turtle Inventory -
You need to put blocks in different slots of the turtle :
Slot 13 : Go forward
Slot 14 : Turn right
Slot 15 : Turn left
Slot 16 : Stop
(SOON : suck, dig, drop…)

- Path -
[Note : all blocks need to be underneath the turtle]
At the depart / end position, you need to put a [slot 16] block. At the right of this block (depending on the turtle angle) you need to put a chest (at the right of the turtle, not underneath) with fuel. Note that the turtle will go forward by one block at the activation.
Then, you can edit your path like you want :
Put a [Slot 13] block to go forward, put a [Slot 14] block to turn right (and go forward), etc…
The turtle will refuel automatically when needed.

— USING —
While working, the turtle will create a log containing all informations about the fonctionning.
Make sure the turtle never walk on a block she don't know, or she won't work.
Yarillo #2
Posted 16 July 2015 - 06:42 PM
You can use turtle.inspect() now instead of systematically comparing everything to the turtle's inventory
Lion4ever #3
Posted 21 July 2015 - 07:42 PM
The idea for this is briliant! Instead of hardcording the enviroment of the turtle everytime or specifing a exact setup, you can simlply mark a path with blocks and the turtle can do certain actions then.

This needs to have much more functions.

I would put everything in a table and use functions instead of if-statments.

Blocks above the turtle could be handled too.
Lupus590 #4
Posted 21 July 2015 - 08:44 PM
For ease of use you could have it where your turtle reads the items in the inventory and stores the item names, it can then compare this to the path giving you the turtle inventory and this path thing.
TheNeoGamer #5
Posted 13 August 2015 - 09:32 PM
It Worked REALLY Well Except When You Don't Set It Up And Then Its Stuck In A Loop So You Should Make It A Program You Activate When You Type Something Like: "UltimateTurtle"
Waitdev_ #6
Posted 25 October 2015 - 04:55 AM
awesome idea for a turtle program! i might just point out there is turtle.back(), so that might be useful.
i might make something like this from scratch, but i won't put it on the forums. unless you want me to help you make this better ;)/>