So I've got some really newb code going on here and cant seem to find out what the second array is. It's sometimes filled with 4 "true" and other times more. What is the array at pos[2] contain?
The easiest way to figure out what something returns in to play around with it in the Lua REPL prompt. But I believe that inventory.getItemDetail returns stuff simular to what turtle.getItemDetail does.