dveth

server

Nov 27th, 2020 (edited)
803
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local SERVER_PORT = 56
  2.  
  3. local args = {...}
  4.  
  5. if #args == 0 then
  6.     print("Usage: server <command> <params>")
  7.     error()
  8. end
  9.  
  10. local command = args[1]
  11. local param1 = args[2]
  12. local param2 = args[3]
  13.  
  14. local msg = command.." "..param1.." "..param2
  15.  
  16. local modem = peripheral.wrap("back")
  17. print("Sending: "..msg)
  18. modem.transmit(56, 1, msg)
  19. print("Disconnecting...")
  20.  
  21.  
RAW Paste Data