Posted 01 August 2013 - 06:05 AM
Hello,
I'm getting the error "Turtle item count -2 out of range" (on line 18)
This program has been running for hours, without any problems.
Suddenly the turtle stopped after digging down 4 times (so why did the first 4 work, and the 5th time not?!)
And now, every time I want to start up the turtle again, it stops with this error :/
The weird thing is that the error happens at a moment when turtle.refuelLoop() is NOT called.
If required, you can find the full program here: http://pastebin.com/0pSNJqQy
Determined by the position of the turtle, and the actions it has done when the error happens, I think it must have been operating between lines 171 and 180
(since it placed the ender chest from slot 2, but did not put any item in the enderchest).
Again, this turtle has digged over 80 holes already and they all worked fine :S
I'm getting the error "Turtle item count -2 out of range" (on line 18)
This program has been running for hours, without any problems.
Suddenly the turtle stopped after digging down 4 times (so why did the first 4 work, and the 5th time not?!)
And now, every time I want to start up the turtle again, it stops with this error :/
The weird thing is that the error happens at a moment when turtle.refuelLoop() is NOT called.
function turtle.refuelLoop()
refuelComplete = false
while refuelComplete == false do
turtle.select(1)
if turtle.getFuelLevel() < 192 then
if turtle.getItemCount(1) > 2 then <= LINE 18
turtle.refuel(2)
refuelComplete = true
else
cls()
print("Not enough fuel. Minimum amount of coal: 3")
write("Press Enter to retry.")
read()
end
else
refuelComplete = true
end
end
end
getItemCount uses a constant, so how can it become -2?If required, you can find the full program here: http://pastebin.com/0pSNJqQy
Determined by the position of the turtle, and the actions it has done when the error happens, I think it must have been operating between lines 171 and 180
(since it placed the ender chest from slot 2, but did not put any item in the enderchest).
Again, this turtle has digged over 80 holes already and they all worked fine :S