Advertisement
Raphsod

Instruction_Receiver

Dec 5th, 2022 (edited)
1,174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | Gaming | 0 0
  1. --//Setup the mothem, placed at the bottom
  2. channel = 2209
  3. modem = peripheral.wrap("bottom")
  4. modem.open(channel)
  5.  
  6. --//Tests modem/channel connection
  7. if modem.isOpen(channel) then
  8.     print("Modem was succesfully open in the selected channel.")
  9. end
  10.  
  11. --//Awaits for an instruction an then excecutes with what is in "message"
  12. while true do
  13.     event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  14.     shell.run(message)
  15. print(message)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement