First post here, so I'm a little excited..
Okay, this is a VERY simple and basic mining program. It can't go wrong :P/>
http://pastebin.com/9WuGM99n
Code:
Spoiler
local times = ""local min = 500
local Level = turtle.getFuelLevel()
local FuelNeeded
sleep (1)
print ("Turtle will mine 1 block in front, and one to its left. Please use Ctrl+t to terminate and move the turtle")
sleep (2)
print ("Mining turtle wants to dig a 2x2 tunnel. Agree? 1 = Ok, 2 = No")
local input = read()
if input == "1" then
print ("Starting the program…")
sleep (1)
print ("How long do you wish to tunnel?")
times = read()
FuelNeeded = times*4+1
print ("Fuel needed to dig is "..FuelNeeded)
if turtle.getFuelLevel() < FuelNeeded then
print ("Fuel level is: "..turtle.getFuelLevel())
print ("Turtle is low on fuel. Do you wish to refuel? y/n")
local event, param1 = os.pullEvent("char")
if param1 == "y" then
turtle.select(1)
turtle.refuel()
else
print ("!Too low fuel for program to initiate!")
print ("Turtle rebooting!")
sleep (2)
os.reboot()
end
end
for i = 1, times do
turtle.dig()
while turtle.detect() do
turtle.dig()
end
while not turtle.forward() do
turtle.dig()
end
turtle.digUp()
while turtle.detectUp() do
turtle.digUp()
end
turtle.turnLeft()
turtle.dig()
while turtle.detect() do
turtle.dig()
end
turtle.turnRight()
while not turtle.up() do
turtle.digUp()
end
turtle.turnLeft()
turtle.dig()
while turtle.detect() do
turtle.dig()
end
turtle.turnRight()
turtle.down()
end
times = times+1
turtle.turnLeft()
turtle.turnLeft()
for i = 1, times do
while not turtle.forward() do
sleep (1)
end
end
end
turtle.turnLeft()
turtle.turnLeft()
Basic idea is: You start the program :P/>
Next you agree to start
Then you enter how long it will tunnel
After that, you put fuel in if required
Best part is that it will return to its starting position once it's done mining.
Will also handle sand and gravel very nicely ;)/>
Again, very simple program.
How to get it:
* Make your mining turtle, and place it wherever you want to mine
* Open up the interface
* Type "pastebin get 9WuGM99n Dig" <—- this can be any name you want
* Press Enter
* Run the program, and enjoy the simple mining
I highly reccomend for everyone to install a chunk loader module if possible, as it's easy for the turtle to wonder off from the loaded chunks. It WILL stop, so be sure to either follow the turtle or to get a chunk loader on it ;)/>
Anyway, have fun with this thing
-MyMusicManager
Changelog
Spoiler
V.0.2.1 - Shortened code by about 60 lines(!)——————————————
V.0.2.0 - Major update! Will now have the option to drop all items into either pre-placed chest, or place one down when done mining. Thanks A LOT to UNOBTANIUM for helping me with my code. You're awsome, dude! :)/>
——————————————
v.0.1.6 - Will now build a bridge if no blocks below it. Will also always display current fuel
——————————————
v.0.1.5.1 - I forgot like 1 line of code :P/> Derp
——————————————-
v.0.1.5 - Tiny update with small improvements. Still a lot to do
——————————————-
v.0.1.4 - Woah, this is moving fast. Will now show how much fuel is needed based on the length you wish to tunnel
——————————————-
v.0.1.3 - More tweaks towards refueling. Bugs have been killed
——————————————-
v.0.1.2 - Minor tweaks, added handling for gravel and sand
——————————————-
v.0.1 - First release
Thanks A LOT to UNOBTANIUM for helping me so much with this code :)/>
WOA! 500 views in under a week? You guyes are awsome!