Advertisement
epicbob57

Untitled

Jun 2nd, 2021
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
  2. function connectLoop()
  3. local ws, err = table.unpack(
  4. http.websocket(
  5. "ws://ee76d56f0ea4.ngrok.io",
  6. {
  7. ["phone-number"] = os:getComputerID()
  8. }
  9. )
  10. )
  11. if err then
  12. print(err)
  13. return
  14. else
  15. while true do
  16. local ____ = os:pullEvent()
  17. local event = ____.event
  18. if event[1] == "websocket_message" then
  19. local data = event[3]
  20. if data == nil then
  21. break
  22. end
  23. local message = textutils.unserializeJSON(data)
  24. print(data)
  25. end
  26. end
  27. end
  28. end
  29. while true do
  30. term.clear(colors.black)
  31. pcall(connectLoop)
  32. end
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement