batubozkan

Modem Transmit

Nov 25th, 2020 (edited)
412
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. io.write("Set new defaults? ")
  4. default = io.read()
  5. if(default == "yes") then
  6.     term.clear()
  7.     term.setCursorPos(1,1)
  8.     io.write("Modem side: ")
  9.     side = io.read()
  10.     term.clear()
  11.     term.setCursorPos(1,1)
  12.     io.write("Modem Port: ")
  13.     data = io.read()
  14.     port = tonumber(data)
  15.     term.clear()
  16.     term.setCursorPos(1,1)
  17.     io.write("Reply Port: ")
  18.     data = io.read()
  19.     reply = tonumber(data)
  20. else
  21.     side = "back"
  22.     port = 3
  23.     reply = 1
  24. end
  25.  
  26. term.clear()
  27. term.setCursorPos(1,1)
  28. io.write("Desired Function: ")
  29. command = io.read()
  30.  
  31. local modem = peripheral.wrap(side)
  32. modem.transmit(port, reply, command)
RAW Paste Data