Posted 08 December 2012 - 05:37 PM
to further explain the code, it is supposed to mine all the ores, gems, etc, that the Industrial Craft quarries in Tekkit miss. However, I have already noted some problems.
first, it doesn't work right on corners
second, after a while it prints "178" even though i don't have any print commands in there, and none of the variables should even be able to get up to 178, unless there just so happens to be a 178 block line of dirt underground
third, it won't automatically empty the chest, so you would have to manually
and fourth, it has to start on a layer of complete stone to be able to work, without going kilometers away, but that is acceptable.
anyone have any tips on fixing problems 1 through 3?
EDIT: also, it sometimes alternates between 178 and "bios:15: vm error: java.lang.ArrayIndexOutOfBoundsException: 256" so I changed one line in the code
the edited code is this:
to this:
but there was no change in-game, same errors
first, it doesn't work right on corners
second, after a while it prints "178" even though i don't have any print commands in there, and none of the variables should even be able to get up to 178, unless there just so happens to be a 178 block line of dirt underground
third, it won't automatically empty the chest, so you would have to manually
and fourth, it has to start on a layer of complete stone to be able to work, without going kilometers away, but that is acceptable.
anyone have any tips on fixing problems 1 through 3?
EDIT: also, it sometimes alternates between 178 and "bios:15: vm error: java.lang.ArrayIndexOutOfBoundsException: 256" so I changed one line in the code
Spoiler
i = 0
j = 0
function check()
if turtle.compare() then
turtle.turnRight()
if turtle.compare() then
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
j = j + 1
if j == 4 then
turtle.down()
j = 0
check()
else
check()
end
else
turtle.forward()
turtle.turnLeft()
check()
end
else
mineore()
end
end
function reverse()
while i ~= 0 do
turtle.back()
i = i - 1
reverse()
end
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
check()
end
function mineore()
turtle.dig()
turtle.forward()
i = i + 1
if turtle.compare() then
reverse()
else
mineore()
end
end
check()
Spoiler
if j == 4 then
turtle.down()
j = 0
check()
Spoiler
while j == 4 do
turtle.down()
j = 0
end