Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local side = "back"
- local bundle = {}
- local instaUpdate = false;
- function init(s)
- side = s
- rs.setBundledOutput(side, 0)
- end
- function add(id, col)
- bundle[id] = {}
- bundle[id]["col"] = col
- bundle[id]["on"] = false
- end
- function setInstantUpdate(b)
- instaUpdate = b
- end
- function set(id, b)
- bundle[id]["on"] = b
- if instaUpdate then
- update()
- end
- end
- function get(id)
- return bundle[id]["on"]
- end
- function update()
- val = 0
- for id, data in pairs(bundle) do
- if data["on"] then
- val = val + data["col"]
- end
- end
- rs.setBundledOutput(side, val)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement