v1.3.0 - Added a better logo to fetch, _OSLOGO, fixed possible ls bug.

This commit is contained in:
TheWahlolly
2025-05-21 16:31:27 +03:00
parent 97ed964d32
commit 611841e128
6 changed files with 93 additions and 75 deletions
+18 -23
View File
@@ -1,21 +1,19 @@
print("")
print("")
print(" \27[93m┌┬┐ ┌┐ ┌┐ \n ││├─┤├┬┬┘├─┐\n │┐├┘││││││││\n ││││││││││┌┤\n └┴┴─┴┼┐├─┴─┘\n └─┘ ")
termlib.cursorPosX, termlib.cursorPosY = 17, termlib.cursorPosY - 8
print("\27[92mOS\27[0m: ".._OSVERSION)
termlib.cursorPosX = 17
print("\27[92mArchitecture\27[0m: ".._VERSION)
termlib.cursorPosX = 17
local function printstat(text)
termlib.cursorPosX = 35
print(text, true, false)
end
print(_OSLOGO, true, false)
termlib.cursorPosY = termlib.cursorPosY - 18
printstat("\27[92mOS\27[0m: ".._OSVERSION)
printstat("\27[92mArchitecture\27[0m: ".._VERSION)
local componentCounter = 0
for _, _ in component.list() do
componentCounter = componentCounter + 1
end
print("\27[92mComponents\27[0m: "..tostring(componentCounter))
termlib.cursorPosX = 17
print("\27[92mCoroutines\27[0m: "..tostring(#cormgr.corList))
termlib.cursorPosX = 17
print("\27[92mBattery\27[0m: "..tostring(math.floor(computer.energy() / computer.maxEnergy() * 1000 + 0.5) / 10).."%")
termlib.cursorPosX = 17
printstat("\27[92mComponents\27[0m: "..tostring(componentCounter))
printstat("\27[92mCoroutines\27[0m: "..tostring(#cormgr.corList))
printstat("\27[92mBattery\27[0m: "..tostring(math.floor(computer.energy() / computer.maxEnergy() * 1000 + 0.5) / 10).."%")
local totalMemory = computer.totalMemory()
local usedMemory = computer.totalMemory() - computer.freeMemory()
local totalMemoryString
@@ -38,8 +36,7 @@ elseif convert(usedMemory, "B", "KiB") >= 1 then
else
usedMemoryString = tostring(usedMemory) .. " B"
end
print("\27[92mMemory\27[0m: "..usedMemoryString.." / "..totalMemoryString)
termlib.cursorPosX = 17
printstat("\27[92mMemory\27[0m: "..usedMemoryString.." / "..totalMemoryString)
local totalDisk = component.invoke(computer.getBootAddress(), "spaceTotal")
local usedDisk = component.invoke(computer.getBootAddress(), "spaceUsed")
local totalDiskString
@@ -62,11 +59,9 @@ elseif convert(usedDisk, "B", "KiB") >= 1 then
else
usedDiskString = tostring(usedDisk) .. " B"
end
print("\27[92mDisk\27[0m: "..usedDiskString.." / "..totalDiskString)
termlib.cursorPosX = 17
printstat("\27[92mDisk\27[0m: "..usedDiskString.." / "..totalDiskString)
local width, height = component.invoke(component.list("gpu")(), "getResolution")
print("\27[92mResolution\27[0m: "..tostring(width).."x"..tostring(height).."\n")
termlib.cursorPosX = 17
print("\27[40m \27[41m \27[42m \27[43m \27[44m \27[45m \27[46m \27[47m ")
termlib.cursorPosX = 17
print("\27[100m \27[101m \27[102m \27[103m \27[104m \27[105m \27[106m \27[107m ")
printstat("\27[92mResolution\27[0m: "..tostring(width).."x"..tostring(height).."\n")
printstat("\27[40m \27[41m \27[42m \27[43m \27[44m \27[45m \27[46m \27[47m ")
printstat("\27[100m \27[101m \27[102m \27[103m \27[104m \27[105m \27[106m \27[107m ")
termlib.cursorPosY = termlib.cursorPosY + 5