feline-dis

server

Apr 13th, 2022 (edited)
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. local CHANNEL = 0
  2. local HOST_NAME = 'MamaBear'
  3. local PROTOCOL = 'MINE'
  4.  
  5. function clearTerminal()
  6. term.clear()
  7. term.setCursorPos(1, 1)
  8. end
  9.  
  10. function initRednetConnection()
  11. rednet.open("back", CHANNEL);
  12.  
  13. rednet.host(HOST_NAME, PROTOCOL)
  14. end
  15.  
  16. function main()
  17. clearTerminal()
  18. initRednetConnection()
  19.  
  20. print('')
  21. print("Command...")
  22.  
  23. while true do
  24. local input = read()
  25.  
  26. rednet.broadcast(input, 'MINE')
  27. end
  28. end
  29.  
  30. main()
  31.  
Add Comment
Please, Sign In to add comment