blob: efb3eef87c49b9bf1928db98ca2129917fcb9c16 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
local pm = require'pm'
local ws = assert(http.websocket("wss://citrons.xyz/ws-echo/rebecca"))
function main()
while true do
local msg = ws.receive()
local parsed = assert(textutils.unserializeJSON(msg))
if parsed.msg then
print("got msg",parsed.msg)
-- more sophisticated cmds later, maybe
local pkgname = parsed.msg
pm.dl(pkgname)
multishell.run(pkgname..'.lua')
end
end
end
pcall(main)
print("all done")
|