Posted 05 August 2012 - 03:14 AM
I've created a simple, quick mining program for mining turtles that works really well! It tells the turtle to dig a 1x1 horizontal shaft until no inventory slots are empty. It then turns around, returns to its starting position and drops everything. It is best to place a transposer/obsidian pipe (if you are using Tekkit) one block in front of the turtle and have everything it drops go straight into a chest. After it drops everything, it turns around and continues to dig for x repetitions. The best thing about this code is that it is relatively short, so it is easy to manually write into a turtle/floppy disk if you are playing on a server that does not allow you to place a program file in the game.
To use this code, create a program with the following code:
Then type the name of the program, press enter, and finally type the number of trips you want your turtle to perform. It will get to work digging for you!
Note: I'm not an experienced coder, if there is any way to condense this code let me know! Thanks! :P/>/>
To use this code, create a program with the following code:
function Cycle()
Forward=1
while turtle.getItemCount(1)<1
or turtle.getItemCount(2)<1
or turtle.getItemCount(3)<1
or turtle.getItemCount(4)<1
or turtle.getItemCount(5)<1
or turtle.getItemCount(6)<1
or turtle.getItemCount(7)<1
or turtle.getItemCount(8)<1
or turtle.getItemCount(9)<1 do
turtle.dig()
turtle.forward()
Forward=Forward+1
end
if turtle.getItemCount(1)>=1
and turtle.getItemCount(2)>=1
and turtle.getItemCount(3)>=1
and turtle.getItemCount(4)>=1
and turtle.getItemCount(5)>=1
and turtle.getItemCount(6)>=1
and turtle.getItemCount(7)>=1
and turtle.getItemCount(8)>=1
and turtle.getItemCount(9)>=1
then turtle.turnLeft()
turtle.turnLeft()
end
for i=1,Forward-1 do
turtle.forward()
end
turtle.drop()
turtle.select(2)
turtle.drop()
turtle.select(3)
turtle.drop()
turtle.select(4)
turtle.drop()
turtle.select(5)
turtle.drop()
turtle.select(6)
turtle.drop()
turtle.select(7)
turtle.drop()
turtle.select(8)
turtle.drop()
turtle.select(9)
turtle.drop()
turtle.turnLeft()
turtle.turnLeft()
end
v = io.read()
for j=1,v do
Cycle()
end
Then type the name of the program, press enter, and finally type the number of trips you want your turtle to perform. It will get to work digging for you!
Note: I'm not an experienced coder, if there is any way to condense this code let me know! Thanks! :P/>/>