Posted 25 March 2013 - 06:28 AM
Hi Folks !
I've thought i have written a good program for my turtle friends to mine with Mining wells, but after a short time the first turtle throws me a [Error]
bios:140 vm error: java.lang.ArrayIndexOutOfBoundsException: 256
After looking this up in google it seems i have a recursion in my programm, bit i do not find where. perhaps you can help me.
And please dont lough at my Amateur code >.< . Im still in my beginnings.
Programm 1: to receive a message form the Main Computer to start the whole operation
Programm 2: to place the Mining Well wait for time (x) clear the inventory, than dig the MiningWell
Programm 3: to send "i am finish" back to the Main Computer
so these 3 Programs run on my turtles. They do work, but like i said, only for about .. 5-10 minutes , and than it throws the Error.
I hope you guys can help me .
I've thought i have written a good program for my turtle friends to mine with Mining wells, but after a short time the first turtle throws me a [Error]
bios:140 vm error: java.lang.ArrayIndexOutOfBoundsException: 256
After looking this up in google it seems i have a recursion in my programm, bit i do not find where. perhaps you can help me.
And please dont lough at my Amateur code >.< . Im still in my beginnings.
Programm 1: to receive a message form the Main Computer to start the whole operation
rednet.open("right")
senderId, message, distance= rednet.receive()
term.setCursorPos(1,3)
term.write("warte auf nachricht")
if message== "place" then
term.write("habe place erhalten")
shell.run("mining")
end
rednet.close("right")
Programm 2: to place the Mining Well wait for time (x) clear the inventory, than dig the MiningWell
function tPlace()
turtle.select(1)
turtle.place()
end
function cleanInv()
for i=1, 16 do
turtle.select(i)
turtle.dropDown()
end
end
function digWell()
for i=1, 16 do
if turtle.getItemCount(i) ==0 then
turtle.select(1)
turtle.dig()
else
cleanInv()
end
end
end
term.clear()
term.setCursorPos(1,1)
term.write("ich arbeite")
tPlace()
sleep(6,5)
cleanInv()
digWell()
shell.run("fertig")
shell.run("test")
Programm 3: to send "i am finish" back to the Main Computer
rednet.open("right")
rednet.send(47,"01")
term.setCursorPos(1,2)
term.write("habe fertig gesendet")
rednet.close("right")
so these 3 Programs run on my turtles. They do work, but like i said, only for about .. 5-10 minutes , and than it throws the Error.
I hope you guys can help me .