Posted 09 September 2012 - 01:29 AM
When i run my code:
print("How Long Do You Want The Branches?")
length = t
middle = 3
lengthStop = false
local length = read()
local length1 = length
local length2 = length
--print("How Many Branches Do You Want?")
--local branch = read()
while length ~= 0 do
turtle.dig()
sleep(0.4)
if turtle.detect() then
turtle.dig()
else
turtle.forward()
turtle.digUp()
length = length-1
--print(length)
end
end
if length == 0 then
if lengthStop == false then
length = length -1
turtle.turnRight()
turtle.dig()
sleep(0.4)
print(lengthStop)
while middle ~= 0 do
if middle ~= 0 and not turtle.detect() then --Buggy
turtle.forward()
turtle.digUp()
middle = middle - 1
print(middle)
end
while turtle.detect() and middle ~= 0 do
turtle.dig()
sleep(0.4)
end
if middle == 0 and lengthStop == false then
print(length)
lengthStop = true
middle = 3
turtle.forward()
turtle.turnRight()
length = length - 1
end
end
end
end
while length == -2 do
if length2 ~= 0 then
turtle.dig()
sleep(0.4)
if turtle.detect() then
turtle.dig()
else
turtle.forward()
turtle.digUp()
length2 = length2-1
print(length2)
end
end
end
if turtle.detectDown then
turtle.placeDown()
end
if length2 == 0 then
end
It Gives The Mining Turtle The Error: nil: vm error: java.lang.NullPointerException