Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- pastebin get vjGicSAk split_receive.lua
- ]]
- -- Ensure Rednet is open
- peripheral.find("modem", rednet.open)
- print("Listening for commands on the 'split' protocol...")
- while true do
- local senderId, message, protocol = rednet.receive("split")
- print("Received command from ID " .. senderId .. ": " .. message)
- -- Execute the received command
- local success, err = pcall(function()
- shell.run(message)
- end)
- if not success then
- print("Error executing command: " .. err)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment