I'm currently trying to learn all that luaf and CC stuff and therefor i'm trying to create a small program and expand it.
I have done that with AE2 ME and i'm trying to extract items with CC.
Before the latest update everything works fine.
Spoiler
me = peripheral.wrap("bottom")
list = me.getAvailableItems()
for number, item in pairs(list) do
if item.id == "minecraft:planks" then
me.exportItem(list[number], 1, 0)
print("Exported")
end
end
This was my old code. It was relativly easy after i understood the openp/docs about "exportItems"
After the latest update it broke my code. The item tables changed in a way i do not yet understand.
This was the old table of items inside the ME.
Spoiler
1:
dmg: 0
display_name: Mana Bean
raw_name: item.itemmanabean
qty: 0
ench:
max_size: 64
name: ItemManaBean
ore_dict:
nbt_id: 4b6ccebf85c96dde4d085c3c4f064878
max_dmg: 0
id: Thaumcraft:ItemManaBean
mod_id: Thaumcraft
is_craftable: true
2:
display_name: Mana Bean
qty: 59
dmg: 0
max_dmg: 0
raw_name: item.itemmanabean
name: ItemManaBean
id: Thaumcraft:ItemManaBean
ench:
ore_dict:
nbt_id: a48486be825d662a858a1c09ad41a858
max_size: 64
mod_id: Thaumcraft
3:
display_name: Mana Bean
qty: 59
dmg: 0
max_dmg: 0
raw_name: item.itemmanabean
name: ItemManaBean
id: Thaumcraft:ItemManaBean
ench:
ore_dict:
nbt_id: d458a442d7760e5e40c17efc5d7fc9e2
max_size: 64
mod_id: Thaumcraft
This is the new table layout
Spoiler
1:
is_fluid: false
is_item: true
size: 59
fingerprint:
id: Thaumcraft:ItemManaBean
dmg: 0
nbt_hash: 6d1c371dc8953ab3b349d038149fbabf
is_craftable: true
2:
is_fluid: false
is_item: true
size: 59
fingerprint:
id: Thaumcraft:ItemManaBean
dmg: 0
nbt_hash: ad5cc1bd74d2230c5c483e4c1bbc7948
is_craftable: false
3:
is_fluid: false
is_item: true
size: 59
fingerprint:
id: Thaumcraft:ItemManaBean
dmg: 0
nbt_hash: 18add493aeeb97a3fe71cf8130fe8675
is_craftable: false
If i now try to print the "nbt_hash" it just prints some empty lines.
I think this is because it uses tables inside of tables if i understand the layout the right way.
I'm new to lua and even newer to all that table stuff. I'm happy enough i know that tables exist.. :D/>
With the old table layout i just had to run this code to print everything:
me = peripheral.wrap("bottom")
liste = me.getAvailableItems()
for nummer, item in pairs(liste) do
print(item.id.." "..item.dmg.." "..item.qty.." "..item.nbt_id)
end
But how do i print for example the nbt_hash from the new layout?
How do i use my code to request items with a given nbt_hash?
Sorry for my bad english, i hope its not to hard to understand.