Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------ PARAMS ------
- TABLE_SIDE = 'top'
- MODEM_SIDE = 'left'
- function check(periph)
- return periph.isActive()
- end
- ------- END --------
- function main()
- rednet.open(MODEM_SIDE)
- rednet.host('switch_check','checker')
- periph = peripheral.wrap(TABLE_SIDE)
- while true do
- evt,snd,mess = os.pullEvent('rednet_message')
- if(type(mess) == 'string') then
- mess = textutils.unserialize(mess)
- end
- if(mess.type == 'check') then
- rednet.send(snd, { type='status', status = check(periph) } )
- end
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement