v1.6.0 - Removed low level libraries computer and component. They must now be imported.

This commit is contained in:
TheWahlolly
2025-05-23 15:34:50 +03:00
parent 5552657dbd
commit 91d9ebecb1
16 changed files with 75 additions and 40 deletions
+1 -1
View File
@@ -19,4 +19,4 @@ end
componentlib.invoke = component.invoke
return(componentlib)
return componentlib
+14
View File
@@ -0,0 +1,14 @@
local computerlib = table.copy(computer)
local LLcomputer = table.copy(computer)
function computerlib.pullSignal(timeout)
local startTime = LLcomputer.uptime()
local result
repeat
result = {LLcomputer.pullSignal(0)}
coroutine.yield()
until result or timeout and LLcomputer.uptime() >= startTime + timeout
return table.unpack(result)
end
return computerlib
+2 -1
View File
@@ -1,3 +1,4 @@
local computer = import("computer")
local event = {}
--local ocelot = component.proxy(component.list("ocelot")())
@@ -50,4 +51,4 @@ function event.pull(...)
until false -- Loop until we find an event or timeout
end
return event
return event
+3 -10
View File
@@ -1,10 +1,12 @@
local loadfile = ... -- raw loadfile from boot.lua
local component
local component, computer
if loadfile then
component = loadfile("/halyde/lib/component.lua")(loadfile)
computer = _G.computer
elseif import then
component = import("component")
computer = import("computer")
end
local filesystem = {}
@@ -127,15 +129,6 @@ function filesystem.size(path)
return component.invoke(address, "size", absPath)
end
function filesystem.isDirectory(path)
checkArg(1, path, "string")
local address, absPath = filesystem.absolutePath(path)
if not address then
return false
end
return component.invoke(address, "isDirectory", absPath)
end
function filesystem.rename(fromPath, toPath)
checkArg(1, fromPath, "string")
checkArg(2, toPath, "string")