Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top") -- Open the modem on the top side
- local serverId = os.getComputerID() -- Get the server's ID
- print("Server ID: " .. serverId) -- Display the server's ID
- while true do
- local senderId, message, protocol = rednet.receive() -- Listen for incoming messages
- if protocol == "control_protocol" then -- Replace "control_protocol" with your desired protocol name
- -- Execute commands based on the message received
- if message == "shutdown" then
- os.shutdown()
- elseif message == "reboot" then
- os.reboot()
- -- Add more commands here
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement