This commit is contained in:
kepler155c
2018-10-25 00:18:38 -04:00
parent d5b0ad73b9
commit 6ce4039e8a
13 changed files with 129 additions and 11 deletions

View File

@@ -7,6 +7,27 @@ local Util = require('util')
local colors = _G.colors
local socket
local options = {
user = { arg = 'u', type = 'string',
desc = 'User name associated with bound manipulator' },
server = { arg = 's', type = 'number',
desc = 'ID of Milo server' },
help = { arg = 'h', type = 'flag', value = false,
desc = 'Displays the options' },
}
local args = { ... }
if not Util.getOptions(options, args) then
print()
error('Invalid arguments')
end
if not options.user.value or not options.server.value then
Util.showOptions(options)
print()
error('Invalid arguments')
end
local page = UI.Page {
menuBar = UI.MenuBar {
buttons = {
@@ -90,7 +111,10 @@ function page:sendRequest(data)
for _ = 1, 2 do
if not socket or not socket.connected then
socket, msg = Socket.connect(1, 4242)
socket, msg = Socket.connect(options.server.value, 4242)
if socket then
socket:write(options.user.value)
end
end
if socket then
if socket:write(data) then