Operating system for OpenComputers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
330B

  1. local minitel = require "minitel"
  2. local tA = {...}
  3. host, port = tA[1], tA[2]
  4. local socket = minitel.open(host,port)
  5. if not socket then return false end
  6. local b = ""
  7. repeat
  8. io.write(socket:read("*a"))
  9. coroutine.yield()
  10. b = io.read(nil,true) or ""
  11. if b:len() > 0 then
  12. socket:write(b.."\n")
  13. end
  14. until socket.state ~= "open"