Skip to content

Instantly share code, notes, and snippets.

@MrJake222
Created February 7, 2021 21:46
Show Gist options
  • Save MrJake222/30a3bc57a2a3657d8682bbd858e024c0 to your computer and use it in GitHub Desktop.
Save MrJake222/30a3bc57a2a3657d8682bbd858e024c0 to your computer and use it in GitHub Desktop.
Simple counter program for AUNIS Beamers
local event = require("event")
local counts = {}
while true do
_, _, _, tab = event.pull("beamer_transfers")
for k,v in pairs(tab) do
if counts[k] == nil then counts[k] = 0 end
counts[k] = counts[k] + v
end
for k,v in pairs(counts) do
io.write(k..": "..v..", ")
end
io.write("\n")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment