Posted 29 January 2013 - 09:51 PM
ok so, i want to create a turtle that does some mining and as soon as it finds a block of diamonds i want it to hold up with everything its doing and wait for the user to either just remove the block or enter some input to the computer.
I thought i had it but it turns out it doesnt quite do what i want :P/>
I thought i had it but it turns out it doesnt quite do what i want :P/>
--[[Mining Stip Program]]--
--[[Variables]]--
hold=false
--[[Functions]]--
function detectDiamond()
turtle.select(16)
if turtle.compare(true) then
hold=true
elseif turtle.compareDown(true) then
hold=true
else
turtle.select(1)
end
end
function digForward()
while turtle.forward() do
detectDiamond()
turtle.digDown()
end
for i=1, 3 do
detectDiamond()
turtle.dig()
turtle.forward()
detectDiamond()
turtle.digDown()
end
turtle.turnLeft()
for i=1, 5 do
detectDiamond()
turtle.dig()
turtle.forward()
end
for i=1, 5 do
turtle.back()
end
turtle.turnRight()
turtle.turnRight()
for i=1, 5 do
detectDiamond()
turtle.dig()
turtle.forward()
end
for i=1, 5 do
turtle.back()
end
turtle.turnLeft()
end
--[[Execution]]--
while not hold do
digForward()
end