Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local arg1 = ...
- local me = peripheral.wrap("left")
- local available = me.getAvailableItems()
- local id = {}
- local meta = {}
- local size = {}
- local table = {["id"]=id,["meta"]=meta,["size"]=size}
- for i,table in pairs(available) do
- for k,item in pairs(table) do
- if(k=="size" or k=="fingerprint") then
- if type(item) == "table" then
- id[i]=item["id"]
- meta[i]=item["dmg"]
- else
- size[i]=item
- end
- end
- end
- end
- shell.run(csv,arg1)
- local file = fs.open("idlist","r")
- local idlist = file.readAll()
- file.close()
- file = fs.open("dictionary","r")
- local dictionary = textutils.unserialise(file.readAll())
- file.close()
- for i=1,#table["id"] do
- local idstring = table["id"][i].."~"..table["meta"][i]
- if string.find(idlist,idstring) then
- print(dictionary[idstring].." x "..table["size"][i])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement