Sapish

Library code: GLASS Screen

Jan 15th, 2021 (edited)
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. local modem = peripheral.wrap('top')
  2. modem.open(2)
  3. while true do
  4.     local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent('modem_message')
  5.     if message == 'on' then
  6.         redstone.setOutput('bottom',true)
  7.         modem.transmit(replyChannel, 2, 'turned on')
  8.     elseif message == 'off' then
  9.         redstone.setOutput('bottom',false)
  10.         modem.transmit(replyChannel, 2, 'turned off')
  11.     else
  12.         modem.transmit(replyChannel, 2, 'invalid message')
  13.     end
  14. end
  15.    
  16.    
Add Comment
Please, Sign In to add comment