Advertisement
TechManDylan

Command sender

Jun 20th, 2023 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. rednet.open("top")
  2. rednet.channel = 1
  3.  
  4. while true do
  5. print("Enter 'on' or 'off':")
  6. local userInput = read()
  7.  
  8. if userInput == "on" then
  9. rednet.broadcast("on", "1")
  10. elseif userInput == "off" then
  11. rednet.broadcast("off", "1")
  12. else
  13. print("Invalid input. Only 'on' or 'off' are allowed.")
  14. end
  15. end
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement