Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local keeplistAPI = dofile("/Stockprg/keeplistAPI.lua")
- local comp = require("component")
- local sides = require("sides")
- local colors = require("colors")
- local rs = comp.redstone
- local bunSide = sides.left -- side where bundled cabel is connected
- -- //local ae = comp.get("2904f916-5266-443d-b392-41eae14f30c")
- local ae = comp.me_interface
- function findUpdated(keepItem)
- local newlist = ae.getAvailableItems()
- for number,item in pairs(newlist) do
- if keepItem["id"] == item.fingerprint.id
- and keepItem["dmg"]== item.fingerprint.dmg
- and keepItem["nbt_hash"] == item.fingerprint.nbt_hash
- then lvlStock(keepItem["keepqty"], item.size, keepItem["color"])
- end
- end
- end
- function lvlStock( kItemQty , aeItemQty , barva)
- if kItemQty <= aeItemQty then rs.setBundledOutput(bunSide,barva,0)
- print("True")
- else rs.setBundledOutput(bunSide,barva,255)
- print("False")
- end
- end
- rs.setBundledOutput(bunSide,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})
- while true do
- for i=1,#keeplistAPI do
- findUpdated(keeplistAPI[i])
- end
- os.sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement