Operating system for OpenComputers
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

24 Zeilen
448B

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