Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local e = require("event")
- local m = component.modem
- function modemMsg(...)
- local args = {...}
- local header = args[6]
- local cmd = args[7]
- local h = args[9]
- local t = args[8]
- local p = args[10]
- local j = 1
- if header == "nanomachines" then
- if cmd == "input" then
- if h ~= nil then
- e.push("msg_recieved", h, j)
- end
- elseif cmd == "totalInputCount" then
- inputCount = t
- inputs = inputCount
- e.push("updated_inputs", inputs)
- elseif cmd == "port" then
- elseif cmd == "effects" then
- if t ~= "{}" then
- s = string.gsub(t, "}", "")
- s = string.gsub(s, "{", "")
- print(s)
- s = {s, j}
- j = j + 1
- table.insert(inList, s)
- print("Effects Updated")
- e.push("effects_updated", inList)
- else
- print("Effects Updated")
- e.push("effects_updated", inList)
- end
- else
- print(cmd)
- end
- end
- end
- function eTable(...)
- local args = {...}
- _, inList = args
- end
- e.listen("modem_message", modemMsg)
- e.listen("effects_table", eTable)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement