Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("wget http://regex.info/code/JSON.lua")
- local mon = peripheral.find("monitor")
- mon.setCursorPos(1,1)
- local xm, ym = mon.getSize()
- JSON = (loadfile "JSON.lua")()
- local ws, err = http.websocket("wss://ws.hqt.space")
- if not ws then
- printError(err)
- else
- while true do
- local msg = JSON:decode(ws.receive())
- term.redirect(mon)
- if msg.type == "status" then
- term.setBackgroundColor(colors.black)
- term.clear()
- print(msg.message)
- local x, y = term.getCursorPos()
- paintutils.drawLine(1, y, xm, y, colors.green)
- end
- term.redirect(term.native())
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement