Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
- function connectLoop()
- local ws, err = table.unpack(
- http.websocket(
- "ws://ee76d56f0ea4.ngrok.io",
- {
- ["phone-number"] = os:getComputerID()
- }
- )
- )
- if err then
- print(err)
- return
- else
- while true do
- local ____ = os:pullEvent()
- local event = ____.event
- if event[1] == "websocket_message" then
- local data = event[3]
- if data == nil then
- break
- end
- local message = textutils.unserializeJSON(data)
- print(data)
- end
- end
- end
- end
- while true do
- term.clear(colors.black)
- pcall(connectLoop)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement