Advertisement
Alexr360

Bastion Remote Force

Mar 24th, 2024
665
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function clearScreen()
  2.   term.clear()
  3.   term.setCursorPos(1, 1)
  4. end
  5.  
  6. local modem = peripheral.find("modem") or error("No modem attached", 0)
  7. modem.open(43) -- Open 43 so we can receive replies
  8.  
  9. -- Send our message
  10. print("Enter your message:")
  11. local userMessage = read()
  12. modem.transmit(15, 43, userMessage)
  13.  
  14. -- And wait for a reply
  15. local event, side, channel, replyChannel, message, distance
  16. repeat
  17.   event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
  18. until channel == 43
  19.  
  20. clearScreen()
  21.  
  22. print(tostring(message))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement