summaryrefslogtreecommitdiff
path: root/shop.lua
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2022-12-29 20:44:49 +0000
committerubq323 <ubq323@ubq323.website>2022-12-29 20:44:49 +0000
commit039e0ef2f42a1e5573c608d0fe82185b00d8ad14 (patch)
treeae8ef1b8eda912d0d34ff53bc2c6a9f7240b1e6e /shop.lua
parentee7f672ce192be126c02248415aae320dd3f0532 (diff)
shop
Diffstat (limited to 'shop.lua')
-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