Fixed small issues
This commit is contained in:
6
core.lua
6
core.lua
@@ -8,7 +8,7 @@ function Core:new()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Core:connect()
|
function Core:connect()
|
||||||
ws, err = assert(http.websocket("ws://localhost:8080"));
|
ws, err = assert(http.websocket("ws://192.168.5.162:8080"));
|
||||||
|
|
||||||
if not ws then
|
if not ws then
|
||||||
term.setTextColor(colors.red);
|
term.setTextColor(colors.red);
|
||||||
@@ -28,7 +28,7 @@ function Core:send(package)
|
|||||||
return false, "Websocket not initiated";
|
return false, "Websocket not initiated";
|
||||||
end
|
end
|
||||||
|
|
||||||
self.ws:send(textutils.serialiseJSON(package));
|
self.ws.send(textutils.serialiseJSON(package));
|
||||||
end
|
end
|
||||||
|
|
||||||
function Core:read()
|
function Core:read()
|
||||||
@@ -36,7 +36,7 @@ function Core:read()
|
|||||||
return false, "Websocket not initiated";
|
return false, "Websocket not initiated";
|
||||||
end
|
end
|
||||||
|
|
||||||
return true, textutils.unserialiseJSON(self.ws:read())
|
return true, textutils.unserialiseJSON(self.ws.read())
|
||||||
end
|
end
|
||||||
|
|
||||||
function Core:download(file)
|
function Core:download(file)
|
||||||
|
|||||||
Reference in New Issue
Block a user