blob: ad6e4254eb09058d0b4c5ae1a9bc9ef684b29323 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
sres =textutils.unserializeJSON( http.post("https://krist.dev/ws/start","").readAll())
assert(sres.ok,"not ok")
ws = assert(http.websocket(sres.url))
while true do
msgtxt = assert(ws.receive(),"ws error")
msg = textutils.unserializeJSON(msgtxt)
print(c.type)
if c.type ~= "keepalive" then print(msgtxt) end
end
-- mtop = peripheral.wrap"top"
-- while true do
-- mtop.setTextScale(3.5)
-- mtop.setTextColor(colors.cyan)
-- mtop.setCursorPos(1,1)
-- mtop.write"DIAMONDS"
-- os.sleep(0.75)
-- mtop.clear()
-- os.sleep(0.25)
-- mtop.setTextScale(3)
-- mtop.setTextColor(colors.white)
-- mtop.setCursorPos(1,1)
-- mtop.write("5KST EACH")
-- os.sleep(0.75)
-- mtop.clear()
-- os.sleep(0.25)
-- end
|