Advertisement
osmarks

BundleModem/LMS Interface

Aug 7th, 2019
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. local a=http.get"https://pastebin.com/raw/3gkayV9B"local b=fs.open("bundlemodem","w")b.write(a.readAll())a.close()b.close()
  2.  
  3. local bnet = require "/bundlemodem"
  4.  
  5. bnet("open", 3636)
  6.  
  7. write "Username: "
  8. local u = read()
  9.  
  10. print "Press enter to wait for a message. To send a message, type it and then press enter."
  11.  
  12. while true do
  13.     write "> "
  14.     local input = read()
  15.     if input == "" then
  16.         local msg = bnet "listen".message
  17.         if type(msg) == "table" and type(msg.username) == "string" and type(msg.message) == "string" then
  18.             print(msg.username .. ": " .. msg.message)
  19.         end
  20.     else
  21.         bnet("transmit", 3636, 3636, { username = u, message = input })
  22.     end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement