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

[Solved] Peripherals Blocking Code

Started by ld624188, 06 February 2014 - 02:32 PM
ld624188 #1
Posted 06 February 2014 - 03:32 PM
I was look though forms and things what not to fix this code, I was programming a turtle, and I took the code from a pastebing, and some of the code does not work because of the new update with Peripherals. here is the code (this is only part of the program) here is the whole thing http://pastebin.com/zSu3xM53. But this section of the code doesn't work


function checkSlots(id)
   clearInv()
   data = {}
   local slot
   local name
   local slots = p.getAllStacks()
   for i,j in pairs(slots) do
	  slot = i
	  name = j["destination"]
--	  print(name)
	  data[slot]=name
   end
   rednet.send(id,"done")
end

The problem is within the 6th line "local slots = p.getAllStacks()" I know this because when the program run it returns books:17: attempt to call nil

So I found it was a problem because in the new Peripherals has a bug with that command, but over all can someone please help me fix this problem I tried many things and couldn't fix it, also I need everything to work as it is, but i need a different command for the 6th line, please help thanks.



[FIX]
I saw some other people who had this problem and what you need to do it go to this website http://www.openperipheral.info/ and download OpenPeripheralCore and OpenModLib, and put them in the mods folder in you mincraft root folder. What this allows you to do is have extra computercraft commands.
Edited on 06 February 2014 - 03:42 PM
Bomb Bloke #2
Posted 06 February 2014 - 06:28 PM
So you're saying you got it to work with the most recent releases? Good to know. :)/>
theoriginalbit #3
Posted 06 February 2014 - 06:30 PM
So you're saying you got it to work with the most recent releases? Good to know. :)/>
OP is saying that they got it to work by actually installing the mod that adds it. haha.