diff options
author | ubq323 <ubq323@ubq323.website> | 2022-12-29 20:44:49 +0000 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2022-12-29 20:44:49 +0000 |
commit | 039e0ef2f42a1e5573c608d0fe82185b00d8ad14 (patch) | |
tree | ae8ef1b8eda912d0d34ff53bc2c6a9f7240b1e6e | |
parent | ee7f672ce192be126c02248415aae320dd3f0532 (diff) |
shop
-rw-r--r-- | shop.lua | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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 |