Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if fs.exists("json")==false then
- shell.run("pastebin get 4nRg9CHU json")
- end
- if fs.exists("pf")==false then
- shell.run("pastebin get 2HXb06ic pf")
- end
- shell.run("rm connect")
- shell.run("pastebin get Xk3GT1mr connect")
- os.loadAPI("connect")
- os.loadAPI("json")
- os.loadAPI("pf")
- require("pf")
- local ws,err = http.websocket("ws://"..connect.code)
- local id = pf.getID()
- if ws then
- while true do
- local msg = ws.receive()
- print(msg)
- if msg~=nil then
- if string.find(msg,"receiver\"")~=nil then
- local obj = json.decode(msg)
- if obj.receiver==id or obj.receiver=="broadcast" then
- eval(obj["func"])
- sleep(0)
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement