From 039e0ef2f42a1e5573c608d0fe82185b00d8ad14 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 29 Dec 2022 20:44:49 +0000 Subject: shop --- shop.lua | 5 ++--- 1 file 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 -- cgit v1.2.3