Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("/api/tbl.lua")
- local cx,cy = term.getCursorPos()
- term.setCursorPos(cx,cy)
- term.write("00.00%")
- local periphs = peripheral.getNames()
- local chests = {}
- local fullChests = {}
- local chest_perifs = {}
- for i,p_id in ipairs(periphs) do
- local p = peripheral.wrap(p_id)
- if peripheral.hasType(p,"inventory") then
- if p.size() == 54 then
- chest_perifs[#chest_perifs+1] = p
- end
- if #p.list() == 54 then
- fullChests[#fullChests+1] = p_id
- end
- end
- end
- for i,p in ipairs(chest_perifs) do
- for slot=1,54 do
- local data = p.getItemDetail(slot)
- if data then
- data["inventory"] = peripheral.getName(p)
- data["slot"] = slot
- local small_data = {
- ["name"] = data["name"],
- ["count"] = data["count"],
- ["maxCount"] = data["maxCount"],
- ["displayName"] = data["displayName"],
- ["inventory"] = data["inventory"],
- ["slot"] = data["slot"] }
- chests[#chests+1] = small_data
- end
- term.setCursorPos(cx,cy)
- term.write(math.floor((((i*54)+slot)/((#chest_perifs+1)*54))*10000)/100,"%")
- end
- end
- term.setCursorPos(cx,cy)
- term.write("scan complete")
- print("")
- tbl.save(fullChests,"insertionBlacklist.dat")
- tbl.save(chests,"chestData.dat")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement