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

[Simple][Miner][Turtle]Square Maker

Started by EmTeaKay, 10 April 2012 - 10:45 PM
EmTeaKay #1
Posted 11 April 2012 - 12:45 AM
This is code for a simple "square" I made. It has an option to continue mining upwards, so you don't have to shut it down and then restart.
It doesn't mine the insides though, as this was just seeing what I could do. You can mess with the code and make it your own, if you're going to show it to someone else, please tell them it was made by me. You don't have to tell them it was made by me, I would just prefer it if you did.
Spoiler

-- Made by EmptyK
term.clear()
term.setCursorPos(1,1)
print("You have chosen to mine!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.turnRight(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.turnRight(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.turnRight(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.forward(1)
turtle.dig(1)
turtle.forward(1)
turtle.digUp(1)
turtle.turnRight(1)
sleep(1)
print("Would you like to go up more?")
input = read()
yes = "Yes"
no = "No"
if input == yes then
print("Mining some more!")
sleep(1)
turtle.up(1)
turtle.up(1)
shell.run("Mine")
end
if input == no then
print("Ok, shutting down")
sleep(3)
os.shutdown()
end
EatenAlive3 #2
Posted 11 April 2012 - 01:42 AM
Looks good. Unfortunately, you wasted some typing on all those ones, as the turtle movement and digging functions take no arguments (turtle.forward() works the same as turtle.forward(1), or even turtle.forward(9)). I'd reccomend using functions or loops for things like this. Usually, three for loops can get you pretty far, especially if working with mining and cuboids (one for the X axis, one for Y, one for Z.) Good job :P/>/>