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

[Lua] New turtle program

Started by LuffyNL, 07 July 2012 - 09:41 PM
LuffyNL #1
Posted 07 July 2012 - 11:41 PM
Hey everyone,

I started with computercraft yesterday with a minimum knowledge about coding.
I followed some tutorials and experimented alot and managed to make some cool things.
Right now, i am trying to make a new turtle program but i have no idea how to start so if anyone could explain me the basics that would be great :3

The program itself is 80% just a list of commands it should run.

1. tunnel 15
2. go back to original location
3. turn left
4. tunnel 65
5. Turn around and go back to the start of the latest dug tunnel.
6. Turn left and walk 3 block
7. Repeat 3 4 5 and 6, 4 times
8. Go back to original location.

If this all worked correctly the turtle should have made a 15 x 3 x 2 area first
Then he makes 5 3 x 64 x 2 tunnels in the left wall of the 15 x 3 x 2 area.
Creating a 67 x 15 x 2 room in the end

Also, i dont know if this is possible but after every tunnel the turtle puts the stuff in a chest, which has to be placed right behind the orginal position or something?

If anyone would atleast help me make this i would be so gratefull :)/>/>

Thanks in Advance
KaoS #2
Posted 08 July 2012 - 06:48 AM
you are using programs in your program… not such a great idea, take a look at the API, that is what you should be using in a program
archit #3
Posted 09 July 2012 - 12:03 AM
You should be able to accomplish this, as it is only using mostly exclusively the turtle api. Take a look at http://computercraft.info/wiki/index.php?title=Turtle_(API) as most of these commands will be what you will need.