summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shop.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/shop.lua b/shop.lua
index ad6e425..ecd0d0f 100644
--- a/shop.lua
+++ b/shop.lua
@@ -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")