summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2022-12-29 20:27:54 +0000
committerubq323 <ubq323@ubq323.website>2022-12-29 20:27:54 +0000
commit279e87af49c103eb0b9278e10dc4a16b3a547f69 (patch)
tree996c8830bb9e6578b26e38df471c22ee5d6a33dc
parent61a4812a8ea9c287863a034dd14e75469edeb993 (diff)
shop
-rw-r--r--shop.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/shop.lua b/shop.lua
index ad6e425..ecd0d0f 100644
--- a/shop.lua
+++ b/shop.lua
@@ -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")