Advertisement
DOGGYWOOF

server 2

Jan 7th, 2024
3
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. rednet.open("top") -- Open the modem on the top side
  2.  
  3. local serverId = os.getComputerID() -- Get the server's ID
  4.  
  5. print("Server ID: " .. serverId) -- Display the server's ID
  6.  
  7. while true do
  8. local senderId, message, protocol = rednet.receive() -- Listen for incoming messages
  9. if protocol == "control_protocol" then -- Replace "control_protocol" with your desired protocol name
  10. -- Execute commands based on the message received
  11. if message == "shutdown" then
  12. os.shutdown()
  13. elseif message == "reboot" then
  14. os.reboot()
  15. -- Add more commands here
  16. end
  17. end
  18. end
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement