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

PIM Help

Started by XeroTR, 02 August 2017 - 04:41 AM
XeroTR #1
Posted 02 August 2017 - 06:41 AM
Resolved, Please delete/ignore
Edited on 02 August 2017 - 08:29 PM
Bomb Bloke #2
Posted 02 August 2017 - 07:27 AM
Odds are you're calling a function which returns nil, and then trying to index into that result as if it were a table. You probably want to do something like this:

local inv = pim.inventoryGetterFunctionThingy()

if inv then
  -- Sift through the inv table and do stuff.
  .
  .
  .

Of course, it's difficult to be specific about the problem without seeing your code or the actual error it throws.
XeroTR #3
Posted 02 August 2017 - 06:26 PM
Odds are you're calling a function which returns nil, and then trying to index into that result as if it were a table. You probably want to do something like this:

local inv = pim.inventoryGetterFunctionThingy()

if inv then
  -- Sift through the inv table and do stuff.
  .
  .
  .

Of course, it's difficult to be specific about the problem without seeing your code or the actual error it throws.

ok, I'll edit the main thread with it.
XeroTR #4
Posted 02 August 2017 - 10:28 PM
Ok, This has been resolved, I'm just stupid and found the really easy answer.
The Crazy Phoenix #5
Posted 03 August 2017 - 10:22 AM
Ok, This has been resolved, I'm just stupid and found the really easy answer.

It's best to leave the original post and add a reply describing the solution in case anyone else has the same issue and comes across this thread.