diff options
author | ubq323 <ubq323@ubq323.website> | 2022-12-29 20:27:54 +0000 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2022-12-29 20:27:54 +0000 |
commit | 279e87af49c103eb0b9278e10dc4a16b3a547f69 (patch) | |
tree | 996c8830bb9e6578b26e38df471c22ee5d6a33dc | |
parent | 61a4812a8ea9c287863a034dd14e75469edeb993 (diff) |
shop
-rw-r--r-- | shop.lua | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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") |