This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
nekosune's profile picture

Odd Error from program

Started by nekosune, 25 June 2013 - 05:29 PM
nekosune #1
Posted 25 June 2013 - 07:29 PM
I am trying to make a program that simply dumps all but the first slot of a chest from one chest into another (ender chest) to do this I used an Misc Peripherals Inventory Module Chest Turtle.
I used the following code:

inv=peripheral.wrap("left")
chest=peripheral.wrap("right")
function onLoad(s,e)
  for i=s,e do
	inv.suck(i)
  end
end
function offLoad(page)
  chest.setPage(page)
  chest.swapRange(1,16)
  for i=1,16 do
	turtle.drop(i)
  end
end
while true do
   chest.setPage(1)
   onLoad(2,16)
   chest.swapRange(1,16)
   chest.setPage(2)
   onLoad(17,27)
   chest.swapRange(1,16)
   turtle.turnRight()
   offLoad(1)
   offLoad(2)
   turtle.turnLeft()
   sleep(10)
end


But all I get when I try it is
startup:19: 16
Lyqyd #2
Posted 26 June 2013 - 01:36 AM
Split into new topic.
Zudo #3
Posted 26 June 2013 - 02:39 AM
Erm…
startup:19: 16
is not an error…
Lyqyd #4
Posted 26 June 2013 - 03:16 AM
Sure it is. It's error text of "16" being thrown by the java function that line 19 is calling. Looks like a misuse of MiscPeripherals or a bug in MiscPeripherals.
nekosune #5
Posted 26 June 2013 - 06:26 AM
Sure it is. It's error text of "16" being thrown by the java function that line 19 is calling. Looks like a misuse of MiscPeripherals or a bug in MiscPeripherals.
Thankyou, I discovered the problem in the end, I was trying to call page 2 on a chest turtle that apparently only had one page, I got that rather unhelpful error when I tried that. I apologise for the trouble