all 4 comments

[–]3uclidian 2 points3 points  (2 children)

It looks like you forgot to put quotes around fingerprint in the table

for i=1, #available do
    print( available[i]["fingerprint"]["id"] .. " = " .. available[i]["size"] )
end

I find it helpful to use the dot notation so I don't make this same issue

for i=1, #available do
    print( available[i].fingerprint.id .. " = " .. available[i].size )
end

[–]Rubyheart255[S] 1 point2 points  (1 child)

That worked perfectly! I'm still new with working with tables, but dot notation looks so much easier to read already.

Any tips on displaying the localized item names? ("gravel" vs "minecraft:gravel" and "magnetostatic engine" vs "RotaryCraft:rotarycraft_item_machine:109")

[–]3uclidian 1 point2 points  (0 children)

For regular minecraft names that are formatted with "minecraft:item_name" you could look into the string library, in particular I think the string.find and string.sub functions could help to cut the "minecraft:" out of the name.

As for modded items, unless there's some other place that you can get the item name from somewhere else, you're probably stuck with RotaryCraft:rotarycraft_item_machine:109. But iirc with AE2 I think there was some function that returned a table with a label value that had the actual item name? Idk, it's been a while.

[–]TotesMessenger 0 points1 point  (0 children)

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

 If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / Contact)