summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shop.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/shop.lua b/shop.lua
index 1ded4f6..a15f07f 100644
--- a/shop.lua
+++ b/shop.lua
@@ -1,4 +1,5 @@
-sres =textutils.unserializeJSON( http.post("https://krist.dev/ws/start","").readAll())
+key=assert(settings.get"krist.pkey","please set private key")
+sres =textutils.unserializeJSON( http.post("https://krist.dev/ws/start","privatekey="..key).readAll())
assert(sres.ok,"not ok")
ws = assert(http.websocket(sres.url))
@@ -9,12 +10,10 @@ function sendws(t)
nextid = nextid + 1
return ws.send(textutils.serializeJSON(t))
end
-sendws { type="get_subscription_level" }
while true do
msgtxt = assert(ws.receive(),"ws error")
msg = textutils.unserializeJSON(msgtxt)
- print(msg.type)
if msg.type ~= "keepalive" then print(msgtxt) end
end