Posted 27 December 2012 - 01:59 PM
hello,
today I made my first program, it's a program to stripmine :)/>
If you have any questions, remarks or improvements I could do, please tell them so this noob can learn :)/>
today I made my first program, it's a program to stripmine :)/>
local times = 0
local j = 0
function Mine()
while turtle.detect() == true do
turtle.dig()
sleep(0.50)
end
turtle.forward()
sleep(0.50)
while turtle.detectUp() == true do
turtle.digUp()
sleep(0.50)
end
turtle.digDown()
end
function Place(SlotNum)
turtle.select(SlotNum)
turtle.back()
turtle.placeUp()
turtle.forward()
end
term.write("How long? ")
times = read()
function Digger()
for i=1, times do
j = j+1
Mine()
if j == 7 then
Place(16)
j = 0
end
end
end
function MoveLeft()
turtle.turnLeft()
Mine()
Mine()
Mine()
turtle.turnLeft()
end
function MoveRight()
turtle.turnRight()
Mine()
Mine()
Mine()
turtle.turnRight()
end
term.write("How many double shafts? ")
duration = read()
for i=1, duration do
Digger()
MoveLeft()
Digger()
MoveRight()
end
If you have any questions, remarks or improvements I could do, please tell them so this noob can learn :)/>