diff options
-rw-r--r-- | shop.lua | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -2,6 +2,14 @@ sres =textutils.unserializeJSON( http.post("https://krist.dev/ws/start","").read assert(sres.ok,"not ok") ws = assert(http.websocket(sres.url)) +nextid = 0 + +function sendws(t) + t.id = nextid + nextid = nextid + 1 + return ws.send(textutils.serializeJSON(t)) end +end +sendws { type="get_subscription_level" } while true do msgtxt = assert(ws.receive(),"ws error") |