added tick to core
This commit is contained in:
22
core.lua
22
core.lua
@@ -114,9 +114,29 @@ function Core:download(file)
|
|||||||
return true, "Success"
|
return true, "Success"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Core:tick()
|
||||||
|
if not self then
|
||||||
|
error("No instance!")
|
||||||
|
end
|
||||||
|
|
||||||
|
if not self.ws then
|
||||||
|
return false, "Not initilized"
|
||||||
|
end
|
||||||
|
|
||||||
|
self:send({type = "TICK"});
|
||||||
|
|
||||||
|
local success, data = self:read();
|
||||||
|
|
||||||
|
if not success then
|
||||||
|
return false, "Failed to do anything: "..data;
|
||||||
|
end
|
||||||
|
|
||||||
|
print("Server expects Action: "..textutils.serialiseJSON(data))
|
||||||
|
end
|
||||||
|
|
||||||
function Core:disconnect()
|
function Core:disconnect()
|
||||||
if not self then
|
if not self then
|
||||||
return "Not instance"
|
error("No instance!")
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.ws then
|
if not self.ws then
|
||||||
|
|||||||
Reference in New Issue
Block a user