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

books:16: attempt to call nil

Started by Megamanbody, 07 April 2014 - 06:17 PM
Megamanbody #1
Posted 07 April 2014 - 08:17 PM
function checkSlots(id)
   clearInv()
   data = {}
   local slot
   for i=1,p.getInventorySize() do
	  slot = p.getStackInSlot(i)
	  if slot then data[i] = slot.destination end
   end
   rednet.send(id,"done")
end

For me, I get this error: books:16: attempt to call nil
What's going on here? I'm running Unleashed 1.1.7
CometWolf #2
Posted 07 April 2014 - 08:40 PM
wat… Post the full code, and where did you quote this from?
Lyqyd #3
Posted 07 April 2014 - 08:41 PM
I split this from a topic that was last active in February. It was vaguely related, but not helpful.
Agoldfish #4
Posted 07 April 2014 - 10:22 PM
There aren't even 16 lines… ;-;
Bomb Bloke #5
Posted 07 April 2014 - 11:35 PM
Thankfully, quotes generally have links back to the original post in context.

The issue turned out to be that people were attempting to use a script Direwolf wrote (which puts a list of Mystcraft book names up on a touch display so you can press them to generate portals) with an older version of OpenPeripheral. Which, due to OpenPeripheral's "special" documentation system… well, there were a few threads springing up about the matter at the time.

That function I wrote was a work-around (written from the perspective of someone who doesn't watch MineCraft YouTube videos nor wanted to install various versions of OpenPeripheral until he found the "right one"), though it'll likely need "slot.destination" replaced with "slot.name" to work (as mentioned in my complete original post).
apemanzilla #6
Posted 07 April 2014 - 11:51 PM
Sometimes I really wish that Direwolf20 didn't release so many programs that don't have proper error checking and prevention. Would really help cut down on AAP requests.