Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local event = require('event')
- local component = require('component')
- local modem = component.modem
- local computer = component.computer
- local port = 1211
- local head = 'nanomachines'
- local tot = 18 --getTotalInputCount
- local msg = nil
- local print = component.chat.say
- modem.open(port)
- modem.broadcast(port, head, 'setResponsePort', port)
- local function get()
- modem.broadcast(port, head, 'getActiveEffects')
- msg = {event.pull('modem_message')}
- if msg[6] == head and msg[7] == 'effects' then
- print(msg[8])
- end
- end
- local function test(n, st)
- modem.broadcast(port, head, 'setInput', n, st)
- msg = {event.pull('modem_message')}
- if msg[6] == head and msg[7] == 'setInput' and msg[8] == n and msg[9] == st then
- print(n, st)
- end
- end
- for i = 1, tot do
- for j = 1, tot do
- if i ~= j then
- test(i, true)
- test(j, true)
- get()
- print('Activated: '.. i ..' and '.. j .. '\n')
- test(i, false)
- test(j, false)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement