Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ae = peripheral.wrap("back")
- local function getName(name)
- local test = false
- local rep = ""
- for i in string.gmatch(name,'.') do
- if i == '.' then test = true end
- if test then rep = rep .. i end
- end
- return rep
- end
- local function listElement()
- local rep = {}
- for i,j in pairs(ae.listItems()) do
- if j["name"] == 'minechem:minechemElement' then
- table.insert(rep,{["name"]=getName(j['displayName']),["numatom"]=j['meta'],["amount"]=j['amount']})
- end
- end
- return rep
- end
- local function listMolecule()
- local rep = {}
- for i,j in pairs(ae.listItems()) do
- if j["name"] == 'minechem:minechemMolecule' then
- table.insert(rep,{["name"]=getName(j['displayName']),["meta"]=j['meta'],["amount"]=j['amount']})
- end
- end
- return rep
- end
- -- TESTING
- for i in listElement() do
- print(i)
- end
Advertisement
Add Comment
Please, Sign In to add comment