Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function websocket()
- local ws, err = http.websocket("ws://localhost:8080/turtle")
- if err then
- print(err)
- elseif ws then
- while true do
- local message = ws.receive()
- if message == nil then
- break
- end
- local func = loadstring(message)
- local result = func()
- ws.send(result)
- end
- end
- end
- websocket()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement