Bmorr

split_send.lua

May 9th, 2025 (edited)
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. --[[
  2.     pastebin get kwSJWRPs split_send.lua
  3. ]]
  4. -- Ensure Rednet is open
  5. peripheral.find("modem", rednet.open)
  6.  
  7. print("Type commands to broadcast. Type 'cancel' to stop.")
  8.  
  9. while true do
  10.     print("Enter the program or command to run:")
  11.     local command = read()
  12.  
  13.     if command == "cancel" then
  14.         print("Broadcasting canceled.")
  15.         break
  16.     end
  17.  
  18.     -- Broadcast the command to all computers listening on the "split" protocol
  19.     rednet.broadcast(command, "split")
  20.     print("Command broadcasted to all computers listening on the 'split' protocol.")
  21. end
Advertisement
Add Comment
Please, Sign In to add comment