Compare commits
157
Commits
main
...
bleeding-edge
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5de781471
|
||
|
|
d2ad6be236
|
||
|
|
ca65d252c9 | ||
|
|
fc184ea591 | ||
|
|
8a76ca11c9 | ||
|
|
8a3a34efc0 | ||
|
|
996d81129d | ||
|
|
499dfd6843 | ||
|
|
8aa08814a1 | ||
|
|
eaae852961 | ||
|
|
93c632ed6e | ||
|
|
ab48b57e1b | ||
|
|
45a09284c2 | ||
|
|
8fc249433b | ||
|
|
69a033f9a2 | ||
|
|
11dea2b9e8 | ||
|
|
393802b34e | ||
|
|
a3e0ec64ae | ||
|
|
9b9c005194 | ||
|
|
81e832ef5d | ||
|
|
6c356c7a13 | ||
|
|
14b25d59fc | ||
|
|
afe27f2b41 | ||
|
|
317c0df9e8 | ||
|
|
b139e2da01 | ||
|
|
af61b8661a | ||
|
|
cb0f663f94 | ||
|
|
364dda8850 | ||
|
|
d091dcad18 | ||
|
|
7453215c91 | ||
|
|
95befaa72b | ||
|
|
399dd37b2d | ||
|
|
0c197d758a | ||
|
|
ac1e58abcf | ||
|
|
08af85f3b4 | ||
|
|
4d6dbadc32 | ||
|
|
b756bc516e | ||
|
|
16214c253d | ||
|
|
35e3a2313f | ||
|
|
f81e9089d3 | ||
|
|
8c33ee0eb9 | ||
|
|
202f6d42ac | ||
|
|
2b897106c5 | ||
|
|
cd5b71c110 | ||
|
|
e3464a920e | ||
|
|
137f8645fd | ||
|
|
44f391253c | ||
|
|
477d1de809 | ||
|
|
bf541b8b9d | ||
|
|
2bff0e749a | ||
|
|
60283fc40e | ||
|
|
f275247b00 | ||
|
|
d84324c707 | ||
|
|
8dda210eb3 | ||
|
|
95b1c56d65 | ||
|
|
56a849c1a8 | ||
|
|
233ad0598d | ||
|
|
442e83c8e9 | ||
|
|
5ea263e0bc | ||
|
|
e001c1b17e | ||
|
|
4bc3a64a8c | ||
|
|
82fc244209 | ||
|
|
7bb4923bf0 | ||
|
|
568b4d0b2c | ||
|
|
26a61c6e6c | ||
|
|
b6cdae3408 | ||
|
|
e8b6714b9a | ||
|
|
6f377c2bd5 | ||
|
|
4e837fc928 | ||
|
|
6688bbcaaf | ||
|
|
eb2e6b9596 | ||
|
|
2173713694 | ||
|
|
c5b330ac9d | ||
|
|
2d6dbe41a1 | ||
|
|
65facb89f7 | ||
|
|
647854b1da | ||
|
|
a7809384d9 | ||
|
|
88f2a55ca0 | ||
|
|
3ab72fe1dd | ||
|
|
1e9ba6c01a | ||
|
|
bca8830ead | ||
|
|
5feed553af | ||
|
|
d24e00c308 | ||
|
|
f5fcc84903 | ||
|
|
86f825d14b | ||
|
|
3c99c26ea3 | ||
|
|
fa1ef3926b | ||
|
|
bef22740f6 | ||
|
|
3e3e35860c | ||
|
|
ad7596efee | ||
|
|
c4b6445c23 | ||
|
|
ead5a09747 | ||
|
|
be2ddf1dd4 | ||
|
|
ca5d1114d2 | ||
|
|
c5418be165 | ||
|
|
f0c0acfcdc | ||
|
|
ae1652b1b9 | ||
|
|
c1c6a50b09 | ||
|
|
51124da54b | ||
|
|
8144d44deb | ||
|
|
337f8af1df | ||
|
|
30b38ee0d9 | ||
|
|
8548855d7f | ||
|
|
f1d69b51b2 | ||
|
|
c9883c2c64 | ||
|
|
668ed93491 | ||
|
|
8ab525b9ac | ||
|
|
245b6a524d | ||
|
|
883f20f269 | ||
|
|
61eea92fe0 | ||
|
|
26c1f055d8 | ||
|
|
d771a1fe39 | ||
|
|
a020229a69 | ||
|
|
e1270d7bd7 | ||
|
|
f1877f6338 | ||
|
|
61a7e3d139 | ||
|
|
8296127266 | ||
|
|
62a2466c5e | ||
|
|
1798d63864 | ||
|
|
33f2573eb6 | ||
|
|
ea074a8f87 | ||
|
|
4a9683a256 | ||
|
|
296aba9a2f | ||
|
|
1d49683d3c | ||
|
|
e0b6feb98c | ||
|
|
d63941814f | ||
|
|
db01a8d741 | ||
|
|
a89953056b | ||
|
|
2c47a6df59 | ||
|
|
943f1020fa | ||
|
|
3d9ec665b9 | ||
|
|
9c0e33c116 | ||
|
|
cd3dd80c23 | ||
|
|
58c8ce3f2d | ||
|
|
de5d779d9a | ||
|
|
0ca8cfeeeb | ||
|
|
0c604a5870 | ||
|
|
c83fe8a7f4 | ||
|
|
f28812205e | ||
|
|
2f512b5e99 | ||
|
|
732f747347 | ||
|
|
99725b43ba | ||
|
|
ad0f2197a3 | ||
|
|
cf26f610b4 | ||
|
|
39897457f9 | ||
|
|
87d0e6bbcb | ||
|
|
8b51217324 | ||
|
|
894641734f | ||
|
|
90252f83f1 | ||
|
|
0b2745ab9c | ||
|
|
099fbee8c6 | ||
|
|
66783e455c | ||
|
|
ff04e730f9 | ||
|
|
3c087aaddf | ||
|
|
8244f1590c | ||
|
|
d3d5f21ab1 | ||
|
|
ef0ffa1886 |
@@ -0,0 +1,3 @@
|
||||
[*.lua]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -0,0 +1,5 @@
|
||||
.stfolder
|
||||
.idea
|
||||
home/*
|
||||
halyde/logs/*
|
||||
*.kate-swp
|
||||
+2
-1
@@ -14,7 +14,8 @@
|
||||
"diagnostics": {
|
||||
"disable": [
|
||||
"undefined-global",
|
||||
"lowercase-global"
|
||||
"lowercase-global",
|
||||
"missing-fields"
|
||||
],
|
||||
"globals": [
|
||||
"_G",
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# Halyde
|
||||
### If you are viewing on GitHub: Halyde has moved to [Gitea](https://git.sting.lt/Cerulean-Blue/Halyde). This repository is now a read-only mirror. Contributions, issues and pull requests will not be processed here. Please go to [the Gitea instance](https://git.sting.lt/Cerulean-Blue/Halyde) for that.
|
||||
|
||||
A universal, customizable and feature-packed operating system for OpenComputers.
|
||||
|
||||
<p align="center">
|
||||
@@ -6,8 +8,8 @@ A universal, customizable and feature-packed operating system for OpenComputers.
|
||||
<img src="https://img.shields.io/badge/Written_in-Lua-blue?style=plastic&logo=lua" /></a>
|
||||
<a href="https://ocdoc.cil.li/">
|
||||
<img src="https://img.shields.io/badge/Made_for-OpenComputers-yellow?style=plastic" /></a>
|
||||
<a href="https://cerulean-blue.gitbook.io/halyde-docs">
|
||||
<img src="https://img.shields.io/badge/Documented_on-GitBook-green?style=plastic&logo=gitbook" /></a>
|
||||
<a href="https://wiki.sting.lt/">
|
||||
<img src="https://img.shields.io/badge/Documented_on-DokuWiki-green?style=plastic" /></a>
|
||||
</p>
|
||||
|
||||
## Installation
|
||||
@@ -20,4 +22,4 @@ If for some reason that doesn't work, try:
|
||||
`wget -f https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/main/webinstall.lua /tmp/webinstall.lua && /tmp/webinstall.lua`
|
||||
|
||||
## Docs
|
||||
Halyde is [documented on GitBook](https://cerulean-blue.gitbook.io/halyde-docs).
|
||||
Halyde is [documented on DokuWiki](https://wiki.sting.lt/), however there is an alternative documentation on [GitBook](https://cerulean-blue.gitbook.io/halyde-docs/).
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
local files = {...}
|
||||
local fs = require("filesystem")
|
||||
if not files or not files[1] then
|
||||
shell.run("help cat")
|
||||
return
|
||||
end
|
||||
for _, file in ipairs(files) do
|
||||
if file:sub(1, 1) ~= "/" then
|
||||
file = fs.concat(shell.workingDirectory, file)
|
||||
end
|
||||
if not fs.exists(file) then
|
||||
print("\27[91mFile does not exist.")
|
||||
end
|
||||
local handle = fs.open(file, "r")
|
||||
local data
|
||||
repeat
|
||||
data = handle:read(math.huge or math.maxinteger)
|
||||
termlib.write(data)
|
||||
until not data
|
||||
end
|
||||
@@ -1,14 +0,0 @@
|
||||
local directory = ...
|
||||
local fs = require("filesystem")
|
||||
|
||||
if not directory then
|
||||
return
|
||||
end
|
||||
if directory:sub(1, 1) ~= "/" then
|
||||
directory = fs.concat(shell.workingDirectory, directory)
|
||||
end
|
||||
if fs.exists(directory) and fs.isDirectory(directory) then
|
||||
shell.workingDirectory = fs.canonical(directory)
|
||||
else
|
||||
print("\27[91mNo such directory.")
|
||||
end
|
||||
@@ -1,26 +0,0 @@
|
||||
local fromFile, toFile = ...
|
||||
local fs = require("filesystem")
|
||||
|
||||
if not fromFile or not toFile then
|
||||
shell.run("help cp")
|
||||
return
|
||||
end
|
||||
if fromFile:sub(1, 1) ~= "/" then
|
||||
fromFile = fs.concat(shell.workingDirectory, fromFile)
|
||||
end
|
||||
if toFile:sub(1, 1) ~= "/" then
|
||||
toFile = fs.concat(shell.workingDirectory, toFile)
|
||||
end
|
||||
if fromFile == toFile then
|
||||
print("\27[91mSource and destination are the same.")
|
||||
return
|
||||
end
|
||||
if not fs.exists(fromFile) then
|
||||
print("\27[91mSource file does not exist.")
|
||||
return
|
||||
end
|
||||
if fs.exists(toFile) and not (table.find({...}, "-o") or table.find({...}, "--overwrite")) then
|
||||
print("\27[91mDestination file already exists. Run this command again with -o to overwrite it.")
|
||||
return
|
||||
end
|
||||
fs.copy(fromFile, toFile)
|
||||
@@ -1,70 +0,0 @@
|
||||
local component = require("component")
|
||||
local computer = require("computer")
|
||||
|
||||
local function printstat(text)
|
||||
terminal.cursorPosX = 35
|
||||
terminal.write(text .. "\n", false)
|
||||
end
|
||||
|
||||
terminal.write(_OSLOGO, false)
|
||||
terminal.cursorPosY = terminal.cursorPosY - 17
|
||||
printstat("\27[92mOS\27[0m: ".._OSVERSION)
|
||||
printstat("\27[92mArchitecture\27[0m: ".._VERSION)
|
||||
local componentCounter = 0
|
||||
for _, _ in component.list() do
|
||||
componentCounter = componentCounter + 1
|
||||
end
|
||||
printstat("\27[92mComponents\27[0m: "..tostring(componentCounter))
|
||||
printstat("\27[92mCoroutines\27[0m: "..tostring(#tsched.getTasks()))
|
||||
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
|
||||
if convert(totalMemory, "B", "GiB") >= 1 then
|
||||
totalMemoryString = tostring(math.floor(convert(totalMemory, "B", "GiB") * 100 + 0.5) / 100) .. " GiB"
|
||||
elseif convert(totalMemory, "B", "MiB") >= 1 then
|
||||
totalMemoryString = tostring(math.floor(convert(totalMemory, "B", "MiB") * 100 + 0.5) / 100) .. " MiB"
|
||||
elseif convert(totalMemory, "B", "KiB") >= 1 then
|
||||
totalMemoryString = tostring(math.floor(convert(totalMemory, "B", "KiB") * 100 + 0.5) / 100) .. " KiB"
|
||||
else
|
||||
totalMemoryString = tostring(totalMemory) .. " B"
|
||||
end
|
||||
local usedMemoryString
|
||||
if convert(usedMemory, "B", "GiB") >= 1 then
|
||||
usedMemoryString = tostring(math.floor(convert(usedMemory, "B", "GiB") * 100 + 0.5) / 100) .. " GiB"
|
||||
elseif convert(usedMemory, "B", "MiB") >= 1 then
|
||||
usedMemoryString = tostring(math.floor(convert(usedMemory, "B", "MiB") * 100 + 0.5) / 100) .. " MiB"
|
||||
elseif convert(usedMemory, "B", "KiB") >= 1 then
|
||||
usedMemoryString = tostring(math.floor(convert(usedMemory, "B", "KiB") * 100 + 0.5) / 100) .. " KiB"
|
||||
else
|
||||
usedMemoryString = tostring(usedMemory) .. " B"
|
||||
end
|
||||
printstat("\27[92mMemory\27[0m: "..usedMemoryString.." / "..totalMemoryString)
|
||||
local totalDisk = component.invoke(computer.getBootAddress(), "spaceTotal")
|
||||
local usedDisk = component.invoke(computer.getBootAddress(), "spaceUsed")
|
||||
local totalDiskString
|
||||
if convert(totalDisk, "B", "GiB") >= 1 then
|
||||
totalDiskString = tostring(math.floor(convert(totalDisk, "B", "GiB") * 100 + 0.5) / 100) .. " GiB"
|
||||
elseif convert(totalDisk, "B", "MiB") >= 1 then
|
||||
totalDiskString = tostring(math.floor(convert(totalDisk, "B", "MiB") * 100 + 0.5) / 100) .. " MiB"
|
||||
elseif convert(totalDisk, "B", "KiB") >= 1 then
|
||||
totalDiskString = tostring(math.floor(convert(totalDisk, "B", "KiB") * 100 + 0.5) / 100) .. " KiB"
|
||||
else
|
||||
totalDiskString = tostring(totalDisk) .. " B"
|
||||
end
|
||||
local usedDiskString
|
||||
if convert(usedDisk, "B", "GiB") >= 1 then
|
||||
usedDiskString = tostring(math.floor(convert(usedDisk, "B", "GiB") * 100 + 0.5) / 100) .. " GiB"
|
||||
elseif convert(usedDisk, "B", "MiB") >= 1 then
|
||||
usedDiskString = tostring(math.floor(convert(usedDisk, "B", "MiB") * 100 + 0.5) / 100) .. " MiB"
|
||||
elseif convert(usedDisk, "B", "KiB") >= 1 then
|
||||
usedDiskString = tostring(math.floor(convert(usedDisk, "B", "KiB") * 100 + 0.5) / 100) .. " KiB"
|
||||
else
|
||||
usedDiskString = tostring(usedDisk) .. " B"
|
||||
end
|
||||
printstat("\27[92mDisk\27[0m: "..usedDiskString.." / "..totalDiskString)
|
||||
local width, height = component.invoke(component.list("gpu")(), "getResolution")
|
||||
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 ")
|
||||
terminal.cursorPosY = terminal.cursorPosY + 5
|
||||
@@ -1,38 +0,0 @@
|
||||
local fs = require("filesystem")
|
||||
local args = {...}
|
||||
local command = args[1]
|
||||
args = nil
|
||||
if not command then
|
||||
local handle, data, tmpdata = fs.open("/halyde/apps/helpdb/default.txt", "r"), "", nil
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
print(data)
|
||||
return
|
||||
end
|
||||
if shell.aliases[command] then
|
||||
command = shell.aliases[command]
|
||||
end
|
||||
if fs.exists("/halyde/apps/helpdb/" .. command .. ".txt") then
|
||||
local handle, data, tmpdata = fs.open("/halyde/apps/helpdb/" .. command .. ".txt", "r"), "", nil
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
print(data)
|
||||
local aliases = table.copy(shell.aliases)
|
||||
if table.find(aliases, command) then
|
||||
local aliasIndex = table.find(aliases, command)
|
||||
local aliasString = "Aliases:\n " .. aliasIndex
|
||||
aliases[aliasIndex] = nil
|
||||
while table.find(aliases, command) do
|
||||
aliasIndex = table.find(aliases, command)
|
||||
aliasString = aliasString .. ", " .. aliasIndex
|
||||
aliases[aliasIndex] = nil
|
||||
end
|
||||
print(aliasString)
|
||||
end
|
||||
else
|
||||
print("Could not find help file for: " .. command .. ".")
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
Usage: argentum [COMMAND] [PACKAGES]
|
||||
Uses the Argentum package manager.
|
||||
|
||||
COMMAND Specifies the operation for Ag to do.
|
||||
install Installs packages.
|
||||
remove Removes packages.
|
||||
update Updates packages.
|
||||
list Lists all available packages.
|
||||
search Searches all available packages.
|
||||
info Shows information on a specific package.
|
||||
PACKAGES* Packages to apply operations to.
|
||||
|
||||
Examples:
|
||||
ag install hal-draw Installs the hal-draw package.
|
||||
ag list Lists all packages.
|
||||
ag info hal-draw Shows information about hal-draw.
|
||||
ag update hal-draw Updates the hal-draw package if it's not at the newest version.
|
||||
ag update Updates all packages.
|
||||
@@ -1,15 +0,0 @@
|
||||
Usage: boot [ADDRESS] [FLAGS]
|
||||
Restarts and automatically boots into any storage medium. Meant to be used for systems using a Lua BIOS EEPROM.
|
||||
|
||||
ADDRESS The storage medium to boot to.
|
||||
hdd1 The first hard drive inserted in the computer.
|
||||
hdd2 The second hard drive inserted in the computer.
|
||||
floppy The floppy disk that is inserted in the computer.
|
||||
The ID of the component, abbreviated. Must have three or more characters.
|
||||
FLAGS Specifies extra options when executing the command.
|
||||
-f, --force Forces booting into the storage medium.
|
||||
|
||||
Examples:
|
||||
boot hdd1 Boot into the first hard drive inserted in the computer.
|
||||
boot hdd2 Boot into the second hard drive inserted in the computer.
|
||||
boot floppy Boot into the floppy disk inserted in the comuter.
|
||||
@@ -1,8 +0,0 @@
|
||||
Usage: cat [FILES]...
|
||||
Concatenates and prints a file.
|
||||
|
||||
FILES Specifies the paths to the files to print.
|
||||
|
||||
Examples:
|
||||
cat /init.lua Concatenates and prints init.lua in the root directory.
|
||||
cat help.lua cat.lua Concatenates and prints help.lua and cat.lua in the current working directory.
|
||||
@@ -1,10 +0,0 @@
|
||||
Usage: cd [PATH]
|
||||
Sets the shell working directory.
|
||||
|
||||
PATH Specifies the path to set the shell working directory to.
|
||||
|
||||
Examples:
|
||||
cd /home/ Sets the shell working directory to /home/.
|
||||
cd halyde Sets the shell working directory to a directory named "halyde" in the current working directory.
|
||||
cd .. Sets the shell working directory back one directory.
|
||||
.. Equivalent of "cd ..".
|
||||
@@ -1,5 +0,0 @@
|
||||
Usage: clear
|
||||
Clears the screen.
|
||||
|
||||
Examples:
|
||||
clear Clears the screen.
|
||||
@@ -1,11 +0,0 @@
|
||||
Usage: cp [FLAGS] [SOURCE] [DESTINATION]
|
||||
Copies a file.
|
||||
|
||||
FLAGS Specifies extra options when executing the command.
|
||||
-o, --overwrite Allows any file that might be at the destination to be overwritten.
|
||||
SOURCE Specifies the file to be copied.
|
||||
DESTINATION Specifies the path to copy the file to.
|
||||
|
||||
Examples:
|
||||
cp /home/a.txt /b.txt Copies the file at /home/a.txt to /b.txt.
|
||||
cp -o c.lua d.txt Copies the file c.lua to another file called d.txt in the shell working directory, overwriting any file that might be there.
|
||||
@@ -1,25 +0,0 @@
|
||||
All default Halyde shell commands:
|
||||
argentum Uses the Argentum package manager.
|
||||
cat Concatenates and prints a file.
|
||||
cd Changes directory.
|
||||
clear Clears the screen.
|
||||
cp Copies a file.
|
||||
download Downloads a file from the internet.
|
||||
echo Prints a message.
|
||||
edit Opens the text editor.
|
||||
fetch Displays system information.
|
||||
help Shows this.
|
||||
ls Lists files.
|
||||
lscor Lists coroutines.
|
||||
lua Starts the Lua shell.
|
||||
mkdir Makes a directory.
|
||||
mv Moves/renames a file.
|
||||
reboot Reboots the computer.
|
||||
rm Deletes a file.
|
||||
shutdown Shuts down the computer.
|
||||
|
||||
You can get additional information on any app or command by running:
|
||||
help [COMMAND]
|
||||
|
||||
In the help documentation, an asterisk (*) next to an argument means it is optional.
|
||||
This is excluding flags, which are all optional.
|
||||
@@ -1,7 +0,0 @@
|
||||
Usage: download [URL]
|
||||
Downloads a file from the internet.
|
||||
|
||||
URL Specifies the URL from which to download the file from.
|
||||
|
||||
Examples:
|
||||
download https://github.com/ Downloads github.com.
|
||||
@@ -1,8 +0,0 @@
|
||||
Usage: echo [TEXT]...
|
||||
Concatenates and prints text to the terminal.
|
||||
|
||||
TEXT Text to print.
|
||||
|
||||
Examples:
|
||||
echo test Prints "test" to the terminal.
|
||||
echo Hello World! Prints "Hello World!" to the terminal.
|
||||
@@ -1,8 +0,0 @@
|
||||
Usage: edit [PATH]
|
||||
Opens a file with the text editor, or a new blank file if not specified.
|
||||
|
||||
PATH* Specifies the file to be opened.
|
||||
|
||||
Examples:
|
||||
edit Opens a new blank file in the text editor.
|
||||
edit /LICENSE Opens /LICENSE in the text editor.
|
||||
@@ -1,5 +0,0 @@
|
||||
Usage: fetch
|
||||
Displays system information including OS version, Lua version, memory, etc.
|
||||
|
||||
Examples:
|
||||
fetch Displays system information.
|
||||
@@ -1,8 +0,0 @@
|
||||
Usage: help [COMMAND]
|
||||
Displays info on the command specified, or a list of commands if one is not specified.
|
||||
|
||||
COMMAND* Command to display information on.
|
||||
|
||||
Examples:
|
||||
help Displays a list of all default commands available.
|
||||
help cp Displays information about the cp command.
|
||||
@@ -1,16 +0,0 @@
|
||||
Usage: label [ADDRESS] [LABEL]
|
||||
Get or set a label of a component that supports labelling.
|
||||
|
||||
ADDRESS The component to use for getting or setting the label.
|
||||
eeprom The computer's EEPROM.
|
||||
halyde The drive where the Halyde installation resides in.
|
||||
slotN The slot number of the drive, in top-to-bottom order (range 7-9)
|
||||
#N The slot number of the drive, in drive space (range 1-3)
|
||||
The ID of the component, abbreviated. Must have three or more characters.
|
||||
LABEL* The label to set the component to. If not found, the current label will be printed out.
|
||||
|
||||
Examples:
|
||||
label #3 Get the label of the third drive in the computer.
|
||||
label eeprom Get the label of the EEPROM inserted in the computer.
|
||||
label slot8 Storage Set the drive at slot 8 to have the label "Storage"
|
||||
label halyde Halyde Set the label of the Halyde installation to "Halyde"
|
||||
@@ -1,10 +0,0 @@
|
||||
Usage: ls [PATH]
|
||||
Lists all files and directories in the specified path, or in the shell working directory if the path isn't specified.
|
||||
Directories are shown in [93myellow[0m, executable files are shown in [92mgreen[0m, and other files are shown in white.
|
||||
|
||||
PATH* Path to the folder to list files and directories from.
|
||||
|
||||
Examples:
|
||||
ls Lists all files and directories from the current shell working directory.
|
||||
ls /halyde Lists all files and directories from /halyde.
|
||||
ls apps Lists all files and directories from the apps directory in the shell working directory.
|
||||
@@ -1,5 +0,0 @@
|
||||
Usage: lscor
|
||||
Lists every active coroutine by ID and name.
|
||||
|
||||
Examples:
|
||||
lscor Lists every active coroutine by ID and name.
|
||||
@@ -1,27 +0,0 @@
|
||||
Usage: lsdrv [FLAGS]
|
||||
Shows all drives that are inserted into the computer.
|
||||
|
||||
FLAGS Specifies extra options when executing the command.
|
||||
-a, --all Shows every column and every component. Acts the same as '-o all -s all'.
|
||||
-o, --output [COLS] Specifies the columns to output in the output table.
|
||||
Possible columns are: "slot", "capacity", "managed", "readOnly", "id", "mount", "bootable", and "label".
|
||||
If the list of columns start with a "+", the default columns will appear first.
|
||||
Default columns are slots, capacity, the entire ID, the mount point, and the drive label.
|
||||
-s, --show [EXPR] Only list drives when the expression returns 'true'.
|
||||
-S, --sort [EXPR] Sort the output by an expression that returns a number.
|
||||
The higher the number, the lower the drive is displayed, and vice-versa.
|
||||
EXPR An expression in Lua, for filtering or sorting output.
|
||||
If this expression contains spaces, make sure to put quotation marks on them!
|
||||
Built-in variables are: "component", "computer", "type", "id", "readonly", "capacity", "managed", "eeprom", "halyde", "tmp", "proxy", "slot", and "all" (true).
|
||||
|
||||
Examples:
|
||||
lsblk Show regular drives, with the default columns.
|
||||
lsblk -a Show all storage components, with every column.
|
||||
lsblk -o +bootable Show drives, with an added "bootable" category.
|
||||
lsblk -o slot,label -s halyde Show the slot and the label of the drive where Halyde is installed.
|
||||
lsblk -o mount,capacity,label -s "not halyde" Show the mount points, capacities and labels of all drives other than Halyde.
|
||||
lsblk -s type=='filesystem' Only show managed drives.
|
||||
lsblk -s slot==1 Show all drives that aren't physical (Virtual components, tmpfs)
|
||||
lsblk -S capacity Sort the drives by capacity, in ascending order.
|
||||
lsblk -S -capacity Sort the drives by capacity, in descending order.
|
||||
lsblk -o +managed -S managed Show managed drives first, then unmanaged drives second, with an extra "managed" column.
|
||||
@@ -1,5 +0,0 @@
|
||||
Usage: lua
|
||||
Starts the Lua shell, where you can type commands to interpret them in real time.
|
||||
|
||||
Examples:
|
||||
lua Starts the Lua shell.
|
||||
@@ -1,2 +0,0 @@
|
||||
Usage: maindrv
|
||||
Shows the entire ID of the drive where Halyde is installed to.
|
||||
@@ -1,7 +0,0 @@
|
||||
Usage: mkdir [PATH]
|
||||
Makes a directory.
|
||||
|
||||
PATH Specifies the path to create the directory in.
|
||||
|
||||
Examples:
|
||||
mkdir a Creates a directory named a in the current shell working directory.
|
||||
@@ -1,11 +0,0 @@
|
||||
Usage: mv [FLAGS] [SOURCE] [DESTINATION]
|
||||
Moves/renames a file.
|
||||
|
||||
FLAGS Specifies extra options when executing the command.
|
||||
-o, --overwrite Allows any file that might be at the destination to be overwritten.
|
||||
SOURCE Specifies the file to be moved/renamed.
|
||||
DESTINATION Specifies the path/filename to move/rename the file to.
|
||||
|
||||
Examples:
|
||||
mv /home/a.txt /b.txt Moves the file at /home/a.txt to /b.txt.
|
||||
mv -o c.lua d.txt Renames the file c.lua to another file called d.txt in the shell working directory, overwriting any file that might be there.
|
||||
@@ -1,5 +0,0 @@
|
||||
Usage: reboot
|
||||
Reboots the computer.
|
||||
|
||||
Examples:
|
||||
reboot Reboots the computer.
|
||||
@@ -1,7 +0,0 @@
|
||||
Usage: rm [PATH]
|
||||
Removes files and directories.
|
||||
|
||||
PATH Specifies the file to be moved/renamed.
|
||||
|
||||
Examples:
|
||||
rm a.txt Removes a.txt in the current shell working directory.
|
||||
@@ -1,5 +0,0 @@
|
||||
Usage: shutdown
|
||||
Shuts down the computer.
|
||||
|
||||
Examples:
|
||||
shutdown Shuts down the computer.
|
||||
@@ -1,70 +0,0 @@
|
||||
local args = {...}
|
||||
local target = args[1]
|
||||
args = nil
|
||||
local fs = require("filesystem")
|
||||
local unicode = require("unicode")
|
||||
local maxLength = 0
|
||||
local margin = 2 -- minimum space between filename and size
|
||||
local dirTable = {}
|
||||
local fileTable = {}
|
||||
|
||||
if target then
|
||||
if target:sub(1, 1) ~= "/" then
|
||||
target = fs.concat(shell.workingDirectory, target)
|
||||
end
|
||||
else
|
||||
target = shell.workingDirectory
|
||||
end
|
||||
|
||||
local files = fs.list(target)
|
||||
|
||||
if files then
|
||||
for _, file in pairs(files) do
|
||||
if file:sub(-1, -1) == "/" then
|
||||
table.insert(dirTable, file)
|
||||
file = file:sub(1, -2)
|
||||
else
|
||||
table.insert(fileTable, file)
|
||||
end
|
||||
if unicode.wlen(file) > maxLength then
|
||||
maxLength = unicode.wlen(file)
|
||||
end
|
||||
end
|
||||
table.sort(dirTable)
|
||||
table.sort(fileTable)
|
||||
files = {}
|
||||
for _, v in ipairs(dirTable) do
|
||||
table.insert(files, v)
|
||||
end
|
||||
for _, v in ipairs(fileTable) do
|
||||
table.insert(files, v)
|
||||
end
|
||||
dirTable, fileTable = nil, nil
|
||||
for _, file in ipairs(files) do
|
||||
local dir = false
|
||||
local filetext
|
||||
if file:sub(-1, -1) == "/" then
|
||||
dir = true
|
||||
filetext = "\27[93m"..file:sub(1, -2)
|
||||
elseif file:find(".") and file:match("[^.]+$") == "lua" then
|
||||
filetext = "\27[92m"..file
|
||||
end
|
||||
filetext = (filetext or file)..string.rep(" ", maxLength - unicode.wlen(file) + margin)
|
||||
if dir then
|
||||
print(filetext.." \27[0m[DIR]")
|
||||
else
|
||||
local size = fs.size(fs.concat(target, file))
|
||||
local sizeString
|
||||
if convert(size, "B", "GiB") >= 1 then
|
||||
sizeString = tostring(math.floor(convert(size, "B", "GiB") * 100 + 0.5) / 100).." GiB"
|
||||
elseif convert(size, "B", "MiB") >= 1 then
|
||||
sizeString = tostring(math.floor(convert(size, "B", "MiB") * 100 + 0.5) / 100).." MiB"
|
||||
elseif convert(size, "B", "KiB") >= 1 then
|
||||
sizeString = tostring(math.floor(convert(size, "B", "KiB") * 100 + 0.5) / 100).." KiB"
|
||||
else
|
||||
sizeString = tostring(size).." B"
|
||||
end
|
||||
print(filetext.."\27[0m"..sizeString)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,9 +0,0 @@
|
||||
print("\27[93m"..tostring(#cormgr.corList).."\27[0m coroutines active")
|
||||
for i=1, #cormgr.corList do
|
||||
if i==#cormgr.corList then
|
||||
print("\27[93m└ "..i.."\27[0m - "..cormgr.labelList[i].." \27[0m")
|
||||
else
|
||||
print("\27[93m├ "..i.."\27[0m - "..cormgr.labelList[i].." \27[0m")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,31 +0,0 @@
|
||||
print("\27[44m".._VERSION.."\27[0m shell")
|
||||
print('Type "exit" to exit.')
|
||||
termlib.readHistory["lua"] = {""}
|
||||
local fs = require("filesystem")
|
||||
|
||||
local loadedLibraries = ""
|
||||
local libList = fs.list("halyde/lib")
|
||||
for _, lib in pairs(libList) do
|
||||
if lib:match("(.+)%.lua") then
|
||||
loadedLibraries = loadedLibraries .. "local " .. lib:match("(.+)%.lua") .. ' = require("' .. lib:match("(.+)%.lua") .. '")\n'
|
||||
end
|
||||
end
|
||||
|
||||
while true do
|
||||
local command = read("lua", "\27[44mlua>\27[0m ")
|
||||
if command == "exit" then
|
||||
return
|
||||
else
|
||||
local function runCommand()
|
||||
local func = load(loadedLibraries.."return "..command,"=stdin") or load(loadedLibraries..command,"=stdin")
|
||||
local res = {assert(func)()}
|
||||
if res and (type(res[1])~="nil" or type(res[2])~="nil") then print(table.unpack(res)) end
|
||||
end
|
||||
local result, reason = xpcall(runCommand, function(errMsg)
|
||||
return errMsg .. "\n\n" .. debug.traceback()
|
||||
end)
|
||||
if not result then
|
||||
print("\27[91m" .. reason)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,14 +0,0 @@
|
||||
local directory = ...
|
||||
local fs = require("filesystem")
|
||||
|
||||
if not directory then
|
||||
shell.run("help mkdir")
|
||||
return
|
||||
end
|
||||
if directory:sub(1, 1) ~= "/" then
|
||||
directory = fs.concat(shell.workingDirectory, directory)
|
||||
end
|
||||
if fs.exists(directory) then
|
||||
print("\27[91mAn object already exists at the specified path.")
|
||||
end
|
||||
fs.makeDirectory(directory)
|
||||
@@ -1,24 +0,0 @@
|
||||
local fromFile, toFile = ...
|
||||
local fs = require("filesystem")
|
||||
|
||||
if not fromFile or not toFile then
|
||||
shell.run("help mv")
|
||||
return
|
||||
end
|
||||
if fromFile:sub(1, 1) ~= "/" then
|
||||
fromFile = fs.concat(shell.workingDirectory, fromFile)
|
||||
end
|
||||
if toFile:sub(1, 1) ~= "/" then
|
||||
toFile = fs.concat(shell.workingDirectory, toFile)
|
||||
end
|
||||
if fromFile == toFile then
|
||||
print("\27[91mSource and destination are the same.")
|
||||
end
|
||||
if not fs.exists(fromFile) then
|
||||
print("\27[91mSource file does not exist.")
|
||||
end
|
||||
if fs.exists(toFile) and not (table.find({...}, "-o") or table.find({...}, "--overwrite")) then
|
||||
print("\27[91mDestination file already exists. Run this command again with -o to overwrite it.")
|
||||
return
|
||||
end
|
||||
fs.rename(fromFile, toFile)
|
||||
@@ -1,15 +0,0 @@
|
||||
local file = ...
|
||||
local fs = require("filesystem")
|
||||
|
||||
if not file then
|
||||
shell.run("help rm")
|
||||
return
|
||||
end
|
||||
if file:sub(1, 1) ~= "/" then
|
||||
file = fs.concat(shell.workingDirectory, file)
|
||||
end
|
||||
if not fs.exists(file) then
|
||||
print("\27[91mFile does not exist.")
|
||||
return
|
||||
end
|
||||
fs.remove(file)
|
||||
@@ -1 +0,0 @@
|
||||
{"prompt":"\u001b[92m%s > \u001b[0m","aliases":{"move":"mv","copy":"cp","ag":"argentum","rename":"mv","..":"cd ..","man":"help","del":"rm","delete":"rm","ren":"mv","remove":"rm","list":"ls","wget":"download","dir":"ls","ps":"lscor","poweroff":"shutdown","restart":"reboot"},"splashMessages":["Made by John Haly- I mean Cerulean Blue.","Welcome! Type \"help\" to get started.","Also try KOCOS!","Welcome back, Commander. We have no idea what we're doing.","99.9% bug-free. The remaining 0.1% are features.","0 days since last error.","Everything is fine. The fire is decorative.","Please don't feed the background processes.","Also has fetch!","Anything red is no man's land. Trust me.","Machine...","Abort, Retry, Fail?","What's the deal with /argentum/store?","So cutting-edge you can't hold it in your hand.","Americans are the reason you see colors on-screen. I'm talking about ANSI escape codes, not politics.","Shoutout to Ponali!"],"path":["/halyde/apps/"],"startupMessage":"\n │\n │ %s\n │ %s\n │\n ","defaultWorkingDirectory":"/home/"}
|
||||
@@ -1 +0,0 @@
|
||||
{"prompt":"\u001b[92m%s > \u001b[0m","aliases":{"move":"mv","copy":"cp","ag":"argentum","rename":"mv","..":"cd ..","man":"help","del":"rm","delete":"rm","ren":"mv","remove":"rm","list":"ls","wget":"download","dir":"ls","ps":"lscor","poweroff":"shutdown","restart":"reboot","lsblk":"lsdrv"},"splashMessages":["Made by John Haly- I mean Cerulean Blue.","Welcome! Type \"help\" to get started.","Also try KOCOS!","Welcome back, Commander. We have no idea what we're doing.","99.9% bug-free. The remaining 0.1% are features.","0 days since last error.","Everything is fine. The fire is decorative.","Please don't feed the background processes.","Also has fetch!","Anything red is no man's land. Trust me.","Machine...","Abort, Retry, Fail?","What's the deal with /argentum/store?","So cutting-edge you can't hold it in your hand.","Americans are the reason you see colors on-screen. I'm talking about ANSI escape codes, not politics.","Shoutout to Ponali!","Now i% more secure!"],"path":["/halyde/apps/"],"startupMessage":"\n │\n │ %s\n │ %s\n │\n ","defaultWorkingDirectory":"/home/"}
|
||||
@@ -1 +0,0 @@
|
||||
["/halyde/shell/shell.lua"]
|
||||
@@ -1,73 +0,0 @@
|
||||
local loadfile = ...
|
||||
local filesystem = assert(loadfile("/lib/filesystem.lua")(loadfile))
|
||||
_G._OSVERSION = "HALYDE VERSION" -- TODO: Put this in a separate config file
|
||||
_G._OSLOGO = ""
|
||||
_G._PUBLIC = {}
|
||||
local ocelot = component.proxy(component.list("ocelot")())
|
||||
|
||||
local handle, tmpdata = filesystem.open("/halyde/config/oslogo.ans", "r"), nil
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge)
|
||||
_OSLOGO = _OSLOGO .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
|
||||
_G.package = {["preloaded"] = {}}
|
||||
|
||||
loadfile("/halyde/kernel/modules/datatools.lua")()
|
||||
|
||||
function _G.require(module, ...)
|
||||
ocelot.log("Requiring " .. module)
|
||||
local args = table.pack(...)
|
||||
if package.preloaded[module] then
|
||||
return package.preloaded[module]
|
||||
end
|
||||
local modulepath
|
||||
if filesystem.exists(module) then
|
||||
modulepath = module
|
||||
elseif filesystem.exists("/lib/" .. module .. ".lua") then
|
||||
modulepath = "/lib/" .. module .. ".lua"
|
||||
elseif shell and shell.workingDirectory and filesystem.exists(filesystem.concat(shell.workingDirectory, module .. ".lua")) then
|
||||
modulepath = shell.workingDirectory .. module .. ".lua"
|
||||
end
|
||||
assert(modulepath, "Module not found\nPossible locations:\n/lib/" .. module .. ".lua")
|
||||
local handle, data, tmpdata = filesystem.open(modulepath), "", nil
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
handle:close()
|
||||
return(assert(load(data, "="..modulepath))(table.unpack(args)))
|
||||
end
|
||||
|
||||
function _G.package.preload(module)
|
||||
local handle, data, tmpdata = assert(filesystem.open("/lib/" .. module .. ".lua", "r")), "", nil
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
handle:close()
|
||||
package.preloaded[module] = assert(load(data, "="..module))()
|
||||
_G[module] = nil
|
||||
end
|
||||
|
||||
require("/halyde/kernel/datatools.lua") -- If this is not imported BEFORE modload gets run, modload requires filesystem which requires computer which requires datatools.
|
||||
require("/halyde/kernel/modload.lua")
|
||||
|
||||
package.preload("component")
|
||||
package.preload("computer")
|
||||
|
||||
local component = require("component")
|
||||
local gpu = component.gpu
|
||||
local screenAddress = component.list("screen")()
|
||||
|
||||
gpu.bind(screenAddress)
|
||||
gpu.setResolution(gpu.maxResolution())
|
||||
|
||||
if not filesystem.exists("/halyde/config/shell.json") then -- Auto-generate configs
|
||||
filesystem.copy("/halyde/config/generate/shell.json", "/halyde/config/shell.json")
|
||||
end
|
||||
if not filesystem.exists("/halyde/config/startupapps.json") then
|
||||
filesystem.copy("/halyde/config/generate/startupapps.json", "/halyde/config/startupapps.json")
|
||||
end
|
||||
|
||||
require("/halyde/kernel/tsched.lua")
|
||||
@@ -1,55 +0,0 @@
|
||||
_G.evmgr = {}
|
||||
_G.evmgr.eventQueue = {}
|
||||
local maxEventQueueLength = 10 -- increase if events start getting dropped
|
||||
|
||||
local computer = require("computer")
|
||||
|
||||
_G._PUBLIC.keyboard.ctrlDown = false
|
||||
_G._PUBLIC.keyboard.altDown = false
|
||||
_G._PUBLIC.keyboard.shiftDown = false
|
||||
|
||||
--local ocelot = component.proxy(component.list("ocelot")())
|
||||
|
||||
while true do
|
||||
local args
|
||||
repeat
|
||||
args = {computer.uptime(), computer.pullSignal(0)}
|
||||
if args and args[2] then
|
||||
table.insert(evmgr.eventQueue, args)
|
||||
if _PUBLIC.keyboard then
|
||||
if args[2] == "key_down" then
|
||||
local keycode = args[5]
|
||||
local key = _PUBLIC.keyboard.keys[keycode]
|
||||
if key == "lcontrol" then
|
||||
_PUBLIC.keyboard.ctrlDown = true
|
||||
elseif key == "lmenu" then
|
||||
_PUBLIC.keyboard.altDown = true
|
||||
elseif key == "lshift" then
|
||||
_PUBLIC.keyboard.shiftDown = true
|
||||
elseif key == "c" and _PUBLIC.keyboard.ctrlDown and _PUBLIC.keyboard.altDown then
|
||||
if print then
|
||||
print("\n\27[91mCoroutine "..tostring(#tsched.tasks).." killed.")
|
||||
end
|
||||
tsched.tasks[#tsched.tasks] = nil
|
||||
end
|
||||
elseif args[2] == "key_up" then
|
||||
local keycode = args[5]
|
||||
local key = _PUBLIC.keyboard.keys[keycode]
|
||||
if key == "lcontrol" then
|
||||
_PUBLIC.keyboard.ctrlDown = false
|
||||
elseif key == "lmenu" then
|
||||
_PUBLIC.keyboard.altDown = false
|
||||
elseif key == "lshift" then
|
||||
_PUBLIC.keyboard.shiftDown = true
|
||||
end
|
||||
end
|
||||
end
|
||||
while #evmgr.eventQueue > maxEventQueueLength do
|
||||
--ocelot.log("Queue length breach, removing first signal")
|
||||
table.remove(evmgr.eventQueue, 1)
|
||||
end
|
||||
end
|
||||
until not args or not args[1]
|
||||
--ocelot.log("done")
|
||||
coroutine.yield()
|
||||
end
|
||||
@@ -1,53 +0,0 @@
|
||||
local fs = require("filesystem")
|
||||
local ocelot = require("component").ocelot
|
||||
|
||||
local modulePath = "/halyde/kernel/modules"
|
||||
|
||||
local modules = fs.list(modulePath)
|
||||
local moduleTypes = {}
|
||||
|
||||
local function loadModule(modName)
|
||||
ocelot.log("Checking module " .. modName)
|
||||
local moduleData = require(fs.concat(modulePath, modName))
|
||||
table.remove(modules, table.find(modules, modName))
|
||||
if not moduleData.check() then
|
||||
return
|
||||
end
|
||||
ocelot.log("Loading module " .. modName)
|
||||
if moduleData.dependencies then
|
||||
for _, dependency in pairs(moduleData.dependencies) do
|
||||
if table.find(modules, dependency) then
|
||||
loadModule(dependency)
|
||||
elseif table.find(modules, dependency .. ".lua") then
|
||||
loadModule(dependency .. ".lua")
|
||||
else
|
||||
for typeLookupDrvName, typeLookupDrvType in pairs(moduleTypes) do
|
||||
if typeLookupDrvType == dependency then
|
||||
loadModule(typeLookupDrvName)
|
||||
-- Don't break, because there can be multiple modules of the correct type
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
--print(modName)
|
||||
if moduleData.init then -- I have no idea why this would not exist, but it's a failsafe
|
||||
moduleData.init()
|
||||
end
|
||||
end
|
||||
|
||||
for _, modName in pairs(modules) do -- Get all the module types
|
||||
local moduleData = require(fs.concat(modulePath, modName))
|
||||
if moduleData.type then
|
||||
--print(moduleData.type)
|
||||
moduleTypes[modName] = moduleData.type -- Not the other way around because there can be multiple modules of the same type, but there can't be multiple entries with the same key
|
||||
end
|
||||
end
|
||||
|
||||
while modules[1] do
|
||||
if modules[1]:sub(-1, -1) ~= "/" then -- Check if it's not a directory. If it is, it might be module config
|
||||
loadModule(modules[1])
|
||||
end
|
||||
end
|
||||
|
||||
ocelot.log("Finished loading modules!")
|
||||
@@ -1,15 +0,0 @@
|
||||
local module = {}
|
||||
|
||||
function module.check()
|
||||
return true -- This module should always be loaded
|
||||
end
|
||||
|
||||
function module.init()
|
||||
|
||||
end
|
||||
|
||||
function module.exit()
|
||||
|
||||
end
|
||||
|
||||
return module
|
||||
@@ -1,466 +0,0 @@
|
||||
local module = {}
|
||||
|
||||
function module.check()
|
||||
return true -- Usually always loaded, but maybe it would be worth it to check if the computer has a GPU or not? I'm not sure.
|
||||
end
|
||||
|
||||
function module.init()
|
||||
local serialize = require("serialize")
|
||||
local unicode = require("unicode")
|
||||
local event = require("event")
|
||||
|
||||
--local ocelot = component.proxy(component.list("ocelot")())
|
||||
local component = require("component")
|
||||
local computer = require("computer")
|
||||
local gpu = component.gpu
|
||||
_G._PUBLIC.terminal = {}
|
||||
_PUBLIC.terminal.cursorPosX = 1
|
||||
_PUBLIC.terminal.cursorPosY = 1
|
||||
_PUBLIC.terminal.readHistory = {}
|
||||
|
||||
local width, height = gpu.getResolution()
|
||||
|
||||
local ANSIColorPalette = {
|
||||
["dark"] = {
|
||||
[0] = 0x000000,
|
||||
[1] = 0x800000,
|
||||
[2] = 0x008000,
|
||||
[3] = 0x808000,
|
||||
[4] = 0x000080,
|
||||
[5] = 0x800080,
|
||||
[6] = 0x008080,
|
||||
[7] = 0xC0C0C0
|
||||
},
|
||||
["bright"] = {
|
||||
[0] = 0x808080,
|
||||
[1] = 0xFF0000,
|
||||
[2] = 0x00FF00,
|
||||
[3] = 0xFFFF00,
|
||||
[4] = 0x0000FF,
|
||||
[5] = 0xFF00FF,
|
||||
[6] = 0x00FFFF,
|
||||
[7] = 0xFFFFFF
|
||||
}
|
||||
}
|
||||
|
||||
defaultForegroundColor = ANSIColorPalette["bright"][7]
|
||||
defaultBackgroundColor = ANSIColorPalette["dark"][0]
|
||||
|
||||
gpu.setForeground(defaultForegroundColor)
|
||||
gpu.setBackground(defaultBackgroundColor)
|
||||
|
||||
local function scrollDown()
|
||||
local width, height = gpu.getResolution()
|
||||
if gpu.copy(1,1,width,height,0,-1) then
|
||||
local prevForeground = gpu.getForeground()
|
||||
local prevBackground = gpu.getBackground()
|
||||
gpu.setForeground(defaultForegroundColor)
|
||||
gpu.setBackground(defaultBackgroundColor)
|
||||
gpu.fill(1, height, width, 1, " ")
|
||||
gpu.setForeground(prevForeground)
|
||||
gpu.setBackground(prevBackground)
|
||||
_PUBLIC.terminal.cursorPosY=height
|
||||
end
|
||||
end
|
||||
|
||||
local function newLine()
|
||||
_PUBLIC.terminal.cursorPosX=1
|
||||
_PUBLIC.terminal.cursorPosY = _PUBLIC.terminal.cursorPosY + 1
|
||||
if _PUBLIC.terminal.cursorPosY>height then
|
||||
scrollDown()
|
||||
end
|
||||
end
|
||||
|
||||
local function parseCodeNumbers(code)
|
||||
local o = {}
|
||||
for num in code:sub(3,-2):gmatch("[^;]+") do
|
||||
table.insert(o,tonumber(num))
|
||||
end
|
||||
return o
|
||||
end
|
||||
|
||||
local function from8BitColor(num)
|
||||
num=math.floor(num)&255
|
||||
if num<16 then return 0x444444*((num>>3)&1)+(0xBB0000*((num>>2)&1)|0x00BB00*((num>>1)&1)|0x0000BB*(num&1)) end
|
||||
if num>=232 then return 0x10101*(8+(num-232)*10) end
|
||||
num=num-16
|
||||
local palette = {0,95,135,175,215,255}
|
||||
return (palette[(num//36)%6+1]<<16)|(palette[(num//6)%6+1]<<8)|palette[num%6+1]
|
||||
end
|
||||
|
||||
local function from24BitColor(r,g,b)
|
||||
r,g,b=math.floor(r)&255,math.floor(g)&255,math.floor(b)&255
|
||||
return (r<<16)|(g<<8)|b
|
||||
end
|
||||
|
||||
local function findCodeEnd(text,i)
|
||||
local function inRange(v,min,max)
|
||||
return v>=min and v<=max
|
||||
end
|
||||
i=i+2
|
||||
while i<=#text and not inRange(text:byte(i),0x40,0x7F) do i=i+1 end
|
||||
return i
|
||||
end
|
||||
|
||||
function _PUBLIC.terminal.write(text, textWrap)
|
||||
local width, height = gpu.getResolution()
|
||||
|
||||
-- you don't know how tiring this was just for ANSI escape code support
|
||||
|
||||
if textWrap == nil then
|
||||
textWrap = true
|
||||
end
|
||||
|
||||
if not text or not tostring(text) then
|
||||
return
|
||||
end
|
||||
if text:find("\a") then
|
||||
computer.beep()
|
||||
end
|
||||
text = tostring(text)
|
||||
text = "\27[0m" .. text:gsub("\t", " ")
|
||||
local readBreak = 0
|
||||
-- readBreak is for when, inside the for loop, there normally would have been an increase in the "i" variable because it has read more than one character.
|
||||
-- unfortunately, changing the "i" variable would have unpredictable effects, so to not risk anything, this workaround was done.
|
||||
local section = ""
|
||||
|
||||
local function printSection()
|
||||
if #section==0 then
|
||||
return
|
||||
end
|
||||
while true do
|
||||
gpu.set(_PUBLIC.terminal.cursorPosX,_PUBLIC.terminal.cursorPosY,section)
|
||||
if unicode.wlen(section) > width - _PUBLIC.terminal.cursorPosX + 1 and textWrap then
|
||||
section = section:sub(width - _PUBLIC.terminal.cursorPosX + 2)
|
||||
newLine()
|
||||
else
|
||||
_PUBLIC.terminal.cursorPosX = _PUBLIC.terminal.cursorPosX+unicode.wlen(section)
|
||||
break
|
||||
end
|
||||
end
|
||||
section = ""
|
||||
end
|
||||
|
||||
for i=1,#text do
|
||||
if readBreak>0 then
|
||||
readBreak = readBreak - 1
|
||||
goto continue
|
||||
end
|
||||
|
||||
if string.byte(text,i)==10 then
|
||||
printSection()
|
||||
newLine()
|
||||
elseif string.byte(text,i)==13 then
|
||||
printSection()
|
||||
_PUBLIC.terminal.cursorPosX=1
|
||||
elseif string.byte(text,i)==0x1b and i<=#text-2 then
|
||||
printSection()
|
||||
--ocelot.log("0x1b char detected")
|
||||
local codeType = string.sub(text,i+1,i+1)
|
||||
if codeType=="[" then
|
||||
-- Control Sequence Introducer
|
||||
--ocelot.log("Control Sequence Introducer")
|
||||
local codeEndIdx = findCodeEnd(text,i)
|
||||
-- codeEndIdx = string.find(text,"m",i)
|
||||
local code = string.sub(text,i,codeEndIdx)
|
||||
--ocelot.log("Code: "..code.." ("..i..", "..codeEndIdx..")")
|
||||
readBreak = readBreak + #code - 1
|
||||
local nums = parseCodeNumbers(code)
|
||||
local codeEnd = code:sub(-1)
|
||||
--ocelot.log("Code end: "..codeEnd..", "..#codeEnd)
|
||||
if codeEnd == "m" then
|
||||
-- Select Graphic Rendition
|
||||
--ocelot.log("Select Graphic Rendition, ID "..nums[1])
|
||||
if nums[1]>=30 and nums[1]<=37 then
|
||||
gpu.setForeground(ANSIColorPalette["dark"][nums[1]%10])
|
||||
end
|
||||
if nums[1]==38 and nums[2]==5 then
|
||||
gpu.setForeground(from8BitColor(nums[3]))
|
||||
end
|
||||
if nums[1]==38 and nums[2]==2 then
|
||||
gpu.setForeground(from24BitColor(nums[3],nums[4],nums[5]))
|
||||
end
|
||||
if nums[1]==39 or nums[1]==0 then
|
||||
gpu.setForeground(defaultForegroundColor)
|
||||
end
|
||||
if nums[1]>=40 and nums[1]<=47 then
|
||||
gpu.setBackground(ANSIColorPalette["dark"][nums[1]%10])
|
||||
end
|
||||
if nums[1]==48 and nums[2]==5 then
|
||||
gpu.setBackground(from8BitColor(nums[3]))
|
||||
end
|
||||
if nums[1]==48 and nums[2]==2 then
|
||||
gpu.setBackground(from24BitColor(nums[3],nums[4],nums[5]))
|
||||
end
|
||||
if nums[1]==49 or nums[1]==0 then
|
||||
gpu.setBackground(defaultBackgroundColor)
|
||||
end
|
||||
if nums[1]>=90 and nums[1]<=97 then
|
||||
gpu.setForeground(ANSIColorPalette["bright"][nums[1]%10])
|
||||
end
|
||||
if nums[1]>=100 and nums[1]<=107 then
|
||||
gpu.setBackground(ANSIColorPalette["bright"][nums[1]%10])
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
--gpu.set(_PUBLIC.terminal.cursorPosX,_PUBLIC.terminal.cursorPosY,string.sub(text,i,i))
|
||||
section = section..string.sub(text,i,i)
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
printSection()
|
||||
end
|
||||
|
||||
function _G.print(...)
|
||||
local args = {...}
|
||||
local stringArgs = {}
|
||||
for _, arg in pairs(args) do
|
||||
if type(arg)=="table" then
|
||||
table.insert(stringArgs, serialize.table(arg,true))
|
||||
elseif tostring(arg) then
|
||||
table.insert(stringArgs, tostring(arg))
|
||||
end
|
||||
end
|
||||
_PUBLIC.terminal.write(table.concat(stringArgs, " ") .. "\n")
|
||||
end
|
||||
|
||||
function _G._PUBLIC.terminal.clear()
|
||||
width, height = gpu.getResolution()
|
||||
gpu.setForeground(defaultForegroundColor)
|
||||
gpu.setBackground(defaultBackgroundColor)
|
||||
gpu.fill(1,1,width,height," ")
|
||||
_PUBLIC.terminal.cursorPosX, _PUBLIC.terminal.cursorPosY = 1, 1
|
||||
end
|
||||
|
||||
function _G._PUBLIC.terminal.read(readHistoryType, prefix, defaultText, maxChars)
|
||||
checkArg(1, readHistoryType, "string", "nil")
|
||||
checkArg(2, prefix, "string", "nil")
|
||||
checkArg(3, defaultText, "string", "nil")
|
||||
checkArg(4, maxChars, "number", "nil")
|
||||
maxChars = maxChars or math.huge
|
||||
|
||||
local text = defaultText or ""
|
||||
|
||||
local historyIdx
|
||||
if readHistoryType then
|
||||
if not _PUBLIC.terminal.readHistory[readHistoryType] then
|
||||
_PUBLIC.terminal.readHistory[readHistoryType] = {text}
|
||||
elseif _PUBLIC.terminal.readHistory[readHistoryType][#_PUBLIC.terminal.readHistory[readHistoryType] ] ~= "" then
|
||||
table.insert(_PUBLIC.terminal.readHistory[readHistoryType], text)
|
||||
end
|
||||
historyIdx = #_PUBLIC.terminal.readHistory[readHistoryType]
|
||||
end
|
||||
|
||||
local function updateHistory()
|
||||
if not readHistoryType then return end
|
||||
_PUBLIC.terminal.readHistory[readHistoryType][historyIdx]=text
|
||||
end
|
||||
|
||||
local cur = unicode.len(text)+1
|
||||
if prefix then _PUBLIC.terminal.write(prefix) end
|
||||
local startX, startY = _PUBLIC.terminal.cursorPosX, _PUBLIC.terminal.cursorPosY
|
||||
local fg, bg = gpu.getForeground(), gpu.getBackground()
|
||||
local cursorBlink = true
|
||||
local function get(idx)
|
||||
idx=startX+idx-1
|
||||
return gpu.get(idx%width,startY+(idx//width))
|
||||
end
|
||||
local function checkScroll(y)
|
||||
for i=1,y-height do
|
||||
scrollDown()
|
||||
startY=startY-1
|
||||
end
|
||||
return math.min(y,height)
|
||||
end
|
||||
local function set(idx,chr,rev)
|
||||
if chr==nil or chr=="" then return end
|
||||
if rev then
|
||||
gpu.setForeground(bg)
|
||||
gpu.setBackground(fg)
|
||||
else
|
||||
gpu.setForeground(fg)
|
||||
gpu.setBackground(bg)
|
||||
end
|
||||
idx=startX+idx-1
|
||||
local setX, setY = (idx-1)%width+1, startY+((idx-1)//width+1)-1
|
||||
setY = checkScroll(setY)
|
||||
gpu.set(setX,setY,unicode.sub(chr,1,width-setX+1))
|
||||
for i=1,math.ceil((#chr+setX-1)/width)+1 do
|
||||
gpu.set(1,setY+i,unicode.sub(chr,2-setX+i*width,width+i*width-setX))
|
||||
setY = checkScroll(setY)
|
||||
end
|
||||
end
|
||||
local function strDef(a,b)
|
||||
if #a==0 then return b end
|
||||
return a
|
||||
end
|
||||
local function curPos(cur)
|
||||
return unicode.wlen(unicode.sub(text,1,cur-1))+1
|
||||
end
|
||||
local function add(chr)
|
||||
if type(chr)~="string" or #chr==0 then return end
|
||||
if unicode.len(text)>=maxChars then return end
|
||||
if maxChars<math.huge then
|
||||
chr=unicode.sub(chr,1,maxChars-unicode.len(text))
|
||||
end
|
||||
text=unicode.sub(text,1,cur-1)..chr..unicode.sub(text,cur)
|
||||
set(curPos(cur),chr,false)
|
||||
cur=math.min(cur+unicode.len(chr),maxChars+1)
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),true)
|
||||
cursorBlink = true
|
||||
set(curPos(cur+1),unicode.sub(text,cur+1),false)
|
||||
end
|
||||
local function moveCur(dir)
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),false)
|
||||
cur=math.max(math.min(cur+dir,unicode.len(text)+1),1)
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),true)
|
||||
cursorBlink = true
|
||||
end
|
||||
local function isLetter(chr)
|
||||
return not string.find("\x09 :@-./_~?&=%+#",chr,1,true)
|
||||
end
|
||||
local function nextCur(dir,chr,icur)
|
||||
if icur==nil then icur=cur end
|
||||
local next = math.max(math.min(icur+dir,unicode.len(text)+1),1)
|
||||
if chr then return unicode.sub(text,next,next) end
|
||||
return next
|
||||
end
|
||||
local function curAfterWord(dir)
|
||||
local ncur = cur
|
||||
while nextCur(dir,false,ncur)~=ncur and isLetter(nextCur(dir,true,ncur))==(dir==1) do
|
||||
ncur=nextCur(dir,false,ncur)
|
||||
end
|
||||
while nextCur(dir,false,ncur)~=ncur and isLetter(nextCur(dir,true,ncur))==(dir==-1) do
|
||||
ncur=nextCur(dir,false,ncur)
|
||||
end
|
||||
return ncur
|
||||
end
|
||||
local function moveWord(dir)
|
||||
if nextCur(dir)==cur then return end
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),false)
|
||||
cur=curAfterWord(dir)
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),true)
|
||||
cursorBlink = true
|
||||
end
|
||||
local function deleteWord(dir)
|
||||
local after = curAfterWord(dir)
|
||||
local lenb = unicode.wlen(text)
|
||||
if dir==1 then
|
||||
text=unicode.sub(text,1,cur-1)..unicode.sub(text,after)
|
||||
set(curPos(cur+1),unicode.sub(text,cur+1)..string.rep(" ",lenb-unicode.wlen(text)+1),false)
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),true)
|
||||
else
|
||||
text = unicode.sub(text,1,after-1)..unicode.sub(text,cur)
|
||||
cur=after
|
||||
set(curPos(cur+1),unicode.sub(text,cur+1)..string.rep(" ",lenb-unicode.wlen(text)+1),false)
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),true)
|
||||
end
|
||||
updateHistory()
|
||||
cursorBlink = true
|
||||
end
|
||||
local function isLine(chr)
|
||||
return chr=="\n" or chr=="\r"
|
||||
end
|
||||
--[[ gpu.set(startX,startY,unicode.sub(text,1,width-startX))
|
||||
for i=1,(#text+startX)//width-1 do
|
||||
gpu.set(startX,startY+i,unicode.sub(text,1+i*width,width-startX+i*width))
|
||||
end ]]
|
||||
set(1,text,false)
|
||||
set(curPos(cur)," ",true)
|
||||
|
||||
local function reprint(new)
|
||||
set(1,new..string.rep(" ",unicode.wlen(text)-unicode.wlen(new)+1),false)
|
||||
cur=unicode.len(new)+1
|
||||
text=new
|
||||
set(curPos(cur)," ",true)
|
||||
end
|
||||
|
||||
while true do
|
||||
local args = {event.pull("key_down", "clipboard", 0.5)}
|
||||
if args and args[1] == "key_down" and args[4] then
|
||||
local key = _PUBLIC.keyboard.keys[args[4]]
|
||||
if key=="up" and readHistoryType then
|
||||
historyIdx=math.max(historyIdx-1,1)
|
||||
reprint(_PUBLIC.terminal.readHistory[readHistoryType][historyIdx])
|
||||
elseif key=="down" and readHistoryType then
|
||||
historyIdx=math.min(historyIdx+1,#_PUBLIC.terminal.readHistory[readHistoryType])
|
||||
reprint(_PUBLIC.terminal.readHistory[readHistoryType][historyIdx])
|
||||
elseif key=="left" and _PUBLIC.keyboard.ctrlDown then
|
||||
moveWord(-1)
|
||||
elseif key=="right" and _PUBLIC.keyboard.ctrlDown then
|
||||
moveWord(1)
|
||||
elseif key=="left" then
|
||||
moveCur(-1)
|
||||
elseif key=="right" then
|
||||
moveCur(1)
|
||||
elseif key=="home" then
|
||||
moveCur(-math.huge)
|
||||
elseif key=="end" then
|
||||
moveCur(math.huge)
|
||||
elseif key=="back" and _PUBLIC.keyboard.ctrlDown then
|
||||
deleteWord(-1)
|
||||
elseif key=="delete" and _PUBLIC.keyboard.ctrlDown then
|
||||
deleteWord(1)
|
||||
elseif key=="back" and cur>1 then
|
||||
text=unicode.sub(text,1,cur-2)..unicode.sub(text,cur)
|
||||
cur=cur-1
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),true)
|
||||
cursorBlink = true
|
||||
set(curPos(cur)+1,unicode.sub(text,cur+1).." ",false)
|
||||
updateHistory()
|
||||
elseif key=="delete" then
|
||||
text = unicode.sub(text,1,cur-1)..unicode.sub(text,cur+1)
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),true)
|
||||
cursorBlink = true
|
||||
if cur<=unicode.len(text) then
|
||||
set(curPos(cur+1),unicode.sub(text,cur+1).." ",false)
|
||||
end
|
||||
updateHistory()
|
||||
elseif key=="enter" then
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),false)
|
||||
break
|
||||
elseif not (args[3]<32 or (args[3]>0x7F and args[3]<=0x9F)) then
|
||||
add(unicode.char(args[3]) or " ")
|
||||
updateHistory()
|
||||
end
|
||||
elseif args and args[1]=="clipboard" then
|
||||
local clip = args[3]
|
||||
if not args[3] then goto continue end
|
||||
while isLine(unicode.sub(clip,1,1)) do clip=unicode.sub(clip,2) end
|
||||
while isLine(unicode.sub(clip,-1)) do clip=unicode.sub(clip,1,-2) end
|
||||
add(clip)
|
||||
updateHistory()
|
||||
else
|
||||
cursorBlink=not cursorBlink
|
||||
set(curPos(cur),strDef(unicode.sub(text,cur,cur)," "),cursorBlink)
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
|
||||
if readHistoryType then
|
||||
if _PUBLIC.terminal.readHistory[readHistoryType][#_PUBLIC.terminal.readHistory[readHistoryType]]=="" then
|
||||
table.remove(_PUBLIC.terminal.readHistory[readHistoryType],#_PUBLIC.terminal.readHistory[readHistoryType])
|
||||
end
|
||||
if historyIdx<#_PUBLIC.terminal.readHistory[readHistoryType] then
|
||||
table.remove(_PUBLIC.terminal.readHistory[readHistoryType],historyIdx)
|
||||
table.insert(_PUBLIC.terminal.readHistory[readHistoryType],text)
|
||||
end
|
||||
while #_PUBLIC.terminal.readHistory[readHistoryType] > 50 do
|
||||
table.remove(_PUBLIC.terminal.readHistory[readHistoryType], 1)
|
||||
end
|
||||
end
|
||||
|
||||
_PUBLIC.terminal.cursorPosX=1
|
||||
_PUBLIC.terminal.cursorPosY=_PUBLIC.terminal.cursorPosY+math.ceil((unicode.wlen(text)+startX-1)/width)
|
||||
if _PUBLIC.terminal.cursorPosY>height then scrollDown() end
|
||||
|
||||
return text
|
||||
end
|
||||
end
|
||||
|
||||
function module.exit()
|
||||
_G._PUBLIC.terminal = nil
|
||||
end
|
||||
|
||||
return module
|
||||
@@ -1,149 +0,0 @@
|
||||
_G._PUBLIC.tsched = {}
|
||||
_G.tsched = {}
|
||||
_G.tsched.tasks = {}
|
||||
|
||||
local currentTask
|
||||
|
||||
local component = require("component")
|
||||
local computer = require("computer")
|
||||
local filesystem = require("filesystem")
|
||||
local json = require("json")
|
||||
local gpu = component.gpu
|
||||
local ocelot = component.ocelot
|
||||
|
||||
function _G._PUBLIC.tsched.runAsTask(path,...)
|
||||
local args = {...}
|
||||
local function taskFunction()
|
||||
local result, errorMessage = xpcall(function(...)
|
||||
local args = table.pack(...)
|
||||
if not filesystem.exists(path) then
|
||||
error("No such file: " .. path)
|
||||
end
|
||||
local handle, data, tmpdata = filesystem.open(path), "", nil
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
handle:close()
|
||||
|
||||
-- Userland environment definition
|
||||
local userland = table.copy(_PUBLIC)
|
||||
userland._G = userland
|
||||
|
||||
assert(load(data, "="..path, "t", userland))(table.unpack(args))
|
||||
end, function(errorMessage)
|
||||
return errorMessage .. "\n \n" .. debug.traceback()
|
||||
end, path, table.unpack(args))
|
||||
if not result then
|
||||
if print then
|
||||
gpu.freeAllBuffers()
|
||||
print("\n\27[91m" .. errorMessage)
|
||||
else
|
||||
error(errorMessage)
|
||||
end
|
||||
end
|
||||
--require(path, table.unpack(args))
|
||||
end
|
||||
_PUBLIC.tsched.addTask(taskFunction, string.match(tostring(path), "([^/]+)%.lua$"))
|
||||
end
|
||||
|
||||
function _G._PUBLIC.tsched.addTask(func, name)
|
||||
ocelot.log("Added task " .. name)
|
||||
local task = coroutine.create(func)
|
||||
table.insert(tsched.tasks, {["task"] = task, ["name"] = name})
|
||||
return task
|
||||
end
|
||||
|
||||
function _G._PUBLIC.tsched.removeTask(id)
|
||||
-- TODO: Check for user permissions before running
|
||||
table.remove(_G.tsched.tasks, id)
|
||||
end
|
||||
|
||||
function handleError(errormsg)
|
||||
if errormsg == nil then -- TODO: Replace with proper error handling (if this isn't considered proper..?)
|
||||
print("\27[91munknown error" .. "\n \n" .. debug.traceback())
|
||||
else
|
||||
print("\27[91m" .. tostring(errormsg) .. "\n \n" .. debug.traceback())
|
||||
end
|
||||
end
|
||||
|
||||
local function runTasks()
|
||||
for i = 1, #_G.tsched.tasks do
|
||||
if tsched.tasks[i] then
|
||||
currentTask = tsched.tasks[i]
|
||||
local result, errorMessage = coroutine.resume(tsched.tasks[i].task)
|
||||
if not result then
|
||||
handleError(errorMessage)
|
||||
end
|
||||
if coroutine.status(tsched.tasks[i].task) == "dead" then
|
||||
_PUBLIC.tsched.removeTask(i)
|
||||
--ocelot.log("Removed coroutine")
|
||||
i = i - 1
|
||||
end
|
||||
--computer.pullSignal(0)
|
||||
--coroutine.yield()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function _G._PUBLIC.tsched.getCurrentTask()
|
||||
return table.copy(currentTask)
|
||||
end
|
||||
|
||||
function _G._PUBLIC.tsched.getTasks()
|
||||
return table.copy(tsched.tasks)
|
||||
end
|
||||
|
||||
local function taskFunction()
|
||||
local result, errorMessage = xpcall(function()
|
||||
if not filesystem.exists("/halyde/kernel/evmgr.lua") then
|
||||
error("No such file: /halyde/kernel/evmgr.lua")
|
||||
end
|
||||
local handle, data, tmpdata = filesystem.open("/halyde/kernel/evmgr.lua"), "", nil
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
handle:close()
|
||||
assert(load(data, "=/halyde/kernel/evmgr.lua"))()
|
||||
end, function(errorMessage)
|
||||
return errorMessage .. "\n \n" .. debug.traceback()
|
||||
end, "/halyde/kernel/evmgr.lua")
|
||||
if not result then
|
||||
if print then
|
||||
gpu.freeAllBuffers()
|
||||
print("\n\27[91m" .. errorMessage)
|
||||
else
|
||||
error(errorMessage)
|
||||
end
|
||||
end
|
||||
end
|
||||
_PUBLIC.tsched.addTask(taskFunction, "evmgr")
|
||||
package.preload("event")
|
||||
|
||||
local handle, data, tmpdata = filesystem.open("/halyde/config/startupapps.json", "r"), "", nil
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
handle:close()
|
||||
for _, line in ipairs(json.decode(data)) do
|
||||
if line ~= "" then
|
||||
--[[ if _G.print then
|
||||
print(line)
|
||||
end ]]
|
||||
_G._PUBLIC.tsched.runAsTask(line)
|
||||
runTasks()
|
||||
end
|
||||
end
|
||||
-- _G.cormgr.loadCoroutine("/halyde/core/shell.lua")
|
||||
|
||||
while true do
|
||||
runTasks()
|
||||
if #_G.tsched.tasks == 0 then
|
||||
computer.beep(1000, 0.5)
|
||||
while true do
|
||||
computer.pullSignal()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,4 +0,0 @@
|
||||
[37m[00:00:04:12] Debug!
|
||||
[97m[00:00:04:19] Info!
|
||||
[93m[00:00:04:25] Warning!
|
||||
[91m[00:00:04:32] Error!
|
||||
@@ -1,7 +0,0 @@
|
||||
local cor = coroutine.create(function()
|
||||
print("Hello World!")
|
||||
end)
|
||||
|
||||
print(coroutine.status(cor))
|
||||
coroutine.resume(cor)
|
||||
print(coroutine.status(cor))
|
||||
@@ -1,72 +0,0 @@
|
||||
local gpu = component.proxy(component.list("gpu")())
|
||||
local resX, resY = gpu.getResolution()
|
||||
|
||||
-- Architecture check
|
||||
local foundArchitecture = false
|
||||
for _, arch in pairs(computer.getArchitectures()) do
|
||||
if arch == "Lua 5.3" then
|
||||
foundArchitecture = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if foundArchitecture then
|
||||
computer.setArchitecture("Lua 5.3")
|
||||
else
|
||||
gpu.set(1, 1, "Required architecture (Lua 5.3) is not supported.")
|
||||
gpu.set(1, 2, "Halting.")
|
||||
while true do
|
||||
computer.pullSignal()
|
||||
end
|
||||
end
|
||||
|
||||
local function loadfile(file)
|
||||
checkArg(1, file, "string")
|
||||
local handle = component.invoke(computer.getBootAddress(), "open", file, "r")
|
||||
local data = ""
|
||||
repeat
|
||||
local tmpdata = component.invoke(computer.getBootAddress(), "read", handle, math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
component.invoke(computer.getBootAddress(), "close", handle)
|
||||
return assert(load(data, "=" .. file))
|
||||
end
|
||||
|
||||
local function handleError(errorMessage)
|
||||
return(errorMessage.."\n \n"..debug.traceback())
|
||||
end
|
||||
|
||||
function loadBoot()
|
||||
loadfile("/halyde/kernel/boot.lua")(loadfile)
|
||||
end
|
||||
|
||||
gpu.setBackground(0x000000)
|
||||
gpu.fill(1, 1, resX, resY, " ")
|
||||
|
||||
-- Copying low-level functions in case of post-preload failure
|
||||
local pullSignal = computer.pullSignal
|
||||
local shutdown = computer.shutdown
|
||||
|
||||
local result, reason = xpcall(loadBoot, handleError)
|
||||
if not result then
|
||||
gpu.setBackground(0x000000)
|
||||
gpu.fill(1, 1, resX, resY, " ")
|
||||
gpu.setBackground(0x800000)
|
||||
gpu.setForeground(0xFFFFFF)
|
||||
gpu.set(2,2,"A critical error has occurred.")
|
||||
local i = 4
|
||||
reason = tostring(reason):gsub("\t", " ")
|
||||
for line in string.gmatch(reason or "unknown error", "([^\n]*)\n?") do
|
||||
gpu.set(2,i,line)
|
||||
i = i + 1
|
||||
end
|
||||
gpu.set(2,i+1, "Press any key to restart.")
|
||||
local evname
|
||||
repeat
|
||||
evname = pullSignal()
|
||||
until evname == "key_down"
|
||||
shutdown(true)
|
||||
while true do
|
||||
coroutine.yield()
|
||||
end
|
||||
end
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
local fs = require("filesystem")
|
||||
local computer = require("computer")
|
||||
|
||||
local log = {}
|
||||
|
||||
function log.add(text, logType)
|
||||
checkArg(1, text, "string")
|
||||
checkArg(2, logType, "string", "nil")
|
||||
if logType ~= "debug" and logType ~= "info" and logType ~= "warning" and logType ~= "error" and logType then
|
||||
error("Log type must either be debug, info, warning or error.")
|
||||
end
|
||||
if not logType then
|
||||
logType = "debug"
|
||||
end
|
||||
local handle = fs.open("/halyde/system.log", "a")
|
||||
local time = computer.uptime()
|
||||
local logText = string.format("[%02d:%02d:%02d:%02d] " .. text, math.floor(time / 86400), math.floor(time / 3600 % 24), math.floor(time / 60 % 60), math.floor(time % 60)) .. "\n"
|
||||
if logType == "debug" then
|
||||
handle:write("\27[37m" .. logText)
|
||||
elseif logType == "info" then
|
||||
handle:write("\27[97m" .. logText)
|
||||
elseif logType == "warning" then
|
||||
handle:write("\27[93m" .. logText)
|
||||
else
|
||||
handle:write("\27[91m" .. logText)
|
||||
end
|
||||
handle:close()
|
||||
end
|
||||
|
||||
return log
|
||||
@@ -1,125 +0,0 @@
|
||||
local serialize = {}
|
||||
|
||||
function serialize.string(str)
|
||||
return '"'..str:gsub("[%z\1-\31\34\92\127-\159]",function(c)
|
||||
local byte = c:byte()
|
||||
if byte== 7 then return "\\a" end
|
||||
if byte== 8 then return "\\b" end
|
||||
if byte== 9 then return "\\t" end
|
||||
if byte==10 then return "\\n" end
|
||||
if byte==11 then return "\\v" end
|
||||
if byte==12 then return "\\f" end
|
||||
if byte==13 then return "\\r" end
|
||||
if byte==34 then return "\\\"" end
|
||||
if byte==92 then return "\\\\" end
|
||||
return string.format("\\x%02x",byte)
|
||||
end)..'"'
|
||||
end
|
||||
|
||||
function serialize.table(tbl,colors,stack)
|
||||
stack = table.copy(stack or {})
|
||||
table.insert(stack,tbl)
|
||||
local keyAmount = 0
|
||||
local keyNumber = true
|
||||
local out = ""
|
||||
local first = true
|
||||
|
||||
for key,val in pairs(tbl) do
|
||||
if not first then out=out..",\n" end
|
||||
first=false
|
||||
out=out.." "
|
||||
if type(key)=="string" then
|
||||
if key:match("^[%a_][%w_]*$") then
|
||||
out=out..key.."="
|
||||
else
|
||||
out=out..'['..serialize.string(key)..']='
|
||||
end
|
||||
else
|
||||
out=out.."["..tostring(key).."]="
|
||||
end
|
||||
if type(key)~="number" then
|
||||
keyNumber=false
|
||||
end
|
||||
|
||||
local success,reason = pcall(function()
|
||||
local valStr = ""
|
||||
if type(val)=="table" then
|
||||
if #stack>4 or table.find(stack,val) then
|
||||
valStr="..."
|
||||
else
|
||||
valStr=serialize.table(val,colors,stack)
|
||||
end
|
||||
elseif type(val)=="string" then
|
||||
local lines = {}
|
||||
for line in (val.."\n"):gmatch("([^\n]*)\n") do table.insert(lines,line) end
|
||||
if #lines[#lines]==0 then
|
||||
lines[#lines]=nil
|
||||
lines[#lines]=lines[#lines].."\n"
|
||||
end
|
||||
for i=1,#lines do
|
||||
if i<#lines then
|
||||
lines[i]=serialize.string(lines[i].."\n")
|
||||
else
|
||||
lines[i]=serialize.string(lines[i])
|
||||
end
|
||||
end
|
||||
valStr=table.concat(lines," ..\n ")
|
||||
else
|
||||
valStr=tostring(val)
|
||||
end
|
||||
local lines = {}
|
||||
for line in (valStr.."\n"):gmatch("([^\n]*)\n") do table.insert(lines,line) end
|
||||
out=out..table.concat(lines,"\n ")
|
||||
lines = nil
|
||||
keyAmount=keyAmount+1
|
||||
end)
|
||||
if not success then
|
||||
if colors then out=out.."\x1b[91m" end
|
||||
out=out.."["..tostring(reason).."]"
|
||||
if colors then out=out.."\x1b[39m" end
|
||||
end
|
||||
coroutine.yield()
|
||||
end
|
||||
|
||||
local metatbl = getmetatable(tbl)
|
||||
local metakeys = {}
|
||||
if type(metatbl)=="table" then
|
||||
for i,v in pairs(metatbl) do
|
||||
keyNumber=false
|
||||
table.insert(metakeys,i)
|
||||
end
|
||||
end
|
||||
if #metakeys>0 then
|
||||
out=out.."\n "
|
||||
if colors then out=out.."\x1b[92m" end
|
||||
if table.find(metakeys,"__tostring") then
|
||||
out=out.."tostring: "..serialize.string(tostring(tbl)).."\n "
|
||||
table.remove(metakeys,table.find(metakeys,"__tostring"))
|
||||
end
|
||||
out=out..table.concat(metakeys,", ")
|
||||
if colors then out=out.."\x1b[39m" end
|
||||
end
|
||||
|
||||
if keyAmount==0 then return "{}" end
|
||||
if keyNumber then
|
||||
-- fix strings not being serialised
|
||||
local vals = {}
|
||||
for _,v in pairs(tbl) do
|
||||
if #vals>=5 and #stack>1 then
|
||||
table.insert(vals,"...")
|
||||
break
|
||||
end
|
||||
if type(v)=="table" then
|
||||
table.insert(vals,serialize.table(v,colors,stack))
|
||||
elseif type(v)=="string" then
|
||||
table.insert(vals,serialize.string(v))
|
||||
else
|
||||
table.insert(vals,tostring(v))
|
||||
end
|
||||
end
|
||||
return "{"..table.concat(vals,", ").."}"
|
||||
end
|
||||
return "{\n"..out.."\n}"
|
||||
end
|
||||
|
||||
return serialize
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"halyde": "https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/Pre-Alpha-3.0.0/",
|
||||
"argentum": "https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/Pre-Alpha-3.0.0/",
|
||||
"edit": "https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/Pre-Alpha-3.0.0/",
|
||||
"package1": "https://raw.githubusercontent.com/WahPlus/ArgentumPackages/refs/heads/main/",
|
||||
"package2": "https://raw.githubusercontent.com/WahPlus/ArgentumPackages/refs/heads/main/",
|
||||
"vpkg": "https://raw.githubusercontent.com/WahPlus/ArgentumPackages/refs/heads/main/",
|
||||
"grouper": "https://raw.githubusercontent.com/WahPlus/ArgentumPackages/refs/heads/main/"
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
local agregistry = {
|
||||
["halyde"] = "https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/main/",
|
||||
["edit"] = "https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/main/",
|
||||
@@ -8,7 +9,10 @@ local agregistry = {
|
||||
["hextra"] = "https://raw.githubusercontent.com/Ponali/ArgentumPackages/refs/heads/master/",
|
||||
["utape"] = "https://raw.githubusercontent.com/Ponali/ArgentumPackages/refs/heads/master/",
|
||||
["libctif"] = "https://raw.githubusercontent.com/Ponali/ArgentumPackages/refs/heads/master/",
|
||||
["ctif-viewer"] = "https://raw.githubusercontent.com/Ponali/ArgentumPackages/refs/heads/master/"
|
||||
["ctif-viewer"] = "https://raw.githubusercontent.com/Ponali/ArgentumPackages/refs/heads/master/",
|
||||
["libsha256"] = "https://raw.githubusercontent.com/tema5002/ag-packages/refs/heads/main/",
|
||||
["sha256sum"] = "https://raw.githubusercontent.com/tema5002/ag-packages/refs/heads/main/",
|
||||
["base64"] = "https://raw.githubusercontent.com/mcplayer3/AgPackages/refs/heads/main/"
|
||||
}
|
||||
|
||||
return agregistry
|
||||
@@ -0,0 +1,520 @@
|
||||
local cliparse = require("cliparse")
|
||||
local fs = require("filesystem")
|
||||
local component = require("component")
|
||||
local json = require("json")
|
||||
|
||||
local function getFile(path)
|
||||
checkArg(1, path, "string")
|
||||
if path:sub(1, 7) == "http://" or path:sub(1, 8) == "https://" then
|
||||
if not component.list("internet")() then
|
||||
return false, "Internet card required but not found."
|
||||
end
|
||||
local handle, data, tmpdata = component.internet.request(path), "", nil
|
||||
local success, errorMessage = pcall(function()
|
||||
handle:finishConnect()
|
||||
end)
|
||||
if not success then
|
||||
return false, errorMessage
|
||||
end
|
||||
local code, message = handle:response()
|
||||
if code and code ~= 200 then
|
||||
return false, ("%d %s"):format(code, message)
|
||||
end
|
||||
repeat
|
||||
tmpdata = handle.read(math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
return true, data
|
||||
elseif path:sub(1, 1) == "/" then
|
||||
if not fs.exists(path) then
|
||||
return false, "No such file or directory: " .. path
|
||||
end
|
||||
if fs.isDirectory(path) then
|
||||
return false, "Expected file, found directory: " .. path
|
||||
end
|
||||
local handle, data, tmpdata = fs.open(path, "r", false), "", nil
|
||||
if not handle then
|
||||
return false, data
|
||||
end
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
return true, data
|
||||
else
|
||||
return false, "Unsupported path: " .. path
|
||||
end
|
||||
end
|
||||
|
||||
cliparse.config({
|
||||
["x"] = 0,
|
||||
["exclude-deps"] = 0,
|
||||
["u"] = 0,
|
||||
["update-registry"] = 0,
|
||||
["f"] = 0,
|
||||
["force"] = 0,
|
||||
["c"] = 0,
|
||||
["clean"] = 0,
|
||||
["s"] = 1,
|
||||
["source"] = 1,
|
||||
["C"] = 0,
|
||||
["cascade"] = 0,
|
||||
})
|
||||
|
||||
local parsed, errorMessage = cliparse.parse(...)
|
||||
|
||||
if not parsed then
|
||||
print(("\27[91m%s\n\27[0mExiting."):format(errorMessage))
|
||||
return
|
||||
end
|
||||
|
||||
local command = parsed.args[1]
|
||||
|
||||
if not command then
|
||||
print("\27[91mNo command specified.\n\27[0mExiting.")
|
||||
return
|
||||
end
|
||||
|
||||
if
|
||||
not (
|
||||
command == "install"
|
||||
or command == "remove"
|
||||
or command == "update"
|
||||
or command == "list"
|
||||
or command == "repo-list"
|
||||
or command == "repo-add"
|
||||
or command == "repo-remove"
|
||||
or command == "info"
|
||||
)
|
||||
then
|
||||
print(("\27[91mInvalid command: %s\n\27[0mExiting."):format(command))
|
||||
return
|
||||
end
|
||||
|
||||
local packages = parsed.args
|
||||
table.remove(packages, 1)
|
||||
-- Remove the command from the actual package list
|
||||
-- local result, data, failure
|
||||
do
|
||||
local function check(condition, message)
|
||||
if not condition then
|
||||
print(message)
|
||||
failure = true
|
||||
end
|
||||
end
|
||||
|
||||
if parsed.flags.u or parsed.flags["update-registry"] then
|
||||
terminal.write("Updating registry...")
|
||||
result, data = getFile("https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/Pre-Alpha-3.0.0/ag2/registry.json")
|
||||
check(result, "\27[91mFailed to get registry: " .. data .. "\27[0m")
|
||||
local handle, errorMessage = fs.open("/ag2/registry.json", "w")
|
||||
check(handle, "\27[91mFailed to open write handle to registry: " .. errorMessage .. "\27[0m")
|
||||
local success, errorMessage = handle:write(data)
|
||||
check(success, "\27[91mFailed to write to registry: " .. errorMessage .. "\27[0m")
|
||||
handle:close()
|
||||
else
|
||||
result, data = getFile("/ag2/registry.json")
|
||||
check(result, "\27[91mFailed to get registry: " .. data .. "\27[0m")
|
||||
end
|
||||
end
|
||||
|
||||
local success, registry = pcall(function()
|
||||
return json.decode(data)
|
||||
end)
|
||||
if not success then
|
||||
print(("\27[91mFailed to parse registry: %s\n\27[0mExiting."):format(registry))
|
||||
return
|
||||
end
|
||||
|
||||
local function getServersidePackageConfig(source, package)
|
||||
local success, data = getFile(fs.concat(source, "/ag2.json"))
|
||||
if not success then
|
||||
return false, ("\27[91mFailed to get package config (ag2.json) of package '%s': " .. data .. "\27[0m"):format(package)
|
||||
end
|
||||
local success, packageConfig = pcall(function()
|
||||
return json.decode(data)
|
||||
end)
|
||||
if not success then
|
||||
return false, ("\27[91mFailed to parse package config (ag2.json) of package '%s': " .. packageConfig .. "\27[0m"):format(package)
|
||||
end
|
||||
if not packageConfig[package] then
|
||||
return false, ("\27[91mRepository package config (ag2.json) does not contain package '%s'.\27[0m"):format(package)
|
||||
end
|
||||
return packageConfig[package]
|
||||
end
|
||||
|
||||
-- Check if everything is valid
|
||||
failure = false
|
||||
local dependencyCounter = 0
|
||||
local previousI = 1 -- See 190
|
||||
::RESETLOOP::
|
||||
if command == "install" then
|
||||
for i = previousI, #packages do
|
||||
if not packages[i] then
|
||||
-- When packages are removed, the last packages can end up reading as nil
|
||||
goto SKIP
|
||||
end
|
||||
local otherPackages = table.copy(packages)
|
||||
table.remove(otherPackages, i)
|
||||
-- This is to check if the package can be found in the others, or in other words, checking for duplicates
|
||||
if table.find(otherPackages, packages[i]) then
|
||||
print(("\27[93mDuplicate package specified (%s), skipping\27[0m"):format(packages[i]))
|
||||
table.remove(packages, i)
|
||||
i = i - 1
|
||||
goto SKIP
|
||||
end
|
||||
local source
|
||||
if parsed.s or parsed.source then
|
||||
source = parsed.s or parsed.source
|
||||
else
|
||||
source = registry[packages[i]]
|
||||
end
|
||||
if not source then
|
||||
print("\27[91mCould not find package in registry and no source provided: " .. packages[i] .. "\27[0m")
|
||||
failure = true
|
||||
goto SKIP
|
||||
end
|
||||
local packageConfig, errorMessage = getServersidePackageConfig(source, packages[i])
|
||||
if not packageConfig then
|
||||
failure = true
|
||||
print(errorMessage)
|
||||
goto SKIP
|
||||
end
|
||||
if packageConfig.type == "group" then
|
||||
table.remove(packages, i)
|
||||
for _, package in ipairs(packageConfig.packages) do
|
||||
table.insert(packages, package)
|
||||
end
|
||||
previousI = i
|
||||
goto RESETLOOP
|
||||
-- Apparently "for i = 1, n" loops don't change when n changes. So when the table gets extended, packages near the end won't get picked up.
|
||||
-- This is why it is needed to restart the loop.
|
||||
elseif packageConfig.type == "virtual-package" then
|
||||
print(("Installing virtual package %s"):format(packages[i]))
|
||||
local pkgAskText = ("Select a package by typing in its number: 1) %s"):format(packageConfig.packages[1])
|
||||
-- This is all a silly workaround to place commas correctly
|
||||
for i = 2, #packageConfig.packages do
|
||||
pkgAskText = pkgAskText .. (", %d) %s"):format(i, packageConfig.packages[i])
|
||||
end
|
||||
print(pkgAskText)
|
||||
::RETRY::
|
||||
local packageSel = terminal.read()
|
||||
if not tonumber(packageSel) or tonumber(packageSel) % 1 ~= 0 then
|
||||
-- Is there really no better way to check for an int..?
|
||||
print("\27[93mNon-integer received - try again\27[0m")
|
||||
goto RETRY
|
||||
end
|
||||
if tonumber(packageSel) < 1 or tonumber(packageSel) > #packageConfig.packages then
|
||||
print("\27[93mInteger out of range - try again\27[0m")
|
||||
end
|
||||
packages[i] = packageConfig.packages[tonumber(packageSel)]
|
||||
i = i - 1
|
||||
goto SKIP
|
||||
end
|
||||
if fs.exists(("/ag2/pkg/%s.json"):format(packages[i])) then
|
||||
print(("\27[93mPackage %s is already installed, skipping\27[0m"):format(packages[i]))
|
||||
table.remove(packages, i)
|
||||
i = i - 1
|
||||
goto SKIP
|
||||
end
|
||||
if packageConfig.dependencies then
|
||||
for _, dependency in ipairs(packageConfig.dependencies) do
|
||||
table.insert(packages, i + 1, dependency)
|
||||
dependencyCounter = dependencyCounter + 1
|
||||
end
|
||||
end
|
||||
-- TODO: Add checks for conflicting packages
|
||||
::SKIP::
|
||||
end
|
||||
elseif command == "remove" then
|
||||
::JUMPBACK::
|
||||
local doJumpBack = false
|
||||
for i = 1, #packages do
|
||||
if not fs.exists(("/ag2/pkg/%s.json"):format(packages[i])) then
|
||||
if parsed.s or parsed.source then
|
||||
source = parsed.s or parsed.source
|
||||
else
|
||||
source = registry[package]
|
||||
end
|
||||
if source then
|
||||
local packageConfig = getServersidePackageConfig(source, packages[i])
|
||||
if packageConfig then
|
||||
if packageConfig.type == "virtual-package" or packageConfig.type == "group" then
|
||||
table.remove(packages, i)
|
||||
for _, groupPackage in ipairs(packageConfig.packages) do
|
||||
table.insert(packages, groupPackage)
|
||||
goto GOAHEAD
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
print(("\27[93mPackage %s is not installed, skipping\27[0m"):format(packages[i]))
|
||||
table.remove(packages, i)
|
||||
i = i - 1
|
||||
::GOAHEAD::
|
||||
end
|
||||
end
|
||||
|
||||
-- I was originally gonna add this in the dependency cascade section, but realized it could shorten the normal dependency check code a bit
|
||||
local dependencyList = {}
|
||||
for _, packageConfig in ipairs(fs.list("/ag2/pkg/")) do
|
||||
local package = packageConfig:sub(1, -6)
|
||||
-- I'm not adding error handling here because if this fails then fuck you for touching the files by hand and good luck figuring this shit out
|
||||
local _, data = getFile(("/ag2/pkg/%s.json"):format(package))
|
||||
data = json.decode(data)
|
||||
dependencyList[package] = data.dependencies
|
||||
end
|
||||
|
||||
for _, package in ipairs(packages) do
|
||||
if dependencyList[package] then
|
||||
-- Check if all the deps are no longer needed and if they're auto-installed and stuff
|
||||
for _, dependency in pairs(dependencyList[package]) do
|
||||
if fs.exists(("/ag2/pkg/%s.json"):format(dependency)) then
|
||||
local _, data = getFile(("/ag2/pkg/%s.json"):format(dependency))
|
||||
data = json.decode(data)
|
||||
if data.autoInstalled
|
||||
and not table.find(packages, dependency) -- Just to prevent dependency loops and issues when re-checking the packages after jumpback
|
||||
then
|
||||
dependencyCounter = dependencyCounter + 1
|
||||
table.insert(packages, dependency)
|
||||
end
|
||||
else
|
||||
-- It could still be a group or a vpackage, and checking that is the job of the loop 2 loops back
|
||||
table.insert(packages, dependency)
|
||||
doJumpBack = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Check for cascading dependencies
|
||||
for packageName, dependencies in pairs(dependencyList) do
|
||||
if not table.find(packages, packageName) then
|
||||
for _, dependency in ipairs(dependencies) do
|
||||
if table.find(packages, dependency) then
|
||||
if parsed.flags.cascade or parsed.flags.C then
|
||||
table.insert(packages, packageName)
|
||||
dependencyCounter = dependencyCounter + 1
|
||||
doJumpBack = true
|
||||
-- Listen, I'm so sorry for this abhorrent bullshit code, but the newly added packages have to get checked one way or another and hopefully this is readable enough.
|
||||
else
|
||||
-- The Pyramids of Giza were built entirely out of silver. No they weren't...
|
||||
print(("\27[93mPackage %s is depended on by %s, cannot uninstall without --cascade\27[0m"):format(dependency, packageName))
|
||||
failure = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if doJumpBack then
|
||||
goto JUMPBACK
|
||||
-- IT'S NOT SPAGHETTI SHUT UP SHUT UP SHU
|
||||
end
|
||||
end
|
||||
-- TODO: Add checks for the other commands
|
||||
|
||||
if #packages == 0 then
|
||||
print("\27[93mNo packages selected.\n\27[0mExiting.")
|
||||
return
|
||||
end
|
||||
if failure then
|
||||
print("Exiting.")
|
||||
return
|
||||
end
|
||||
|
||||
if command == "install" then
|
||||
if dependencyCounter == 1 then
|
||||
print("\27[93m1 dependency pulled in.\27[0m")
|
||||
elseif dependencyCounter >= 2 then
|
||||
print(("\27[93m%d dependencies pulled in.\27[0m"):format(dependencyCounter))
|
||||
end
|
||||
print("Packages that will be installed:")
|
||||
print(table.concat(packages, ", "))
|
||||
local answer = terminal.read({prefix = "\nContinue? [Y/n] "})
|
||||
if answer:lower() == "n" then
|
||||
print("Exiting.")
|
||||
return
|
||||
end
|
||||
|
||||
for _, package in ipairs(packages) do
|
||||
local source
|
||||
if parsed.s or parsed.source then
|
||||
source = parsed.s or parsed.source
|
||||
else
|
||||
source = registry[package]
|
||||
end
|
||||
print(("Installing %s..."):format(package))
|
||||
local _, data = getFile(fs.concat(source, "/ag2.json"))
|
||||
local packageConfig = json.decode(data)[package]
|
||||
if packageConfig.directories then
|
||||
for _, directory in ipairs(packageConfig.directories) do
|
||||
print((" Creating directory %s..."):format(directory))
|
||||
fs.makeDirectory(directory)
|
||||
end
|
||||
end
|
||||
if packageConfig.files then
|
||||
for _, file in ipairs(packageConfig.files) do
|
||||
::RETRY::
|
||||
print((" Downloading file %s..."):format(file))
|
||||
local success, data = getFile(fs.concat(source, file))
|
||||
|
||||
if not success then
|
||||
print(("\27[91mFailed to get file '%s' of package '%s': " .. data .. "\27[0m"):format(file, package))
|
||||
local answer = terminal.read({prefix = "Abort, Retry, Skip? [a/R/s]"})
|
||||
if answer:lower() == "a" then
|
||||
print("Exiting.")
|
||||
return
|
||||
elseif answer:lower() == "s" then
|
||||
print((" \27[93mSkipped file %s.\27[0m"):format(file))
|
||||
goto SKIP
|
||||
else
|
||||
goto RETRY
|
||||
end
|
||||
end
|
||||
|
||||
if fs.exists(file) then
|
||||
print(("\27[93mFile '%s' already exists.\27[0m"):format(file))
|
||||
local answer = terminal.read({prefix = "Abort, Overwrite, Skip? [a/O/s]"})
|
||||
if answer:lower() == "a" then
|
||||
print("Exiting.")
|
||||
return
|
||||
elseif answer:lower() == "s" then
|
||||
print((" \27[93mSkipped file %s.\27[0m"):format(file))
|
||||
goto SKIP
|
||||
end
|
||||
end
|
||||
|
||||
local handle, errorMessage = fs.open(file, "w")
|
||||
if not handle then
|
||||
print(("\27[91mFailed to open write handle to file '%s': " .. errorMessage .. "\27[0m"):format(file))
|
||||
local answer = terminal.read({prefix = "Abort, Retry, Skip? [a/R/s]"})
|
||||
if answer:lower() == "a" then
|
||||
print("Exiting.")
|
||||
return
|
||||
elseif answer:lower() == "s" then
|
||||
print((" \27[93mSkipped file %s.\27[0m"):format(file))
|
||||
goto SKIP
|
||||
else
|
||||
goto RETRY
|
||||
end
|
||||
end
|
||||
|
||||
local success, errorMessage = handle:write(data)
|
||||
if not success then
|
||||
handle:close()
|
||||
print(("\27[91mFailed to write to file '%s': " .. errorMessage .. "\27[0m"):format(file))
|
||||
local answer = terminal.read({prefix = "Abort, Retry, Skip? [a/R/s]"})
|
||||
if answer:lower() == "a" then
|
||||
print("Exiting.")
|
||||
return
|
||||
elseif answer:lower() == "s" then
|
||||
print((" \27[93mSkipped file %s.\27[0m"):format(file))
|
||||
goto SKIP
|
||||
else
|
||||
goto RETRY
|
||||
end
|
||||
end
|
||||
|
||||
handle:close()
|
||||
|
||||
::SKIP::
|
||||
end
|
||||
end
|
||||
|
||||
print(" Writing tracking file...")
|
||||
if not fs.exists("/ag2/pkg/") then
|
||||
fs.makeDirectory("/ag2/pkg/")
|
||||
-- Technically this would break if /ag2/pkg/ was a file, but... why would it be a file?
|
||||
end
|
||||
|
||||
-- TODO: Make functions for reading from and writing to a file with error handling since this is really repetitive
|
||||
::RETRY::
|
||||
local handle, errorMessage = fs.open(("/ag2/pkg/%s.json"):format(package), "w")
|
||||
if not handle then
|
||||
print(("\27[91mFailed to open write handle to file '/ag2/pkg/%s.json': " .. errorMessage .. "\27[0m"):format(package))
|
||||
local answer = terminal.read({prefix = "Abort, Retry, Skip? [a/R/s]"})
|
||||
if answer:lower() == "a" then
|
||||
print("Exiting.")
|
||||
return
|
||||
elseif answer:lower() == "s" then
|
||||
print((" \27[93mSkipped file /ag2/pkg/%s.json.\27[0m"):format(package))
|
||||
goto SKIP
|
||||
else
|
||||
goto RETRY
|
||||
end
|
||||
end
|
||||
|
||||
local packageData = {
|
||||
name = package,
|
||||
version = packageConfig.version,
|
||||
autoInstalled = false,
|
||||
-- TODO: Make the above actually work
|
||||
dependencies = packageConfig.dependencies,
|
||||
conflicts = packageConfig.conflicts,
|
||||
files = packageConfig.files,
|
||||
directories = packageConfig.directories,
|
||||
config = packageConfig.config
|
||||
}
|
||||
|
||||
local trackingFile = json.encode(packageData)
|
||||
|
||||
local success, errorMessage = handle:write(trackingFile)
|
||||
if not success then
|
||||
handle:close()
|
||||
print(("\27[91mFailed to write to file '/ag2/pkg/%s.json': " .. errorMessage .. "\27[0m"):format(package))
|
||||
local answer = terminal.read({prefix = "Abort, Retry, Skip? [a/R/s]"})
|
||||
if answer:lower() == "a" then
|
||||
print("Exiting.")
|
||||
return
|
||||
elseif answer:lower() == "s" then
|
||||
print((" \27[93mSkipped file /ag2/pkg/%s.json.\27[0m"):format(package))
|
||||
goto SKIP
|
||||
else
|
||||
goto RETRY
|
||||
end
|
||||
else
|
||||
handle:close()
|
||||
end
|
||||
::SKIP::
|
||||
end
|
||||
elseif command == "remove" then
|
||||
if dependencyCounter == 1 then
|
||||
print("\27[93m1 orphaned dependency will be removed.\27[0m")
|
||||
elseif dependencyCounter >= 2 then
|
||||
print(("\27[93m%d orphaned dependencies will be removed.\27[0m"):format(dependencyCounter))
|
||||
end
|
||||
print("Packages that will be removed:")
|
||||
print(table.concat(packages, ", "))
|
||||
local answer = terminal.read({prefix = "\nContinue? [Y/n] "})
|
||||
if answer:lower() == "n" then
|
||||
print("Exiting.")
|
||||
return
|
||||
end
|
||||
for _, package in ipairs(packages) do
|
||||
-- See line 263
|
||||
local _, data = getFile(("/ag2/pkg/%s.json"):format(package))
|
||||
data = json.decode(data)
|
||||
if data.files then
|
||||
for _, file in ipairs(data.files) do
|
||||
print((" Removing file %s..."):format(file))
|
||||
fs.remove(file) -- I cannot think of how this could fail. If you can, please add error handling here
|
||||
end
|
||||
end
|
||||
if data.directories then
|
||||
for _, directory in ipairs(data.directories) do
|
||||
if fs.isDirectory(directory) then
|
||||
if next(fs.list(directory)) == nil then
|
||||
-- Apparently THAT's the best way to check if a table is empty in Lua. Alright I guess.
|
||||
print((" Removing directory %s..."):format(directory))
|
||||
fs.remove(directory)
|
||||
else
|
||||
print((" Directory %s specified by package %s still has something in it, skipping"):format(directory))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
print(" Removing tracking file...")
|
||||
fs.remove(("/ag2/pkg/%s.json"):format(package)) -- See line 500
|
||||
end
|
||||
end
|
||||
print("Operation completed successfully.")
|
||||
@@ -1,6 +1,6 @@
|
||||
local packages = {...}
|
||||
local command = packages[1]
|
||||
table.remove(packages, 1)
|
||||
local command = table.remove(packages,1)
|
||||
local shell = require("shell")
|
||||
local fs = require("filesystem")
|
||||
local component = require("component")
|
||||
local agReg = require("/argentum/registry.cfg")
|
||||
@@ -9,7 +9,7 @@ if not command then
|
||||
return
|
||||
end
|
||||
if not component.list("internet")() then
|
||||
print("\27[91mThis program requires an internet card to run.")
|
||||
print("\27[91mThis program requires an internet card to run.\27[0m")
|
||||
return
|
||||
end
|
||||
local internet = component.internet
|
||||
@@ -69,12 +69,12 @@ local function getAgConfig(package, source)
|
||||
source = source or agReg[package]
|
||||
local data, errorMessage = getFile(source .. "argentum.cfg")
|
||||
if not data or data == "" then
|
||||
print("\27[91mCould not fetch Ag config: " .. (errorMessage or "returned nil data"))
|
||||
print("\27[91mCould not fetch Ag config: " .. (errorMessage or "returned nil data") .. "\27[0m")
|
||||
return false
|
||||
end
|
||||
local func, errorMessage = load(data, "=argentum.cfg", "bt", {})
|
||||
if not func then
|
||||
print("\27[91mCould not fetch Ag config: " .. errorMessage .. "\nPlease contact the package owner.")
|
||||
print("\27[91mCould not fetch Ag config: " .. errorMessage .. "\nPlease contact the package owner.\27[0m")
|
||||
return false
|
||||
end
|
||||
local agcfg
|
||||
@@ -82,22 +82,22 @@ local function getAgConfig(package, source)
|
||||
agcfg = func()
|
||||
end)
|
||||
if not status then
|
||||
print("\27[91mCould not fetch Ag config: " .. errorMessage .. "\nPlease contact the package owner.")
|
||||
print("\27[91mCould not fetch Ag config: " .. errorMessage .. "\nPlease contact the package owner.\27[0m")
|
||||
return false
|
||||
end
|
||||
if not agcfg[package] or not agcfg[package].maindir or not agcfg[package].directories or not agcfg[package].files or not agcfg[package].version then
|
||||
local response = ("\27[91mAg config of " .. package .. " is improperly configured.\nPlease contact the package owner.")
|
||||
local response = "\27[91mAg config of " .. package .. " is improperly configured.\nPlease contact the package owner.\27[0m"
|
||||
end
|
||||
return agcfg
|
||||
end
|
||||
|
||||
local function doChecks(package)
|
||||
if not agReg[package] and not source then
|
||||
print("\27[91mPackage " .. package .. " does not exist.")
|
||||
print("\27[91mPackage " .. package .. " does not exist.\27[0m")
|
||||
return false
|
||||
end
|
||||
if fs.exists("/argentum/store/" .. package) then
|
||||
print("\27[91mPackage " .. package .. " is already installed.")
|
||||
print("\27[91mPackage " .. package .. " is already installed.\27[0m")
|
||||
return false
|
||||
end
|
||||
agcfg = getAgConfig(package, source)
|
||||
@@ -107,7 +107,7 @@ local function doChecks(package)
|
||||
if agcfg[package].dependencies then
|
||||
for _, dependency in ipairs(agcfg[package].dependencies) do
|
||||
if not agReg[dependency] and not agcfg[dependency] then
|
||||
local response = read(nil, "\27[91mPackage " .. package .. " requires dependency " .. dependency .. " that does not exist.\n[A - Abort/s - Skip]")
|
||||
local response = terminal.read({prefix = "\27[91mPackage " .. package .. " requires dependency " .. dependency .. " that does not exist.\n[A - Abort/s - Skip]\27[0m"})
|
||||
if response:lower() ~= "s" then
|
||||
fs.remove("/argentum/store/" .. package)
|
||||
return false
|
||||
@@ -132,24 +132,21 @@ local function lpad(str, len, char)
|
||||
return string.rep(char, len - #str) .. str
|
||||
end
|
||||
|
||||
local gpu = component.gpu
|
||||
local width,height = gpu.getResolution()
|
||||
local function progress(package,progress)
|
||||
local info = string.format("%s %s%%",package,lpad(math.floor(progress*100),2))
|
||||
local width, height = terminal.getResolution()
|
||||
|
||||
info=info..string.rep(" ",width-#info)
|
||||
local progX = math.floor(progress*width)
|
||||
gpu.setBackground(0x00FF00)
|
||||
gpu.setForeground(0x000000)
|
||||
gpu.set(1,height,info:sub(1,progX))
|
||||
gpu.setBackground(0x000000)
|
||||
gpu.setForeground(0xFFFFFF)
|
||||
gpu.set(progX+1,height,info:sub(progX+1))
|
||||
local function progress(package, progress)
|
||||
terminal.write("\x1b[s")
|
||||
local info = string.format("%s %s%%", package, lpad(math.floor(progress * 100), 2))
|
||||
info = info .. string.rep(" ", width - #info)
|
||||
local progX = math.floor(progress * width)
|
||||
terminal.write("\x1b[42m\x1b[30m" .. info:sub(1, progX) .. "\x1b[40m\x1b[37m" .. info:sub(progX + 1) .. "\x1b[0m")
|
||||
terminal.write("\x1b[u")
|
||||
end
|
||||
|
||||
local function clearProgress()
|
||||
gpu.setBackground(0x000000)
|
||||
gpu.fill(1,height,width,1," ")
|
||||
terminal.write("\x1b[s")
|
||||
terminal.write("\r\x1b[40m" .. string.rep(" ", width) .. "\x1b[0m\r")
|
||||
terminal.write("\x1b[u")
|
||||
end
|
||||
|
||||
local function installPackage(package, overwriteFlag)
|
||||
@@ -166,7 +163,7 @@ local function installPackage(package, overwriteFlag)
|
||||
if agcfg[package].dependencies then
|
||||
for _, dependency in ipairs(agcfg[package].dependencies) do
|
||||
if not agReg[dependency] and not agcfg[dependency] then
|
||||
local response = read(nil, "\27[91mPackage " .. package .. " requires dependency " .. dependency .. " that does not exist.\n[A - Abort/s - Skip]")
|
||||
local response = terminal.read({prefix = "\27[91mPackage " .. package .. " requires dependency " .. dependency .. " that does not exist.\n[A - Abort/s - Skip]\27[0m"})
|
||||
if response:lower() ~= "s" then
|
||||
fs.remove("/argentum/store/" .. package)
|
||||
return false
|
||||
@@ -199,7 +196,7 @@ local function installPackage(package, overwriteFlag)
|
||||
local data, errorMessage = getFile(source .. agcfg[package].maindir .. file)
|
||||
if not data then
|
||||
clearProgress()
|
||||
local response = read(nil, "\27[91mCould not fetch " .. file .. ": " .. errorMessage .. "\n\27[0m[a - Abort/R - Retry/s - Skip]")
|
||||
local response = terminal.read({prefix = "\27[91mCould not fetch " .. file .. ": " .. errorMessage .. "\n\27[0m[a - Abort/R - Retry/s - Skip]"})
|
||||
if response:lower() == "a" then
|
||||
fs.remove("/argentum/store/" .. package)
|
||||
return false
|
||||
@@ -218,7 +215,7 @@ local function installPackage(package, overwriteFlag)
|
||||
else
|
||||
packageStore = packageStore .. "\nA" .. file
|
||||
end
|
||||
local handle = fs.open(file, "w")
|
||||
local handle, err = fs.open(file, "w")
|
||||
handle:write(data)
|
||||
handle:close()
|
||||
::skip::
|
||||
@@ -234,7 +231,7 @@ end
|
||||
local function removePackage(package)
|
||||
print("Removing " .. package .. "...")
|
||||
if not fs.exists("/argentum/store/" .. package .. "/package.cfg") then
|
||||
print("\27[91mLocal Ag config of " .. package .. " does not exist.")
|
||||
print("\27[91mLocal Ag config of " .. package .. " does not exist.\27[0m")
|
||||
return false
|
||||
end
|
||||
local handle, data, tmpdata = fs.open("/argentum/store/" .. package .. "/package.cfg", "r"), "", nil
|
||||
@@ -258,7 +255,7 @@ local function removePackage(package)
|
||||
local result, errorMessage = fs.remove(line:sub(2))
|
||||
if not result then
|
||||
clearProgress()
|
||||
local response = read(nil, "\27[91mFailed to remove " .. line:sub(2) .. ": " .. errorMessage .. "\n\27[0m[a - Abort/r - Retry/S - Skip]")
|
||||
local response = terminal.read({prefix = "\27[91mFailed to remove " .. line:sub(2) .. ": " .. errorMessage .. "\n\27[0m[a - Abort/r - Retry/S - Skip]"})
|
||||
if response:lower() == "a" then
|
||||
return false
|
||||
elseif response:lower() == "r" then
|
||||
@@ -274,7 +271,7 @@ local function removePackage(package)
|
||||
local handle, data, tmpdata = fs.open("/argentum/store/" .. package .. "/files/" .. line:sub(2), "r"), "", nil
|
||||
if not handle then
|
||||
clearProgress()
|
||||
local response = read(nil, "\27[91mFailed to revert " .. line:sub(2) .. ": " .. data .. "\n\27[0m[a - Abort/R - Retry/s - Skip]") -- this is pretty stupid but i think the error message would get pushed to data
|
||||
local response = terminal.read({prefix = "\27[91mFailed to revert " .. line:sub(2) .. ": " .. data .. "\n\27[0m[a - Abort/R - Retry/s - Skip]"}) -- this is pretty stupid but i think the error message would get pushed to data
|
||||
if response:lower() == "a" then
|
||||
return false
|
||||
elseif response:lower() == "s" then
|
||||
@@ -344,7 +341,7 @@ if command == "install" then
|
||||
handle:write(newRegistry)
|
||||
handle:close()
|
||||
else
|
||||
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil"))
|
||||
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil") .. "\27[0m")
|
||||
end
|
||||
agReg = require("/argentum/registry.cfg")
|
||||
while true do
|
||||
@@ -360,7 +357,7 @@ if command == "install" then
|
||||
local answer
|
||||
if #fails == 0 then
|
||||
print("Packages that will be installed: " .. table.concat(packageList, ", "))
|
||||
if read(nil, "Would you like to proceed? [Y/n] "):lower() == "n" then
|
||||
if terminal.read({prefix = "Would you like to proceed? [Y/n] "}):lower() == "n" then
|
||||
return
|
||||
end
|
||||
elseif #packageList == 0 then
|
||||
@@ -370,7 +367,7 @@ if command == "install" then
|
||||
print("Some packages cannot be installed.")
|
||||
print("Packages that will be installed: " .. table.concat(packageList, ", "))
|
||||
print("Packages that cannot be installed: " .. table.concat(fails, ", "))
|
||||
if read(nil, "Would you like to proceed? [y/N] "):lower() ~= "y" then
|
||||
if terminal.read({prefix = "Would you like to proceed? [y/N] "}):lower() ~= "y" then
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -402,19 +399,19 @@ elseif command == "remove" then
|
||||
end
|
||||
while true do
|
||||
if not fs.exists("/argentum/store/" .. packages[i]) then
|
||||
print("\27[91mPackage " .. packages[i] .. " is not installed.")
|
||||
print("\27[91mPackage " .. packages[i] .. " is not installed.\27[0m")
|
||||
table.insert(fails, packages[i])
|
||||
table.remove(packageList, table.find(packageList, packages[i]))
|
||||
table.remove(packages, table.find(packages, packages[i]))
|
||||
i = i - 1
|
||||
elseif packages[i] == "halyde" then -- yes, this stuff is hard-coded.
|
||||
print("\27[91mFor obvious reasons, you can't uninstall Halyde.")
|
||||
print("\27[91mFor obvious reasons, you can't uninstall Halyde.\27[0m")
|
||||
table.insert(fails, packages[i])
|
||||
table.remove(packageList, table.find(packageList, packages[i]))
|
||||
table.remove(packages, table.find(packages, packages[i]))
|
||||
i = i - 1
|
||||
elseif packages[i] == "argentum" then
|
||||
print("\27[91mFor obvious reasons, you can't uninstall Argentum.")
|
||||
print("\27[91mFor obvious reasons, you can't uninstall Argentum.\27[0m")
|
||||
table.insert(fails, packages[i])
|
||||
table.remove(packageList, table.find(packageList, packages[i]))
|
||||
table.remove(packages, table.find(packages, packages[i]))
|
||||
@@ -452,7 +449,7 @@ elseif command == "remove" then
|
||||
local answer
|
||||
if #fails == 0 then
|
||||
print("Packages that will be removed: " .. table.concat(packageList, ", "))
|
||||
if read(nil, "Would you like to proceed? [Y/n] "):lower() == "n" then
|
||||
if terminal.read({prefix = "Would you like to proceed? [Y/n] "}):lower() == "n" then
|
||||
return
|
||||
end
|
||||
elseif #packageList == 0 then
|
||||
@@ -462,7 +459,7 @@ elseif command == "remove" then
|
||||
print("Some packages cannot be removed.")
|
||||
print("Packages that will be removed: " .. table.concat(packageList, ", "))
|
||||
print("Packages that cannot be removed: " .. table.concat(fails, ", "))
|
||||
if read(nil, "Would you like to proceed? [y/N] "):lower() ~= "y" then
|
||||
if terminal.read({prefix = "Would you like to proceed? [y/N] "}):lower() ~= "y" then
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -495,7 +492,7 @@ elseif command == "update" then
|
||||
handle:write(newRegistry)
|
||||
handle:close()
|
||||
else
|
||||
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil"))
|
||||
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil") .. "\27[0m")
|
||||
end
|
||||
agReg = require("/argentum/registry.cfg")
|
||||
if not packages[1] then
|
||||
@@ -541,7 +538,7 @@ elseif command == "update" then
|
||||
table.remove(packages, table.find(packages, packages[i]))
|
||||
i = i - 1
|
||||
else
|
||||
print(packages[i].." is out of date [\x1b[93m"..version.."\x1b[39m < \x1b[92m"..agcfg[packages[i]].version.."\x1b[39m]")
|
||||
print(packages[i].." is out of date [\x1b[93m"..version.."\x1b[0m < \x1b[92m"..agcfg[packages[i]].version.."\x1b[0m")
|
||||
end
|
||||
end
|
||||
i = i + 1
|
||||
@@ -560,14 +557,14 @@ elseif command == "update" then
|
||||
end
|
||||
elseif #fails == 0 then
|
||||
print("Packages that will be updated: " .. table.concat(packageList, ", "))
|
||||
if read(nil, "Would you like to proceed? [Y/n] "):lower() == "n" then
|
||||
if terminal.read({prefix = "Would you like to proceed? [Y/n] "}):lower() == "n" then
|
||||
return
|
||||
end
|
||||
else
|
||||
print("Some packages cannot be updated.")
|
||||
print("Packages that will be updated: " .. table.concat(packageList, ", "))
|
||||
print("Packages that cannot be updated: " .. table.concat(fails, ", "))
|
||||
if read(nil, "Would you like to proceed? [y/N] "):lower() ~= "y" then
|
||||
if terminal.read({prefix = "Would you like to proceed? [y/N] "}):lower() ~= "y" then
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -630,7 +627,7 @@ elseif command == "info" then
|
||||
handle:write(newRegistry)
|
||||
handle:close()
|
||||
else
|
||||
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil"))
|
||||
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil") .. "\27[0m")
|
||||
end
|
||||
agReg = require("/argentum/registry.cfg")
|
||||
if not agReg[packages[1]] and not source then
|
||||
@@ -677,7 +674,7 @@ elseif command == "list" then
|
||||
handle:write(newRegistry)
|
||||
handle:close()
|
||||
else
|
||||
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil"))
|
||||
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil") .. "\27[0m")
|
||||
end
|
||||
agReg = require("/argentum/registry.cfg")
|
||||
local sortedPackages = {}
|
||||
@@ -0,0 +1,334 @@
|
||||
local fs = require("filesystem")
|
||||
local shell = require("shell")
|
||||
local gpu = require("component").gpu
|
||||
local event = require("event")
|
||||
local computer = require("computer")
|
||||
local ocelot = require("component").ocelot
|
||||
|
||||
local resX, resY = gpu.getResolution()
|
||||
local textBuffer = gpu.allocateBuffer(resX, resY - 1)
|
||||
|
||||
local args = {...}
|
||||
local file = args[1]
|
||||
if not file then
|
||||
print("\x1b[91mEnter a file name.")
|
||||
return
|
||||
end
|
||||
if fs.isDirectory(file) then
|
||||
print("\x1b[91mThe specified file is a directory.")
|
||||
return
|
||||
end
|
||||
|
||||
if file:sub(1, 1) ~= "/" then
|
||||
file = fs.concat(shell.getWorkingDirectory(), file)
|
||||
end
|
||||
|
||||
local data = ""
|
||||
if fs.exists(file) then
|
||||
local handle = fs.open(file)
|
||||
local tmpdata
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge or math.maxinteger)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
end
|
||||
|
||||
local lines = {}
|
||||
for line in data:gmatch("[^\r\n]+") do
|
||||
table.insert(lines, line)
|
||||
end
|
||||
|
||||
local function renderText(xOffset, yOffset)
|
||||
gpu.setActiveBuffer(textBuffer)
|
||||
gpu.setBackground(0x000000)
|
||||
gpu.setForeground(0xFFFFFF)
|
||||
gpu.fill(1, 1, resX, resY - 1, " ")
|
||||
for i = yOffset + 1, #lines do
|
||||
gpu.set(1, i - yOffset, lines[i]:sub(xOffset + 1))
|
||||
end
|
||||
gpu.setActiveBuffer(0)
|
||||
gpu.bitblt(0, 1, 1, resX, resY - 1, textBuffer, 1, 1)
|
||||
end
|
||||
|
||||
local function addLine(pos)
|
||||
if pos <= #lines then
|
||||
for i = #lines, pos, -1 do
|
||||
lines[i + 1] = lines[i]
|
||||
end
|
||||
lines[pos] = ""
|
||||
else
|
||||
table.insert(lines, "")
|
||||
end
|
||||
end
|
||||
|
||||
local function removeLine(pos)
|
||||
length = #lines
|
||||
for i = pos + 1, length do
|
||||
lines[i - 1] = lines[i]
|
||||
end
|
||||
lines[length] = nil
|
||||
end
|
||||
|
||||
local function save()
|
||||
gpu.setForeground(0xFFFFFF)
|
||||
gpu.setBackground(0x000000)
|
||||
gpu.set(1, resY, "Enter a location to save:")
|
||||
|
||||
local savepath = file or ""
|
||||
local saveCursorX = 27 + #savepath
|
||||
local ready = false
|
||||
local eventArgs = {}
|
||||
|
||||
gpu.fill(27, resY, resX - 27, 1, " ")
|
||||
gpu.set(27, resY, savepath)
|
||||
gpu.setForeground(0x000000)
|
||||
gpu.setBackground(0xFFFFFF)
|
||||
gpu.set(saveCursorX, resY, " ")
|
||||
gpu.setForeground(0xFFFFFF)
|
||||
gpu.setBackground(0x000000)
|
||||
|
||||
repeat
|
||||
local shouldRender = false
|
||||
coroutine.yield()
|
||||
|
||||
eventArgs = {event.pull("key_down", 0)}
|
||||
if keyboard.keys[eventArgs[4]] == "enter" then
|
||||
ready = true
|
||||
end
|
||||
if keyboard.keys[eventArgs[4]] == "back" then
|
||||
savepath = string.sub(savepath, 1, #savepath - 1)
|
||||
if saveCursorX > 27 then
|
||||
saveCursorX = saveCursorX - 1
|
||||
end
|
||||
shouldRender = true
|
||||
end
|
||||
if not keyboard.keys.special[eventArgs[4]] and keyboard.keys[eventArgs[4]] then
|
||||
savepath = savepath .. (string.char(eventArgs[3]) or "")
|
||||
saveCursorX = saveCursorX + 1
|
||||
shouldRender = true
|
||||
end
|
||||
|
||||
if shouldRender then
|
||||
gpu.fill(27, resY, resX - 27, 1, " ")
|
||||
gpu.set(27, resY, savepath)
|
||||
gpu.setForeground(0x000000)
|
||||
gpu.setBackground(0xFFFFFF)
|
||||
gpu.set(saveCursorX, resY, " ")
|
||||
gpu.setForeground(0xFFFFFF)
|
||||
gpu.setBackground(0x000000)
|
||||
end
|
||||
until ready
|
||||
|
||||
gpu.fill(1, resY, resX, 1, " ")
|
||||
gpu.setForeground(0x000000)
|
||||
gpu.setBackground(0xFFFFFF)
|
||||
gpu.set(1, resY, "^X")
|
||||
gpu.set(10, resY, "^S")
|
||||
gpu.setForeground(0xFFFFFF)
|
||||
gpu.setBackground(0x000000)
|
||||
gpu.set(4, resY, "Exit")
|
||||
gpu.set(13, resY, "Save")
|
||||
|
||||
local text = table.concat(lines, "\n")
|
||||
local handle = fs.open(savepath, "w")
|
||||
handle:write(text)
|
||||
handle:close()
|
||||
file = savepath
|
||||
end
|
||||
|
||||
-- Initialize screen
|
||||
renderText(0, 0)
|
||||
gpu.setForeground(0x000000)
|
||||
gpu.setBackground(0xFFFFFF)
|
||||
gpu.set(1, resY, "^X")
|
||||
gpu.set(10, resY, "^S")
|
||||
gpu.setForeground(0xFFFFFF)
|
||||
gpu.setBackground(0x000000)
|
||||
gpu.set(4, resY, "Exit")
|
||||
gpu.set(13, resY, "Save")
|
||||
|
||||
local scrollX = 0
|
||||
local scrollY = 0
|
||||
local cursorX = 1 -- Absolute position, not accounting for scrolling
|
||||
local cursorY = 1
|
||||
local cursorWhite = true
|
||||
local oldTime = computer.uptime()
|
||||
|
||||
while true do
|
||||
local renderBufferFlag = false -- Flag to render the whole text buffer
|
||||
-- Handle events
|
||||
local previousCursorX -- Used for blackening the previous cursor location when the cursor is moved
|
||||
local previousCursorY
|
||||
coroutine.yield()
|
||||
local eventArgs = {}
|
||||
repeat
|
||||
eventArgs = {event.pull("key_down", 0)}
|
||||
|
||||
-- The logical solution here for flashing the cursor would be to set the timeout to 0.5, and, if the timeout is reached, change the color.
|
||||
-- However, that makes scrolling freeze the screen up completely.
|
||||
-- Thus, for flashing the cursor, a timer is needed.
|
||||
|
||||
if computer.uptime() >= oldTime + 0.5 then
|
||||
oldTime = computer.uptime()
|
||||
cursorWhite = not cursorWhite
|
||||
end
|
||||
|
||||
if next(eventArgs) ~= nil then
|
||||
cursorWhite = true
|
||||
oldTime = computer.uptime()
|
||||
end
|
||||
|
||||
if eventArgs[1] == "key_down" then
|
||||
-- Mouse events might be added later, that's why this if statement is here
|
||||
if keyboard.getCtrlDown() then
|
||||
-- Special commands
|
||||
if keyboard.keys[eventArgs[4]] == "x" then
|
||||
goto exit
|
||||
end
|
||||
if keyboard.keys[eventArgs[4]] == "s" then
|
||||
save()
|
||||
end
|
||||
else
|
||||
if keyboard.keys[eventArgs[4]] == "up" and cursorY > 1 then
|
||||
if cursorY - scrollY <= 1 then
|
||||
renderBufferFlag = true
|
||||
scrollY = scrollY - 1
|
||||
else
|
||||
if not previousCursorX and not previousCursorY then
|
||||
previousCursorX = cursorX
|
||||
previousCursorY = cursorY
|
||||
end
|
||||
end
|
||||
cursorY = cursorY - 1
|
||||
-- The cursor absolute position still has to be moved, even if on-screen it won't move
|
||||
if cursorX > string.len(lines[cursorY]) + 1 then -- cursor snapping, +1 to be 1 char in front of end of line
|
||||
cursorX = string.len(lines[cursorY]) + 1
|
||||
end
|
||||
end
|
||||
if keyboard.keys[eventArgs[4]] == "down" then
|
||||
if cursorY - scrollY >= resY - 1 then
|
||||
renderBufferFlag = true
|
||||
scrollY = scrollY + 1
|
||||
else
|
||||
if not previousCursorX and not previousCursorY then
|
||||
previousCursorX = cursorX
|
||||
previousCursorY = cursorY
|
||||
end
|
||||
end
|
||||
cursorY = cursorY + 1
|
||||
if cursorX > string.len(lines[cursorY]) + 1 then
|
||||
cursorX = string.len(lines[cursorY]) + 1
|
||||
end
|
||||
end
|
||||
if keyboard.keys[eventArgs[4]] == "left" and cursorX > 1 then
|
||||
if cursorX - scrollX <= 1 then
|
||||
renderBufferFlag = true
|
||||
scrollX = scrollX - 1
|
||||
else
|
||||
if not previousCursorX and not previousCursorY then
|
||||
previousCursorX = cursorX
|
||||
previousCursorY = cursorY
|
||||
end
|
||||
end
|
||||
cursorX = cursorX - 1
|
||||
end
|
||||
if keyboard.keys[eventArgs[4]] == "right" and cursorX < string.len(lines[cursorY]) + 1 then
|
||||
if cursorX - scrollX >= resX then
|
||||
renderBufferFlag = true
|
||||
scrollX = scrollX + 1
|
||||
else
|
||||
if not previousCursorX and not previousCursorY then
|
||||
previousCursorX = cursorX
|
||||
previousCursorY = cursorY
|
||||
end
|
||||
end
|
||||
cursorX = cursorX + 1
|
||||
end
|
||||
if not keyboard.keys.special[eventArgs[4]] then
|
||||
local line = lines[cursorY] or ""
|
||||
line = string.sub(line, 1, cursorX - 1) .. string.char(eventArgs[3]) .. string.sub(line, cursorX, -1)
|
||||
lines[cursorY] = line
|
||||
cursorX = cursorX + 1
|
||||
renderBufferFlag = true
|
||||
end
|
||||
if keyboard.keys[eventArgs[4]] == "back" then
|
||||
local line = lines[cursorY]
|
||||
local prevline = lines[cursorY - 1]
|
||||
if cursorX > 1 then
|
||||
line = string.sub(line, 1, cursorX - 2) .. string.sub(line, cursorX, -1) -- remove 1 char
|
||||
elseif prevline then
|
||||
prevline = prevline .. line -- copy line up to the next before removing it
|
||||
ocelot.log(prevline)
|
||||
line = nil
|
||||
end
|
||||
if line then
|
||||
lines[cursorY] = line
|
||||
else
|
||||
removeLine(cursorY)
|
||||
end
|
||||
lines[cursorY - 1] = prevline
|
||||
if not line then
|
||||
cursorY = cursorY - 1 -- this can only trigger if the line is not the first
|
||||
end
|
||||
if cursorX > 1 then
|
||||
cursorX = cursorX - 1
|
||||
end
|
||||
renderBufferFlag = true
|
||||
end
|
||||
if keyboard.keys[eventArgs[4]] == "enter" then
|
||||
addLine(cursorY + 1)
|
||||
cursorY = cursorY + 1
|
||||
cursorX = 1
|
||||
renderBufferFlag = true
|
||||
end
|
||||
end
|
||||
end
|
||||
until next(eventArgs) == nil
|
||||
local displayedCursorX = cursorX - scrollX
|
||||
local displayedCursorY = cursorY - scrollY
|
||||
local previousDisplayedCursorX -- What a mouthful
|
||||
local previousDisplayedCursorY
|
||||
if previousCursorX and previousCursorY then
|
||||
previousDisplayedCursorX = previousCursorX - scrollX
|
||||
previousDisplayedCursorY = previousCursorY - scrollY
|
||||
end
|
||||
|
||||
if renderBufferFlag then
|
||||
renderText(scrollX, scrollY)
|
||||
if cursorWhite then
|
||||
-- If the cursor is black, then there's no need to do anything because there is no cursor after calling renderText().
|
||||
gpu.setForeground(0x000000)
|
||||
gpu.setBackground(0xFFFFFF)
|
||||
local letter = gpu.get(displayedCursorX, displayedCursorY)
|
||||
gpu.set(displayedCursorX, displayedCursorY, letter)
|
||||
-- TODO: Account for scrolling
|
||||
end
|
||||
else
|
||||
if cursorWhite then
|
||||
if previousCursorX or previousCursorY then
|
||||
-- Remove old cursor
|
||||
gpu.setForeground(0xFFFFFF)
|
||||
gpu.setBackground(0x000000)
|
||||
local letter = gpu.get(previousDisplayedCursorX, previousDisplayedCursorY)
|
||||
gpu.set(previousDisplayedCursorX, previousDisplayedCursorY, letter)
|
||||
end
|
||||
|
||||
gpu.setForeground(0x000000)
|
||||
gpu.setBackground(0xFFFFFF)
|
||||
local letter = gpu.get(displayedCursorX, displayedCursorY)
|
||||
gpu.set(displayedCursorX, displayedCursorY, letter)
|
||||
else
|
||||
-- If renderText() hasn't been called, the cursor may still be white and need to be turned black.
|
||||
gpu.setForeground(0xFFFFFF)
|
||||
gpu.setBackground(0x000000)
|
||||
local letter = gpu.get(displayedCursorX, displayedCursorY)
|
||||
gpu.set(displayedCursorX, displayedCursorY, letter)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Cleanup
|
||||
::exit::
|
||||
gpu.freeBuffer(textBuffer)
|
||||
gpu.setActiveBuffer(0)
|
||||
terminal.clear()
|
||||
@@ -0,0 +1,19 @@
|
||||
local computer = require("computer")
|
||||
local cliparse = require("cliparse")
|
||||
|
||||
cliparse.config({
|
||||
["f"] = 1,
|
||||
["frequency"] = 1,
|
||||
["t"] = 1,
|
||||
["time"] = 1,
|
||||
})
|
||||
local parsed, err = cliparse.parse(...)
|
||||
if not parsed then
|
||||
return print("\x1b[91m" .. err .. "\x1b[0m")
|
||||
end
|
||||
|
||||
local freq =
|
||||
tonumber(parsed.flags.f and parsed.flags.f[1] or parsed.flags.frequency and parsed.flags.frequency[1] or "440")
|
||||
local time = tonumber(parsed.flags.t and parsed.flags.t[1] or parsed.flags.time and parsed.flags.time[1] or "0.1")
|
||||
|
||||
computer.beep(freq, time)
|
||||
@@ -0,0 +1,585 @@
|
||||
local raster = require("raster")
|
||||
local event = require("event")
|
||||
|
||||
local color_table = {
|
||||
0xAAAAAA, 0x666666, 0xFF0000, 0xFF0000, 0xFFDDDD, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF,
|
||||
0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000,
|
||||
0xAA00AA, 0x660066, 0xFF0000, 0xFF0000, 0xFFDDDD, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF,
|
||||
0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000
|
||||
}
|
||||
|
||||
local ball_bitplanes = {
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0007, 0xff80, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x001f, 0xffff, 0xfc00, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x00f8, 0x007f, 0xffff, 0xff80, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0fe6, 0x03ff, 0xffff, 0xfff0, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0xfd1b, 0x980f, 0xffff, 0xfffc, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x000f, 0xc14e, 0xb410, 0xffff, 0xffff, 0x8000, 0x0000,
|
||||
0x0000, 0x0000, 0x00fc, 0x927a, 0xe92a, 0x7fff, 0xffff, 0xf000, 0x0000,
|
||||
0x0000, 0x0000, 0x00c5, 0x09db, 0xa26f, 0x6fff, 0xffff, 0xfe00, 0x0000,
|
||||
0x0000, 0x0000, 0x01d0, 0x46ee, 0xc4d2, 0x0fff, 0xffff, 0xff80, 0x0000,
|
||||
0x0000, 0x0000, 0x0bba, 0x3bbd, 0x99b2, 0xd5bf, 0xffff, 0xffc0, 0x0000,
|
||||
0x0000, 0x0000, 0x0d76, 0x5ef6, 0x3324, 0xd57f, 0xffff, 0xffe0, 0x0000,
|
||||
0x0000, 0x0000, 0x5dec, 0x8fdc, 0x4665, 0xd55f, 0xffff, 0xfff0, 0x0000,
|
||||
0x0000, 0x0000, 0xab99, 0x18f8, 0x8ccd, 0x9455, 0xffff, 0xfff8, 0x0000,
|
||||
0x0000, 0x0002, 0xd772, 0x3103, 0x19c9, 0x96aa, 0xffff, 0xfffc, 0x0000,
|
||||
0x0000, 0x000d, 0xaecc, 0x6238, 0x3199, 0x96aa, 0x6fff, 0xfffe, 0x0000,
|
||||
0x0000, 0x001a, 0xbd98, 0xc673, 0x8399, 0xb695, 0x97ff, 0xffff, 0x8000,
|
||||
0x0000, 0x006d, 0x7331, 0x8c73, 0x1b39, 0xb255, 0xbbff, 0xffff, 0xc000,
|
||||
0x0000, 0x00d2, 0xe663, 0x18e7, 0x30f3, 0x324a, 0x9dff, 0xffff, 0xe000,
|
||||
0x0000, 0x0fa5, 0xccc3, 0x31ce, 0x31c3, 0x324b, 0xebff, 0xffff, 0xf000,
|
||||
0x0000, 0x1917, 0xb986, 0x23ce, 0x618c, 0x336d, 0x71ff, 0xffff, 0xf800,
|
||||
0x0000, 0x1ade, 0x670c, 0x639c, 0x639c, 0xc325, 0xa8ff, 0xffff, 0xfc00,
|
||||
0x0000, 0x32a3, 0xce18, 0xc73c, 0xc319, 0xcf26, 0xf37f, 0xffff, 0xfe00,
|
||||
0x0000, 0x35a6, 0x7c31, 0x8e38, 0xc719, 0xccf2, 0xd5df, 0xffff, 0xff00,
|
||||
0x0000, 0x6946, 0xc463, 0x1e71, 0x8739, 0x8ccf, 0x7a6f, 0xffff, 0xff00,
|
||||
0x0000, 0xcacc, 0xc707, 0x1c71, 0x8e31, 0x9ccc, 0x6d37, 0xffff, 0xff80,
|
||||
0x0000, 0xd69d, 0x8e7e, 0x38e3, 0x0e33, 0x98cc, 0xcd4b, 0xffff, 0xff80,
|
||||
0x0001, 0x9599, 0x8e73, 0xb9e3, 0x1c73, 0x98cc, 0xc9b7, 0xffff, 0xffc0,
|
||||
0x0001, 0xad33, 0x1ce3, 0x81c6, 0x1c63, 0x98cc, 0xc92b, 0xffff, 0xffc0,
|
||||
0x0003, 0x4b33, 0x1ce7, 0x0dc6, 0x3c63, 0x18cc, 0xc92b, 0xffff, 0xffe0,
|
||||
0x0003, 0x5666, 0x39c7, 0x1c4c, 0x38e7, 0x18cc, 0xccaa, 0x3fff, 0xffe0,
|
||||
0x0006, 0x96e6, 0x39ce, 0x1872, 0x78c7, 0x19cc, 0xc495, 0x3fff, 0xfff0,
|
||||
0x000d, 0x2ccc, 0x738e, 0x38f3, 0xb0c7, 0x19cc, 0xc495, 0x1fff, 0xfff0,
|
||||
0x000d, 0x5dcc, 0x739c, 0x30e7, 0x89c7, 0x39ce, 0xc495, 0x1fff, 0xfff0,
|
||||
0x001a, 0x5b98, 0xe71c, 0x71e7, 0x0f8e, 0x31ce, 0x64d4, 0xffff, 0xfff8,
|
||||
0x001a, 0xbb18, 0xe738, 0x71cf, 0x1e4e, 0x31ce, 0x64ca, 0x8fff, 0xfff8,
|
||||
0x0008, 0xb731, 0xce38, 0xe1ce, 0x1c71, 0x31ce, 0x664a, 0x8fff, 0xfffc,
|
||||
0x000a, 0xf631, 0xce78, 0xe38e, 0x3cf1, 0xf1ce, 0x664a, 0x77ff, 0xfffc,
|
||||
0x000a, 0x9e63, 0x9c71, 0xc39e, 0x3ce3, 0xc9ce, 0x6649, 0x47ff, 0xfffe,
|
||||
0x000a, 0x9063, 0x9cf1, 0xc71c, 0x38e3, 0x8ece, 0x6261, 0x5fff, 0xfffe,
|
||||
0x0004, 0x9327, 0x38e3, 0x873c, 0x78e3, 0x9e36, 0x6265, 0x1bff, 0xffff,
|
||||
0x0015, 0x933f, 0x39e3, 0x8e38, 0x79e3, 0x9c30, 0x6264, 0x23ff, 0xffff,
|
||||
0x0015, 0x3339, 0xb1c7, 0x8e38, 0xf1c7, 0x9c71, 0x9324, 0xafff, 0xffff,
|
||||
0x0015, 0x2639, 0x83c7, 0x0c78, 0xf1c7, 0x1c61, 0x9f30, 0x8dff, 0xffff,
|
||||
0x0015, 0x2671, 0x8d8f, 0x1c70, 0xe3c7, 0x3c63, 0x9cf2, 0x91ff, 0xffff,
|
||||
0x0015, 0x2673, 0x8c76, 0x1871, 0xe38f, 0x3863, 0x1cce, 0x16ff, 0xffff,
|
||||
0x0009, 0x2673, 0x1c71, 0x38f1, 0xe38e, 0x38e3, 0x38cd, 0xc6ff, 0xffff,
|
||||
0x000b, 0x2673, 0x1861, 0xf0e1, 0xc78e, 0x78c3, 0x39cd, 0xbbff, 0xffff,
|
||||
0x000b, 0x6663, 0x18e3, 0xc9e3, 0xc70e, 0x70c7, 0x399d, 0xb47f, 0xffff,
|
||||
0x000b, 0x6c67, 0x18e3, 0x8ec3, 0xc71e, 0x71c6, 0x3999, 0xb4ff, 0xffff,
|
||||
0x004b, 0x6ce7, 0x38e3, 0x9e27, 0x871c, 0x71c6, 0x3199, 0x34ff, 0xffff,
|
||||
0x002b, 0x6ce7, 0x30c3, 0x9c38, 0x4f1c, 0xf1c6, 0x339b, 0x2cff, 0xfffe,
|
||||
0x0012, 0x6ce6, 0x31c7, 0x9c78, 0x761c, 0xe186, 0x739b, 0x6aff, 0xfffe,
|
||||
0x0016, 0x4cc6, 0x31c7, 0x1c70, 0xf13c, 0xe38e, 0x739b, 0x69ff, 0xfffe,
|
||||
0x0096, 0xccce, 0x3187, 0x3c70, 0xe1d8, 0xe38c, 0x733b, 0x69ff, 0xfffe,
|
||||
0x00e6, 0xd8ce, 0x718f, 0x3871, 0xe3c1, 0xe38c, 0x6333, 0x69ff, 0xfffe,
|
||||
0x0068, 0xd9ce, 0x618e, 0x38f1, 0xc386, 0xc30c, 0x6732, 0x69ff, 0xfffe,
|
||||
0x0071, 0x198e, 0x638e, 0x78e1, 0xc78e, 0x271c, 0x6732, 0x59ff, 0xfffe,
|
||||
0x0074, 0x219c, 0x630e, 0x70e3, 0xc70c, 0x3898, 0xe732, 0x55ff, 0xfffe,
|
||||
0x0034, 0xa61c, 0xe31e, 0x71e3, 0x871c, 0x78f8, 0xc732, 0x55ff, 0xfffe,
|
||||
0x0038, 0x866c, 0xc31c, 0x71c7, 0x8f18, 0x71e4, 0xce72, 0x55ff, 0xfffe,
|
||||
0x003a, 0x9263, 0xc71c, 0xf1c7, 0x0e38, 0xf1c7, 0x0e66, 0xd5ff, 0xfffe,
|
||||
0x001a, 0x1323, 0x261c, 0xe3c7, 0x1e38, 0xe3ce, 0x7664, 0xd5ff, 0xfffe,
|
||||
0x001c, 0x5323, 0x393c, 0xe38f, 0x1c70, 0xe38e, 0x71e4, 0xb3ff, 0xfffc,
|
||||
0x0015, 0x4323, 0x39d8, 0xe38e, 0x1c71, 0xc79c, 0xe304, 0xabff, 0xfffc,
|
||||
0x0015, 0x0933, 0x39c1, 0xe38e, 0x3ce1, 0xc71c, 0xe33b, 0xabff, 0xfff8,
|
||||
0x000f, 0x2933, 0x39c6, 0xc79e, 0x38e3, 0x8f39, 0xc636, 0x6bff, 0xfff8,
|
||||
0x000a, 0xa933, 0x39c6, 0x3b1c, 0x39c3, 0x8e39, 0xc676, 0x97ff, 0xfff0,
|
||||
0x000a, 0xa993, 0x39c6, 0x383c, 0x79c7, 0x0e73, 0x8c6c, 0xafff, 0xfff0,
|
||||
0x0007, 0x9591, 0x39ce, 0x30d8, 0x73c7, 0x1c73, 0x8ccd, 0x2fff, 0xffe0,
|
||||
0x0005, 0x5491, 0xb9cc, 0x71c4, 0xf386, 0x1ce7, 0x19db, 0x5fff, 0xffe0,
|
||||
0x0005, 0x5491, 0x99cc, 0x7187, 0x678e, 0x38e7, 0x1992, 0x9fff, 0xffe0,
|
||||
0x0002, 0xd491, 0x998c, 0x718e, 0x1b0c, 0x39ce, 0x33b4, 0xbfff, 0xffc0,
|
||||
0x0001, 0x2a99, 0x998c, 0x638e, 0x389c, 0x71ce, 0x3325, 0x7fff, 0xffc0,
|
||||
0x0000, 0x9249, 0x998c, 0x631c, 0x31f8, 0x739c, 0x6669, 0x7fff, 0xff80,
|
||||
0x0000, 0x4849, 0x998c, 0xe31c, 0x71c4, 0xe39c, 0x665a, 0xffff, 0xff80,
|
||||
0x0000, 0x26b9, 0x998c, 0xe718, 0x63cf, 0x0738, 0xccd4, 0xffff, 0xff00,
|
||||
0x0000, 0x095f, 0x999c, 0xc638, 0xe38e, 0x3f38, 0xd8b5, 0xffff, 0xff00,
|
||||
0x0000, 0x065b, 0x1998, 0xc630, 0xc71c, 0x71b1, 0x9969, 0xffff, 0xfe00,
|
||||
0x0000, 0x032f, 0x6198, 0xce71, 0xc73c, 0xe301, 0xb153, 0xffff, 0xfe00,
|
||||
0x0000, 0x01d5, 0xa619, 0xcc61, 0x8e38, 0xc61c, 0x32d7, 0xffff, 0xfc00,
|
||||
0x0000, 0x02e7, 0xb279, 0x8c63, 0x9c71, 0xcc39, 0x82a7, 0xffff, 0xf800,
|
||||
0x0000, 0x0112, 0xd367, 0x9cc3, 0x1ce3, 0x9873, 0x3baf, 0xffff, 0xe000,
|
||||
0x0000, 0x0085, 0x5b26, 0x78c7, 0x39e7, 0x30e6, 0x748f, 0xffff, 0xc000,
|
||||
0x0000, 0x004b, 0xe926, 0x6186, 0x39ce, 0x619d, 0xe96f, 0xffff, 0x8000,
|
||||
0x0000, 0x001c, 0xad26, 0x664e, 0x739c, 0x6333, 0xa6df, 0xffff, 0x0000,
|
||||
0x0000, 0x000e, 0xd5a6, 0xcefc, 0x6718, 0xc667, 0x4b7f, 0xfffe, 0x0000,
|
||||
0x0000, 0x0004, 0xd4b6, 0xcce3, 0xe739, 0x8cce, 0xb6ff, 0xfff8, 0x0000,
|
||||
0x0000, 0x000d, 0x2ab4, 0xcdc6, 0x3e73, 0x19bd, 0x6bff, 0xfff0, 0x0000,
|
||||
0x0000, 0x0003, 0x6a94, 0xd9cc, 0x63e6, 0x3374, 0xb7ff, 0xffe0, 0x0000,
|
||||
0x0000, 0x0000, 0xd954, 0xdb98, 0xc60c, 0x4eeb, 0x5fff, 0xffc0, 0x0000,
|
||||
0x0000, 0x0000, 0x36d5, 0xd331, 0x1860, 0x99d6, 0x7fff, 0xff00, 0x0000,
|
||||
0x0000, 0x0000, 0x0d85, 0x9662, 0x31ce, 0xf7ba, 0xffff, 0xfe00, 0x0000,
|
||||
0x0000, 0x0000, 0x0313, 0xa6cc, 0x473b, 0x1eb3, 0xffff, 0xf800, 0x0000,
|
||||
0x0000, 0x0000, 0x00c1, 0x4d99, 0x9cec, 0x42e7, 0xffff, 0xe000, 0x0000,
|
||||
0x0000, 0x0000, 0x0030, 0x7722, 0x7362, 0x087f, 0xffff, 0x8000, 0x0000,
|
||||
0x0000, 0x0000, 0x000c, 0xa185, 0xcb90, 0x81ff, 0xfffc, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0003, 0x0fef, 0x2e49, 0x1fff, 0xfff0, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0803, 0x7281, 0xffff, 0xff80, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0038, 0x481f, 0xffff, 0xfe00, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0xf100, 0x007f, 0xf800, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x00fe, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0f7b, 0xfc00, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0xf7ec, 0x3ff0, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x000f, 0x7e70, 0xc4ff, 0x8000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x00f7, 0xe383, 0x0fcd, 0xa000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x057e, 0x0e1c, 0x3f8f, 0x9800, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x1a60, 0x78f0, 0xff1c, 0xde00, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x2cc3, 0xc3c1, 0xfe3c, 0xeb80, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0xd187, 0xdf07, 0xfc38, 0xe7e0, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0001, 0x660f, 0xf01f, 0xf879, 0xe798, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0006, 0xcc1f, 0xe0ff, 0xf0f1, 0xe798, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x001b, 0x187f, 0xc1ff, 0xe1f1, 0xe7cd, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x002e, 0x30ff, 0x83c1, 0xc1e1, 0xe7cc, 0xa000, 0x0000, 0x0000,
|
||||
0x0000, 0x00dc, 0xc1ff, 0x0783, 0xe3e1, 0xc7e6, 0xd000, 0x0000, 0x0000,
|
||||
0x0000, 0x0171, 0x83fe, 0x0f83, 0xe3c1, 0xc3e6, 0x5800, 0x0000, 0x0000,
|
||||
0x0000, 0x06e3, 0x07fc, 0x1f07, 0xc0c3, 0xc3f3, 0x2c00, 0x0000, 0x0000,
|
||||
0x0000, 0x0bc6, 0x0ffc, 0x3e0f, 0xc1f3, 0xc3f3, 0x3500, 0x0000, 0x0000,
|
||||
0x0000, 0x1198, 0x3ff8, 0x3c0f, 0x81ff, 0xc3f1, 0x9a80, 0x0000, 0x0000,
|
||||
0x0000, 0x13e0, 0x7ff0, 0x7c1f, 0x83ff, 0x03f9, 0xcd40, 0x0000, 0x0000,
|
||||
0x0000, 0x23c3, 0xffe0, 0xf83f, 0x03fe, 0x0ff8, 0xc5a0, 0x0000, 0x0000,
|
||||
0x0000, 0x27c7, 0x9fc1, 0xf03f, 0x07fe, 0x0f3c, 0xe6c0, 0x0000, 0x0000,
|
||||
0x0000, 0x4f87, 0x0783, 0xe07e, 0x07fe, 0x0f0c, 0x6360, 0x0000, 0x0000,
|
||||
0x0000, 0x8f0f, 0x07c7, 0xe07e, 0x0ffe, 0x1f0f, 0x71b0, 0x0000, 0x0000,
|
||||
0x0000, 0x9f1e, 0x0f8f, 0xc0fc, 0x0ffc, 0x1f0f, 0x0198, 0x0000, 0x0000,
|
||||
0x0001, 0x1e1e, 0x0f83, 0xc1fc, 0x1ffc, 0x1f0f, 0x0fda, 0x0000, 0x0000,
|
||||
0x0001, 0x3e3c, 0x1f03, 0xf1f8, 0x1ffc, 0x1f0f, 0x0fcd, 0x0000, 0x0000,
|
||||
0x0002, 0x7c3c, 0x1f07, 0xfff8, 0x3ffc, 0x1f0f, 0x0fcc, 0x8000, 0x0000,
|
||||
0x0002, 0x7878, 0x3e07, 0xffb0, 0x3ff8, 0x1f0f, 0x0fcc, 0x8000, 0x0000,
|
||||
0x0004, 0xf8f8, 0x3e0f, 0xff82, 0x7ff8, 0x1e0f, 0x07e6, 0x8000, 0x0000,
|
||||
0x0009, 0xf0f0, 0x7c0f, 0xff03, 0xfff8, 0x1e0f, 0x07e6, 0x4000, 0x0000,
|
||||
0x0009, 0xe1f0, 0x7c1f, 0xff07, 0xf7f8, 0x3e0f, 0x07e6, 0x4000, 0x0000,
|
||||
0x0013, 0xe3e0, 0xf81f, 0xfe07, 0xf1f0, 0x3e0f, 0x87e7, 0x4000, 0x0000,
|
||||
0x0013, 0xc3e0, 0xf83f, 0xfe0f, 0xe070, 0x3e0f, 0x87f3, 0x2000, 0x0000,
|
||||
0x002f, 0xc7c1, 0xf03f, 0xfe0f, 0xe07e, 0x3e0f, 0x87f3, 0x2000, 0x0000,
|
||||
0x002c, 0x87c1, 0xf07f, 0xfc0f, 0xc0fe, 0x3e0f, 0x87f3, 0xa800, 0x0000,
|
||||
0x002c, 0xef83, 0xe07f, 0xfc1f, 0xc0fc, 0x0e0f, 0x87f1, 0x9000, 0x0000,
|
||||
0x002c, 0xe383, 0xe0ff, 0xf81f, 0xc0fc, 0x0f0f, 0x83f9, 0x9000, 0x0000,
|
||||
0x0028, 0xe3e7, 0xc0ff, 0xf83f, 0x80fc, 0x1fff, 0x83f9, 0xd400, 0x0000,
|
||||
0x0059, 0xe3ff, 0xc1ff, 0xf03f, 0x81fc, 0x1fff, 0x83f8, 0xcc00, 0x0000,
|
||||
0x0059, 0xc3fe, 0x01ff, 0xf03f, 0x01f8, 0x1ffe, 0x13f8, 0xc800, 0x0000,
|
||||
0x0059, 0xc7fe, 0x03ff, 0xf07f, 0x01f8, 0x1ffe, 0x1ffc, 0xea00, 0x0000,
|
||||
0x0059, 0xc7fe, 0x0fff, 0xe07f, 0x03f8, 0x3ffc, 0x1f3c, 0xe600, 0x0000,
|
||||
0x0059, 0xc7fc, 0x0f87, 0xe07e, 0x03f0, 0x3ffc, 0x1f0c, 0x6500, 0x0000,
|
||||
0x0051, 0xc7fc, 0x1f81, 0xc0fe, 0x03f0, 0x3ffc, 0x3f0e, 0x7500, 0x0000,
|
||||
0x0053, 0xc7fc, 0x1f81, 0xc0fe, 0x07f0, 0x7ffc, 0x3e0e, 0x3200, 0x0000,
|
||||
0x0053, 0x87fc, 0x1f03, 0xf1fc, 0x07f0, 0x7ff8, 0x3e1e, 0x3e80, 0x0000,
|
||||
0x0053, 0x8ff8, 0x1f03, 0xf0fc, 0x07e0, 0x7ff8, 0x3e1e, 0x3e00, 0x0000,
|
||||
0x0093, 0x8ff8, 0x3f03, 0xe038, 0x07e0, 0x7ff8, 0x3e1e, 0x3e00, 0x0000,
|
||||
0x00b3, 0x8ff8, 0x3f03, 0xe03f, 0xcfe0, 0xfff8, 0x3c1c, 0x3e00, 0x0000,
|
||||
0x00a3, 0x8ff8, 0x3e07, 0xe07f, 0xffe0, 0xfff8, 0x7c1c, 0x7c00, 0x0000,
|
||||
0x00a7, 0x8ff8, 0x3e07, 0xe07f, 0xfec0, 0xfff0, 0x7c1c, 0x7d00, 0x0000,
|
||||
0x00a7, 0x0ff0, 0x3e07, 0xc07f, 0xfe00, 0xfff0, 0x7c3c, 0x7c00, 0x0000,
|
||||
0x00b7, 0x1ff0, 0x7e0f, 0xc07f, 0xfc01, 0xfff0, 0x7c3c, 0x7c00, 0x0000,
|
||||
0x00ff, 0x1ff0, 0x7e0f, 0xc0ff, 0xfc07, 0xfff0, 0x783c, 0x7c00, 0x0000,
|
||||
0x005e, 0x1ff0, 0x7c0f, 0x80ff, 0xf80f, 0xdfe0, 0x783c, 0x7c00, 0x0000,
|
||||
0x005f, 0x3fe0, 0x7c0f, 0x80ff, 0xf80f, 0xc0e0, 0xf83c, 0x7800, 0x0000,
|
||||
0x003f, 0x3860, 0xfc1f, 0x81ff, 0xf81f, 0x80e0, 0xf83c, 0x7800, 0x0000,
|
||||
0x002f, 0x1870, 0xfc1f, 0x81ff, 0xf01f, 0x81f8, 0xf07c, 0x7800, 0x0000,
|
||||
0x002f, 0x1c7c, 0xf81f, 0x01ff, 0xf03f, 0x01f8, 0x3078, 0xf800, 0x0000,
|
||||
0x001f, 0x9c3c, 0x381f, 0x03ff, 0xe03f, 0x03f0, 0x7878, 0xf800, 0x0000,
|
||||
0x0017, 0x9c3c, 0x3f3f, 0x03ff, 0xe07f, 0x03f0, 0x7ff8, 0xf800, 0x0000,
|
||||
0x001f, 0x8c3c, 0x3fff, 0x03ff, 0xe07e, 0x07e0, 0xfff8, 0xf000, 0x0000,
|
||||
0x001f, 0xce3c, 0x3ffe, 0x03ff, 0xc0fe, 0x07e0, 0xffc3, 0xf000, 0x0000,
|
||||
0x000b, 0xce3c, 0x3ff8, 0x07ff, 0xc0fc, 0x0fc1, 0xffc7, 0xb000, 0x0000,
|
||||
0x000f, 0xce3c, 0x3ff8, 0x3fff, 0xc1fc, 0x0fc1, 0xff87, 0x1800, 0x0000,
|
||||
0x000f, 0xce1c, 0x3ff8, 0x3fff, 0x81f8, 0x0f83, 0xff8f, 0x3000, 0x0000,
|
||||
0x0005, 0xe61e, 0x3ff0, 0x3f1f, 0x83f8, 0x1f83, 0xff0e, 0x3000, 0x0000,
|
||||
0x0007, 0xe71e, 0x3ff0, 0x7e07, 0x03f8, 0x1f07, 0xfe1c, 0x6000, 0x0000,
|
||||
0x0007, 0xe71e, 0x1ff0, 0x7e07, 0x87f0, 0x3f07, 0xfe1c, 0xe000, 0x0000,
|
||||
0x0003, 0xe71e, 0x1ff0, 0x7e0f, 0xe3f0, 0x3e0f, 0xfc38, 0xc000, 0x0000,
|
||||
0x0002, 0xf31e, 0x1ff0, 0x7c0f, 0xc0e0, 0x7e0f, 0xfc39, 0x8000, 0x0000,
|
||||
0x0001, 0x5b8e, 0x1ff0, 0x7c1f, 0xc1e0, 0x7c1f, 0xf871, 0x8000, 0x0000,
|
||||
0x0000, 0xad8e, 0x1ff0, 0xfc1f, 0x81fc, 0xfc1f, 0xf863, 0x0000, 0x0000,
|
||||
0x0000, 0x54fe, 0x1ff0, 0xf81f, 0x83ff, 0xf83f, 0xf0e7, 0x0000, 0x0000,
|
||||
0x0000, 0x2278, 0x1fe0, 0xf83f, 0x03ff, 0xc03f, 0xe0c6, 0x0000, 0x0000,
|
||||
0x0000, 0x137c, 0x1fe0, 0xf83f, 0x07ff, 0x81ff, 0xe18e, 0x0000, 0x0000,
|
||||
0x0000, 0x09bc, 0x7fe0, 0xf07e, 0x07ff, 0x03ff, 0xc19c, 0x0000, 0x0000,
|
||||
0x0000, 0x049e, 0x3861, 0xf07e, 0x0fff, 0x07e0, 0xc318, 0x0000, 0x0000,
|
||||
0x0000, 0x054e, 0x3c61, 0xf07c, 0x1ffe, 0x0fc1, 0xe338, 0x0000, 0x0000,
|
||||
0x0000, 0x02a7, 0x1c79, 0xe0fc, 0x1ffc, 0x1f83, 0xc230, 0x0000, 0x0000,
|
||||
0x0000, 0x0157, 0x9c38, 0x60f8, 0x3ff8, 0x3f07, 0x87f0, 0x0000, 0x0000,
|
||||
0x0000, 0x00a3, 0x8e38, 0x79f8, 0x3ff0, 0x7e1e, 0x0f80, 0x0000, 0x0000,
|
||||
0x0000, 0x0049, 0xce38, 0x7fb0, 0x7fe0, 0x7c3c, 0x3f00, 0x0000, 0x0000,
|
||||
0x0000, 0x0024, 0xe638, 0xff00, 0x7fe0, 0xf878, 0x7c00, 0x0000, 0x0000,
|
||||
0x0000, 0x0012, 0xe738, 0xff03, 0xffc1, 0xf0f0, 0xf800, 0x0000, 0x0000,
|
||||
0x0000, 0x000c, 0x7338, 0xfe07, 0xcf83, 0xe1c1, 0xf000, 0x0000, 0x0000,
|
||||
0x0000, 0x0003, 0x7318, 0xfe0f, 0x8307, 0xc387, 0xc000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0xdd98, 0xfc1f, 0x07cf, 0x8f0f, 0x8000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x3799, 0xfc3e, 0x1f87, 0x1e1f, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0db9, 0xf87c, 0x3e0f, 0xf83c, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x033b, 0xf8f0, 0x783f, 0xe0f8, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x00cd, 0x91e1, 0xe0ff, 0x83f0, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0032, 0xbbc3, 0x83fc, 0x0c40, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x000c, 0xb1c6, 0x0fe0, 0xe100, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0003, 0x4ff0, 0x3f8e, 0x1000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0802, 0xfcf1, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0038, 0x6f90, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0xfd00, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x00ec, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0fbc, 0xf800, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0xf9f0, 0x3ff0, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x000f, 0x8f80, 0xfb1f, 0x8000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x00f8, 0xfc03, 0xf1ce, 0xa000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0687, 0xf01f, 0xc3f1, 0xd800, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x1c7f, 0x80ff, 0x07e0, 0xea00, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x30fc, 0x03fe, 0x1fc0, 0xf2c0, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0xe1f8, 0x5ff8, 0x3fc0, 0xf9b0, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0001, 0x87f0, 0xffe0, 0x7f81, 0xf9ec, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0007, 0x0fe1, 0xff00, 0xff01, 0xf8e3, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x001c, 0x1f83, 0xfe03, 0xfe01, 0xf8f1, 0xc000, 0x0000, 0x0000,
|
||||
0x0000, 0x0030, 0x3f0f, 0xfc01, 0xfe01, 0xf8f0, 0xf000, 0x0000, 0x0000,
|
||||
0x0000, 0x00e0, 0xfe1f, 0xf803, 0xfc01, 0xf8f8, 0xf800, 0x0000, 0x0000,
|
||||
0x0000, 0x0181, 0xfc3f, 0xf003, 0xfc01, 0xfc78, 0x6c00, 0x0000, 0x0000,
|
||||
0x0000, 0x0703, 0xf87f, 0xe007, 0xff03, 0xfc7c, 0x3600, 0x0000, 0x0000,
|
||||
0x0000, 0x0c07, 0xf0ff, 0xc00f, 0xfe03, 0xfc7c, 0x3a00, 0x0000, 0x0000,
|
||||
0x0000, 0x1e1f, 0xc1ff, 0xc00f, 0xfe0f, 0xfc7e, 0x1d00, 0x0000, 0x0000,
|
||||
0x0000, 0x1cff, 0x87ff, 0x801f, 0xfc1f, 0xfc3e, 0x0e80, 0x0000, 0x0000,
|
||||
0x0000, 0x3cfc, 0x0fff, 0x003f, 0xfc1f, 0xf03f, 0x0640, 0x0000, 0x0000,
|
||||
0x0000, 0x39f8, 0x1ffe, 0x003f, 0xf81f, 0xf03f, 0x0760, 0x0000, 0x0000,
|
||||
0x0000, 0x71f8, 0x07fc, 0x007f, 0xf83f, 0xf00f, 0x83b0, 0x0000, 0x0000,
|
||||
0x0000, 0xf3f0, 0x07f8, 0x007f, 0xf03f, 0xe00f, 0x81d8, 0x0000, 0x0000,
|
||||
0x0000, 0xe7e0, 0x0ff0, 0x00ff, 0xf03f, 0xe00f, 0xf1ec, 0x0000, 0x0000,
|
||||
0x0001, 0xe7e0, 0x0ffc, 0x01ff, 0xe07f, 0xe00f, 0xf1e4, 0x0000, 0x0000,
|
||||
0x0001, 0xcfc0, 0x1ffc, 0x01ff, 0xe07f, 0xe00f, 0xf1f2, 0x0000, 0x0000,
|
||||
0x0003, 0x8fc0, 0x1ff8, 0x0fff, 0xc07f, 0xe00f, 0xf1f1, 0x0000, 0x0000,
|
||||
0x0003, 0x9f80, 0x3ff8, 0x1fff, 0xc0ff, 0xe00f, 0xf0f0, 0xc000, 0x0000,
|
||||
0x0007, 0x1f00, 0x3ff0, 0x1ffd, 0x80ff, 0xe00f, 0xf8f8, 0xc000, 0x0000,
|
||||
0x000e, 0x3f00, 0x7ff0, 0x3ffc, 0x00ff, 0xe00f, 0xf8f8, 0x6000, 0x0000,
|
||||
0x000e, 0x7e00, 0x7fe0, 0x3ff8, 0x01ff, 0xc00f, 0xf8f8, 0x6000, 0x0000,
|
||||
0x001c, 0x7c00, 0xffe0, 0x7ff8, 0x01ff, 0xc00f, 0xf8f8, 0x6000, 0x0000,
|
||||
0x001c, 0xfc00, 0xffc0, 0x7ff0, 0x007f, 0xc00f, 0xf8fc, 0x3000, 0x0000,
|
||||
0x0030, 0xf801, 0xffc0, 0xfff0, 0x007f, 0xc00f, 0xf87c, 0x3000, 0x0000,
|
||||
0x0030, 0xf801, 0xff80, 0xfff0, 0x00ff, 0xc00f, 0xf87c, 0x3000, 0x0000,
|
||||
0x0030, 0xf003, 0xff81, 0xffe0, 0x00ff, 0xf00f, 0xf87e, 0x1800, 0x0000,
|
||||
0x0030, 0xfc03, 0xff01, 0xffe0, 0x00ff, 0xf00f, 0xfc7e, 0x1800, 0x0000,
|
||||
0x0030, 0xfc27, 0xff03, 0xffc0, 0x00ff, 0xe03f, 0xfc7e, 0x1800, 0x0000,
|
||||
0x0061, 0xfc3f, 0xfe03, 0xffc0, 0x01ff, 0xe03f, 0xfc7f, 0x0800, 0x0000,
|
||||
0x0061, 0xfc3f, 0xfe07, 0xffc0, 0x01ff, 0xe07f, 0xec3f, 0x0c00, 0x0000,
|
||||
0x0061, 0xf83f, 0xfc07, 0xff80, 0x01ff, 0xe07f, 0xe03f, 0x0c00, 0x0000,
|
||||
0x0061, 0xf87f, 0xf00f, 0xff80, 0x03ff, 0xc07f, 0xe03f, 0x0400, 0x0000,
|
||||
0x0061, 0xf87f, 0xf007, 0xff80, 0x03ff, 0xc07f, 0xe00f, 0x8600, 0x0000,
|
||||
0x0061, 0xf87f, 0xe001, 0xff00, 0x03ff, 0xc0ff, 0xc00f, 0x8600, 0x0000,
|
||||
0x0063, 0xf87f, 0xe001, 0xff00, 0x07ff, 0x80ff, 0xc00f, 0xc300, 0x0000,
|
||||
0x0063, 0xf87f, 0xe003, 0xfe00, 0x07ff, 0x80ff, 0xc01f, 0xc700, 0x0000,
|
||||
0x0063, 0xf07f, 0xe003, 0xff00, 0x07ff, 0x81ff, 0xc01f, 0xc700, 0x0000,
|
||||
0x00e3, 0xf0ff, 0xc003, 0xffc0, 0x07ff, 0x81ff, 0xc01f, 0xc700, 0x0000,
|
||||
0x00c3, 0xf0ff, 0xc003, 0xffc0, 0x4fff, 0x01ff, 0xc01f, 0xcf00, 0x0000,
|
||||
0x00c3, 0xf0ff, 0xc007, 0xff80, 0x7fff, 0x01ff, 0x801f, 0x8f00, 0x0000,
|
||||
0x00c7, 0xf0ff, 0xc007, 0xff80, 0xffff, 0x03ff, 0x801f, 0x8e00, 0x0000,
|
||||
0x00c7, 0xf0ff, 0xc007, 0xff80, 0xffff, 0x03ff, 0x803f, 0x8e00, 0x0000,
|
||||
0x00c7, 0xe0ff, 0x800f, 0xff81, 0xfffe, 0x03ff, 0x803f, 0x8e00, 0x0000,
|
||||
0x00cf, 0xe1ff, 0x800f, 0xff01, 0xfff8, 0x03ff, 0x803f, 0x8e00, 0x0000,
|
||||
0x0067, 0xe1ff, 0x800f, 0xff01, 0xfff0, 0x07ff, 0x803f, 0x9e00, 0x0000,
|
||||
0x0067, 0xc1ff, 0x800f, 0xff03, 0xfff0, 0x00ff, 0x003f, 0x9e00, 0x0000,
|
||||
0x0027, 0xc07f, 0x001f, 0xfe03, 0xffe0, 0x00ff, 0x003f, 0x9e00, 0x0000,
|
||||
0x0033, 0xe07f, 0x001f, 0xfe07, 0xffe0, 0x01ff, 0x007f, 0x9e00, 0x0000,
|
||||
0x0033, 0xe07f, 0x001f, 0xfe07, 0xffc0, 0x01ff, 0xc07f, 0x1e00, 0x0000,
|
||||
0x0013, 0xe03f, 0xc01f, 0xfc07, 0xffc0, 0x03ff, 0x807f, 0x1e00, 0x0000,
|
||||
0x0019, 0xe03f, 0xc13f, 0xfc0f, 0xff80, 0x03ff, 0x81ff, 0x3c00, 0x0000,
|
||||
0x0019, 0xf03f, 0xc1ff, 0xfc0f, 0xff80, 0x07ff, 0x03ff, 0x3c00, 0x0000,
|
||||
0x0019, 0xf03f, 0xc1ff, 0xfc0f, 0xff00, 0x07ff, 0x03fc, 0x3c00, 0x0000,
|
||||
0x000d, 0xf03f, 0xc1ff, 0xf81f, 0xff00, 0x0ffe, 0x07f8, 0x3c00, 0x0000,
|
||||
0x000c, 0xf03f, 0xc1ff, 0xc01f, 0xfe00, 0x0ffe, 0x07f8, 0x1c00, 0x0000,
|
||||
0x000c, 0xf01f, 0xc1ff, 0xc03f, 0xfe00, 0x0ffc, 0x0ff0, 0x3800, 0x0000,
|
||||
0x0006, 0xf81f, 0xc1ff, 0xc01f, 0xfc00, 0x1ffc, 0x0ff0, 0x3800, 0x0000,
|
||||
0x0006, 0x781f, 0xc1ff, 0x8007, 0xfc00, 0x1ff8, 0x1fe0, 0x7000, 0x0000,
|
||||
0x0006, 0x781f, 0xe1ff, 0x8007, 0xf800, 0x3ff8, 0x1fe0, 0xf000, 0x0000,
|
||||
0x0003, 0x781f, 0xe1ff, 0x800f, 0xfc00, 0x3ff0, 0x3fc0, 0xe000, 0x0000,
|
||||
0x0003, 0x3c1f, 0xe1ff, 0x800f, 0xff00, 0x7ff0, 0x3fc1, 0xc000, 0x0000,
|
||||
0x0001, 0x9c0f, 0xe1ff, 0x801f, 0xfe00, 0x7fe0, 0x7f81, 0xc000, 0x0000,
|
||||
0x0000, 0xce0f, 0xe1ff, 0x001f, 0xfe04, 0xffe0, 0x7f83, 0x8000, 0x0000,
|
||||
0x0000, 0x673f, 0xe1ff, 0x001f, 0xfc0f, 0xffc0, 0xff07, 0x8000, 0x0000,
|
||||
0x0000, 0x339f, 0xe1ff, 0x003f, 0xfc0f, 0xffc0, 0xff07, 0x0000, 0x0000,
|
||||
0x0000, 0x1b9f, 0xe1ff, 0x003f, 0xf81f, 0xfe01, 0xfe0f, 0x0000, 0x0000,
|
||||
0x0000, 0x0dcf, 0x81ff, 0x007f, 0xf83f, 0xfc01, 0xfe1e, 0x0000, 0x0000,
|
||||
0x0000, 0x06e7, 0xc07e, 0x007f, 0xf03f, 0xf800, 0xfc1c, 0x0000, 0x0000,
|
||||
0x0000, 0x0677, 0xc07e, 0x007f, 0xe07f, 0xf001, 0xfc3c, 0x0000, 0x0000,
|
||||
0x0000, 0x033b, 0xe07e, 0x00ff, 0xe0ff, 0xe003, 0xfc38, 0x0000, 0x0000,
|
||||
0x0000, 0x0199, 0xe03f, 0x80ff, 0xc1ff, 0xc007, 0xf8f8, 0x0000, 0x0000,
|
||||
0x0000, 0x00cd, 0xf03f, 0x81ff, 0xc1ff, 0x801f, 0xf1f0, 0x0000, 0x0000,
|
||||
0x0000, 0x006e, 0xf03f, 0x87ff, 0x83ff, 0x803f, 0xc7e0, 0x0000, 0x0000,
|
||||
0x0000, 0x0037, 0xf83f, 0x0fff, 0x87ff, 0x007f, 0x8f80, 0x0000, 0x0000,
|
||||
0x0000, 0x001b, 0x783f, 0x0ffc, 0x07fe, 0x00ff, 0x3f00, 0x0000, 0x0000,
|
||||
0x0000, 0x000f, 0xbc3f, 0x0ff8, 0x0ffc, 0x01fe, 0x7c00, 0x0000, 0x0000,
|
||||
0x0000, 0x0003, 0xbc1f, 0x1ff0, 0x03f8, 0x03f8, 0xf800, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0xee1f, 0x1fe0, 0x07f0, 0x0ff3, 0xe000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x3b1e, 0x1fc0, 0x1ff8, 0x1fe7, 0x8000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0ede, 0x1f80, 0x3ff0, 0xffdf, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x03ac, 0x3f00, 0x7fc3, 0xff3c, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x00ee, 0x1e01, 0xff0f, 0xfcf8, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0039, 0x3c03, 0xfc7f, 0xf060, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x000e, 0x3e07, 0xf3ff, 0x0100, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0003, 0x77ff, 0xcff0, 0x1000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x09fc, 0x7f01, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0008, 0x7010, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0500, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x003f, 0xfc00, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x01ff, 0xc7f0, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0fff, 0x030f, 0x8000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0xfffc, 0x01f0, 0xe000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0707, 0xffe0, 0x03f9, 0xe800, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x1f9f, 0xff00, 0x07ff, 0xf200, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x3f03, 0xfc00, 0x1fff, 0x0c80, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0xfe00, 0x6000, 0x3fff, 0x0020, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0001, 0xf800, 0xfc00, 0x7ffe, 0x01c8, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0007, 0xf001, 0xff80, 0xfffe, 0x00fe, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x001f, 0xe003, 0xffe3, 0xfffe, 0x00fe, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x003f, 0xc00f, 0xffff, 0xfffe, 0x00ff, 0x3000, 0x0000, 0x0000,
|
||||
0x0000, 0x00ff, 0x001f, 0xfffc, 0x1ffe, 0x00ff, 0x1800, 0x0000, 0x0000,
|
||||
0x0000, 0x01fe, 0x003f, 0xfffc, 0x03fe, 0x007f, 0x8c00, 0x0000, 0x0000,
|
||||
0x0000, 0x07fc, 0x007f, 0xfff8, 0x003c, 0x007f, 0xc600, 0x0000, 0x0000,
|
||||
0x0000, 0x03f8, 0x00ff, 0xfff0, 0x000c, 0x007f, 0xc300, 0x0000, 0x0000,
|
||||
0x0000, 0x0060, 0x01ff, 0xfff0, 0x000f, 0x007f, 0xe180, 0x0000, 0x0000,
|
||||
0x0000, 0x00f0, 0x07ff, 0xffe0, 0x001f, 0xf03f, 0xf0c0, 0x0000, 0x0000,
|
||||
0x0000, 0x00ff, 0x0fff, 0xffc0, 0x001f, 0xfc3f, 0xf860, 0x0000, 0x0000,
|
||||
0x0000, 0x01ff, 0xffff, 0xffc0, 0x001f, 0xffff, 0xf860, 0x0000, 0x0000,
|
||||
0x0000, 0x01ff, 0xfbff, 0xff80, 0x003f, 0xfff3, 0xfc30, 0x0000, 0x0000,
|
||||
0x0000, 0x03ff, 0xf83f, 0xff80, 0x003f, 0xfff0, 0xfe18, 0x0000, 0x0000,
|
||||
0x0000, 0x07ff, 0xf00f, 0xff00, 0x003f, 0xfff0, 0x0e0c, 0x0000, 0x0000,
|
||||
0x0000, 0x07ff, 0xf000, 0x3e00, 0x007f, 0xfff0, 0x0106, 0x0000, 0x0000,
|
||||
0x0000, 0x0fff, 0xe000, 0x0e00, 0x007f, 0xfff0, 0x01e3, 0x0000, 0x0000,
|
||||
0x0000, 0x0fff, 0xe000, 0x0e00, 0x007f, 0xfff0, 0x01ff, 0x8000, 0x0000,
|
||||
0x0000, 0x1fff, 0xc000, 0x1fc0, 0x00ff, 0xfff0, 0x00ff, 0x0000, 0x0000,
|
||||
0x0000, 0x1fff, 0xc000, 0x1ffe, 0x00ff, 0xfff0, 0x00ff, 0x0000, 0x0000,
|
||||
0x0000, 0x3fff, 0x8000, 0x3fff, 0xc0ff, 0xfff0, 0x00ff, 0x8000, 0x0000,
|
||||
0x0000, 0x7fff, 0x8000, 0x3fff, 0xf9ff, 0xfff0, 0x00ff, 0x8000, 0x0000,
|
||||
0x0000, 0x7fff, 0x0000, 0x7fff, 0xffff, 0xfff0, 0x00ff, 0x8000, 0x0000,
|
||||
0x0000, 0xffff, 0x0000, 0x7fff, 0xffbf, 0xfff0, 0x00ff, 0xc000, 0x0000,
|
||||
0x003c, 0xfffe, 0x0000, 0xffff, 0xff80, 0xfff0, 0x007f, 0xc000, 0x0000,
|
||||
0x003f, 0x7ffe, 0x0000, 0xffff, 0xff00, 0x3ff0, 0x007f, 0xc000, 0x0000,
|
||||
0x003f, 0x0ffc, 0x0001, 0xffff, 0xff00, 0x07f0, 0x007f, 0xe000, 0x0000,
|
||||
0x003f, 0x03fc, 0x0001, 0xffff, 0xff00, 0x00f0, 0x007f, 0xe000, 0x0000,
|
||||
0x003f, 0x0038, 0x0003, 0xffff, 0xff00, 0x0038, 0x007f, 0xe000, 0x0000,
|
||||
0x007e, 0x0038, 0x0003, 0xffff, 0xfe00, 0x003e, 0x007f, 0xf000, 0x0000,
|
||||
0x007e, 0x003f, 0xc007, 0xffff, 0xfe00, 0x007f, 0xf03f, 0xf000, 0x0000,
|
||||
0x007e, 0x003f, 0xf007, 0xffff, 0xfe00, 0x007f, 0xfc3f, 0xf000, 0x0000,
|
||||
0x007e, 0x007f, 0xfe0f, 0xffff, 0xfc00, 0x007f, 0xffff, 0xf800, 0x0000,
|
||||
0x007e, 0x007f, 0xffff, 0xffff, 0xfc00, 0x007f, 0xfff3, 0xf800, 0x0000,
|
||||
0x007e, 0x007f, 0xfffe, 0xffff, 0xfc00, 0x00ff, 0xfff0, 0x7800, 0x0000,
|
||||
0x007c, 0x007f, 0xfffe, 0x3fff, 0xf800, 0x00ff, 0xfff0, 0x0c00, 0x0000,
|
||||
0x007c, 0x007f, 0xfffc, 0x07ff, 0xf800, 0x00ff, 0xffe0, 0x0700, 0x0000,
|
||||
0x007c, 0x007f, 0xfffc, 0x00ff, 0xf800, 0x01ff, 0xffe0, 0x0780, 0x0000,
|
||||
0x00fc, 0x00ff, 0xfffc, 0x001f, 0xf800, 0x01ff, 0xffe0, 0x0780, 0x0000,
|
||||
0x00fc, 0x00ff, 0xfffc, 0x0000, 0x7000, 0x01ff, 0xffe0, 0x0f80, 0x0000,
|
||||
0x00fc, 0x00ff, 0xfff8, 0x0000, 0x7800, 0x01ff, 0xffe0, 0x0f00, 0x0000,
|
||||
0x00f8, 0x00ff, 0xfff8, 0x0000, 0xff00, 0x03ff, 0xffe0, 0x0f00, 0x0000,
|
||||
0x0078, 0x00ff, 0xfff8, 0x0000, 0xffe0, 0x03ff, 0xffc0, 0x0f00, 0x0000,
|
||||
0x0008, 0x00ff, 0xfff0, 0x0001, 0xfff8, 0x03ff, 0xffc0, 0x0f00, 0x0000,
|
||||
0x000e, 0x01ff, 0xfff0, 0x0001, 0xffff, 0x03ff, 0xffc0, 0x0f00, 0x0000,
|
||||
0x0007, 0xc1ff, 0xfff0, 0x0001, 0xffff, 0xe7ff, 0xffc0, 0x1f00, 0x0000,
|
||||
0x0007, 0xf9ff, 0xfff0, 0x0003, 0xffff, 0xff7f, 0xffc0, 0x1e00, 0x0000,
|
||||
0x0007, 0xffff, 0xffe0, 0x0003, 0xffff, 0xff1f, 0xffc0, 0x1e00, 0x0000,
|
||||
0x0003, 0xff8f, 0xffe0, 0x0007, 0xffff, 0xfe03, 0xff80, 0x1e00, 0x0000,
|
||||
0x0003, 0xff80, 0xffe0, 0x0007, 0xffff, 0xfe00, 0x3f80, 0x1e00, 0x0000,
|
||||
0x0003, 0xffc0, 0x1fe0, 0x0007, 0xffff, 0xfc00, 0x0780, 0x1e00, 0x0000,
|
||||
0x0001, 0xffc0, 0x01c0, 0x000f, 0xffff, 0xfc00, 0x0180, 0x3e00, 0x0000,
|
||||
0x0001, 0xffc0, 0x01e0, 0x000f, 0xffff, 0xf800, 0x03e0, 0x3c00, 0x0000,
|
||||
0x0001, 0xffc0, 0x01f8, 0x000f, 0xffff, 0xf800, 0x03ff, 0x3c00, 0x0000,
|
||||
0x0001, 0xffc0, 0x01ff, 0x001f, 0xffff, 0xf000, 0x07ff, 0xfc00, 0x0000,
|
||||
0x0000, 0xffc0, 0x01ff, 0xfc1f, 0xffff, 0xf000, 0x07ff, 0xe000, 0x0000,
|
||||
0x0000, 0xffe0, 0x01ff, 0xff3f, 0xffff, 0xf000, 0x0fff, 0xc000, 0x0000,
|
||||
0x0000, 0xffe0, 0x01ff, 0xffff, 0xffff, 0xe000, 0x0fff, 0xc000, 0x0000,
|
||||
0x0000, 0x7fe0, 0x01ff, 0xfffb, 0xffff, 0xe000, 0x1fff, 0x8000, 0x0000,
|
||||
0x0000, 0x7fe0, 0x01ff, 0xfff8, 0x7fff, 0xc000, 0x1fff, 0x0000, 0x0000,
|
||||
0x0000, 0x7fe0, 0x01ff, 0xfff0, 0x03ff, 0xc000, 0x3fff, 0x0000, 0x0000,
|
||||
0x0003, 0xbfe0, 0x01ff, 0xfff0, 0x007f, 0x8000, 0x3ffe, 0x0000, 0x0000,
|
||||
0x0001, 0xe7f0, 0x01ff, 0xffe0, 0x001f, 0x8000, 0x7ffe, 0x0000, 0x0000,
|
||||
0x0000, 0xf1f0, 0x01ff, 0xffe0, 0x0007, 0x0000, 0x7ffc, 0x0000, 0x0000,
|
||||
0x0000, 0x7830, 0x01ff, 0xffe0, 0x000f, 0xe000, 0xfff8, 0x0000, 0x0000,
|
||||
0x0000, 0x3c1e, 0x01ff, 0xffc0, 0x000f, 0xf800, 0xfff8, 0x0000, 0x0000,
|
||||
0x0000, 0x1c1f, 0x81ff, 0xffc0, 0x001f, 0xffc1, 0xfff0, 0x0000, 0x0000,
|
||||
0x0000, 0x0e0f, 0xf9ff, 0xff80, 0x003f, 0xfff1, 0xffe0, 0x0000, 0x0000,
|
||||
0x0000, 0x0707, 0xffff, 0xff80, 0x003f, 0xffff, 0xffe0, 0x0000, 0x0000,
|
||||
0x0000, 0x0787, 0xff9f, 0xff80, 0x007f, 0xfffe, 0x1fc0, 0x0000, 0x0000,
|
||||
0x0000, 0x03c3, 0xff81, 0xff00, 0x00ff, 0xfffc, 0x01c0, 0x0000, 0x0000,
|
||||
0x0000, 0x01e1, 0xffc0, 0x1f00, 0x01ff, 0xfff8, 0x00c0, 0x0000, 0x0000,
|
||||
0x0000, 0x00f1, 0xffc0, 0x0600, 0x01ff, 0xffe0, 0x01f0, 0x0000, 0x0000,
|
||||
0x0000, 0x0070, 0xffc0, 0x07c0, 0x03ff, 0xffc0, 0x07e0, 0x0000, 0x0000,
|
||||
0x0000, 0x0038, 0xffc0, 0x0ff0, 0x07ff, 0xff80, 0x0f80, 0x0000, 0x0000,
|
||||
0x0000, 0x001c, 0x7fc0, 0x0fff, 0x07ff, 0xff00, 0x3f00, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x3fc0, 0x0fff, 0xffff, 0xfe00, 0x7c00, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x7fe0, 0x1fff, 0xfcff, 0xfc00, 0xf800, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x13e0, 0x1fff, 0xf83f, 0xf003, 0xe000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0460, 0x1fff, 0xe007, 0xe007, 0x8000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0110, 0x1fff, 0xc000, 0xc01f, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x004e, 0x3fff, 0x8003, 0xf03c, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0017, 0xfffe, 0x000f, 0xfff8, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0005, 0xc3fc, 0x007f, 0xff80, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0001, 0xc038, 0x03ff, 0xfe00, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x87f8, 0x0fff, 0xe000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x07ff, 0x7ffe, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0007, 0x8fe0, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000
|
||||
}
|
||||
|
||||
--local SCREEN_W = 336
|
||||
--local SCREEN_H = 216
|
||||
local SCREEN_W = 320
|
||||
local SCREEN_H = 200
|
||||
local function l(x1, y1, x2, y2, c)
|
||||
raster.drawLine(x1-8, y1-8, x2-8, y2-8, c)
|
||||
end
|
||||
local function g(x, y)
|
||||
return raster.get(x-8, y-8)
|
||||
end
|
||||
local function s(x, y, c)
|
||||
raster.set(x-8, y-8, c)
|
||||
end
|
||||
local BALL_W = 144
|
||||
local BALL_H = 100
|
||||
local ONE_PLANE_LEN = BALL_W * BALL_H / 16
|
||||
|
||||
local function ball()
|
||||
local color_cycle = 2
|
||||
local pos = { x = 0.0, y = 0.0 }
|
||||
local scroll = { x = -1, y = -1 }
|
||||
local pixel_index = {}
|
||||
local is_shadow = {}
|
||||
local this = {}
|
||||
function this.pos()
|
||||
return -pos.x + 77, -pos.y
|
||||
end
|
||||
function this.step()
|
||||
pos.x = pos.x + scroll.x
|
||||
if pos.x <= -95 or pos.x >= 95 then scroll.x = -scroll.x end
|
||||
local adj = scroll.y
|
||||
if pos.y > -10.0 then adj = adj * 1.0
|
||||
elseif pos.y > -30.0 then adj = adj * 2.0
|
||||
elseif pos.y > -60.0 then adj = adj * 3.0
|
||||
else adj = adj * 4.0 end
|
||||
pos.y = pos.y + adj
|
||||
if pos.y <= -100 or pos.y >= 0 then scroll.y = -scroll.y end
|
||||
end
|
||||
local function orderbits(value)
|
||||
local result = 0
|
||||
for i = 0, 15 do
|
||||
if (value >> i) & 1 == 1 then
|
||||
result = result | (1 << (15 - i))
|
||||
end
|
||||
end
|
||||
return result
|
||||
end
|
||||
function this.decode()
|
||||
for y = 0, BALL_H - 1 do
|
||||
for x = 0, BALL_W - 1 do
|
||||
local pos = y * BALL_W + x
|
||||
local offset = pos // 16
|
||||
local bitpos = pos % 16
|
||||
|
||||
local value = 0
|
||||
for plane = 0, 3 do
|
||||
local word = orderbits(ball_bitplanes[offset + plane * ONE_PLANE_LEN + 1])
|
||||
if (word & (1 << bitpos)) ~= 0 then
|
||||
value = value | (1 << plane)
|
||||
end
|
||||
end
|
||||
|
||||
if (value == 1) then
|
||||
is_shadow[pos + 1] = true
|
||||
pixel_index[pos + 1] = 0
|
||||
else
|
||||
is_shadow[pos + 1] = false
|
||||
pixel_index[pos + 1] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function this.cycle_palette()
|
||||
if scroll.x > 0 then color_cycle = color_cycle - 1
|
||||
else color_cycle = color_cycle + 1 end
|
||||
|
||||
if color_cycle == -1 then color_cycle = 13
|
||||
elseif color_cycle == 14 then color_cycle = 0 end
|
||||
|
||||
for i = 0, 6 do
|
||||
if color_cycle + i < 14 then
|
||||
color_table[color_cycle + i + 3] = 0xFFFFFF
|
||||
color_table[color_cycle + i + 19] = 0xFFFFFF
|
||||
else
|
||||
color_table[color_cycle + i - 11] = 0xFFFFFF
|
||||
color_table[color_cycle + i + 5] = 0xFFFFFF
|
||||
end
|
||||
end
|
||||
for i = 7, 13 do
|
||||
if color_cycle + i < 14 then
|
||||
color_table[color_cycle + i + 3] = 0xFF0000
|
||||
color_table[color_cycle + i + 19] = 0xFF0000
|
||||
else
|
||||
color_table[color_cycle + i - 11] = 0xFF0000
|
||||
color_table[color_cycle + i + 5] = 0xFF0000
|
||||
end
|
||||
end
|
||||
if scroll.x > -1 then
|
||||
color_table[color_cycle + 3] = 0xFFDDDD
|
||||
color_table[color_cycle + 19] = 0xFFDDDD
|
||||
elseif color_cycle + 6 < 14 then
|
||||
color_table[color_cycle + 9] = 0xFFDDDD
|
||||
color_table[color_cycle + 25] = 0xFFDDDD
|
||||
else
|
||||
color_table[color_cycle - 5] = 0xFFDDDD
|
||||
color_table[color_cycle + 11] = 0xFFDDDD
|
||||
end
|
||||
end
|
||||
function this.draw(x, y, shadow)
|
||||
for oy = 0, BALL_H - 1 do
|
||||
for ox = 0, BALL_W - 1 do
|
||||
local pos = oy * BALL_W + ox + 1
|
||||
if shadow then
|
||||
if is_shadow[pos] then
|
||||
local c = g(ox+x, oy+y)
|
||||
if c == 0xAAAAAA then s(ox+x, oy+y, 0x666666) end
|
||||
end
|
||||
else
|
||||
local idx = pixel_index[pos]
|
||||
if idx ~= 0 then
|
||||
local c = color_table[idx + 1]
|
||||
s(ox+x, oy+y, c)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return this
|
||||
end
|
||||
|
||||
function draw_background()
|
||||
raster.clear()
|
||||
|
||||
local lc = color_table[17]
|
||||
|
||||
local k = 20
|
||||
for j = 48, 300, 16 do
|
||||
l(j, 0, j, 192, lc)
|
||||
l(j, 192, k, 215, lc)
|
||||
k = k + 20
|
||||
end
|
||||
for j = 0, 200, 16 do
|
||||
l(48, j, 288, j, lc)
|
||||
end
|
||||
l(45, 194, 291, 194, lc)
|
||||
l(41, 197, 295, 197, lc)
|
||||
l(37, 201, 300, 201, lc)
|
||||
l(30, 207, 308, 207, lc)
|
||||
l(20, 215, 319, 215, lc)
|
||||
end
|
||||
|
||||
local b = ball()
|
||||
b.decode()
|
||||
raster.init(SCREEN_W/2, SCREEN_H/4, color_table[1])
|
||||
local i = 0
|
||||
while true do
|
||||
i = i + 1
|
||||
draw_background()
|
||||
b.cycle_palette()
|
||||
b.step()
|
||||
local x, y = b.pos()
|
||||
b.draw(x, y, true)
|
||||
b.draw(x, y)
|
||||
raster.update()
|
||||
|
||||
if event.pull("key_down", 0.01) then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
raster.free()
|
||||
terminal.clear()
|
||||
@@ -34,27 +34,27 @@ if type(args[1])=="string" then
|
||||
local compID,err = getComponentID(args[1])
|
||||
if not compID then
|
||||
print("\x1b[91mCould not get component ID from '"..args[1].."'.")
|
||||
if type(err)=="string" then print("\x1b[91m"..err) end
|
||||
if type(err)=="string" then print("\x1b[91m"..err.."\x1b[0m") end
|
||||
return
|
||||
end
|
||||
if not force then
|
||||
if componentlib.additions[compID] then
|
||||
return print("\x1b[91mThis component is virtual and cannot be booted from directly.\nID: "..compID)
|
||||
if component.virtual.check(compID) then
|
||||
return print("\x1b[91mThis component is virtual and cannot be booted from directly.\nID: "..compID.."\x1b[0m")
|
||||
end
|
||||
local type = component.type(compID)
|
||||
if type~="filesystem" and type~="drive" then
|
||||
return print("\x1b[91mThis component is not a storage medium.\nID: "..compID)
|
||||
return print("\x1b[91mThis component is not a storage medium.\nID: "..compID.."\x1b[0m")
|
||||
end
|
||||
if type=="filesystem" and not fileExists(compID,"/init.lua") then
|
||||
return print("\x1b[91mThis storage medium doesn't have an \"init.lua\" file.\nID: "..compID)
|
||||
return print("\x1b[91mThis storage medium doesn't have an \"init.lua\" file.\nID: "..compID.."\x1b[0m")
|
||||
end
|
||||
end
|
||||
|
||||
computer.setBootAddress(compID)
|
||||
if computer.getBootAddress()~=compID then
|
||||
return print("\x1b[91mFailed to set the boot address.")
|
||||
return print("\x1b[91mFailed to set the boot address.\x1b[0m")
|
||||
end
|
||||
computer.shutdown(true)
|
||||
else
|
||||
shell.run("help boot")
|
||||
require("shell").run("help boot")
|
||||
end
|
||||
@@ -0,0 +1,30 @@
|
||||
local fs = require("filesystem")
|
||||
local shell = require("shell")
|
||||
|
||||
local args = {...}
|
||||
|
||||
if not args[1] then
|
||||
return shell.run("help cat")
|
||||
end
|
||||
|
||||
for _, file in pairs(args) do
|
||||
file = shell.resolvePath(file)
|
||||
|
||||
local handle = fs.open(file, "r")
|
||||
if handle == nil then
|
||||
terminal.write("\27[91mCan't open " .. file .. "\27[0m\n")
|
||||
goto continue
|
||||
end
|
||||
local enddata
|
||||
while true do
|
||||
local data = handle:read(math.huge or math.maxinteger)
|
||||
if data == nil then break end
|
||||
terminal.write(data)
|
||||
enddata = data
|
||||
end
|
||||
handle:close()
|
||||
if string.sub(enddata, -1, -1) ~= "\n" then
|
||||
print("")
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
local args = {...}
|
||||
|
||||
if args[2] then
|
||||
terminal.write("\27[91mToo many arguments.\27[0m")
|
||||
end
|
||||
|
||||
if not args[1] then
|
||||
return
|
||||
end
|
||||
|
||||
local fs = require("filesystem")
|
||||
local shell = require("shell")
|
||||
|
||||
local directory = shell.resolvePath(args[1])
|
||||
|
||||
if not fs.exists(directory) then
|
||||
terminal.write("\27[91mError: " .. directory .. ": No such file or directory\27[0m\n")
|
||||
return
|
||||
end
|
||||
|
||||
if not fs.isDirectory(directory) then
|
||||
terminal.write("\27[91mError: " .. directory .. ": Not a directory\27[0m\n")
|
||||
return
|
||||
end
|
||||
|
||||
shell.setWorkingDirectory(fs.canonical(directory))
|
||||
@@ -1,2 +1,3 @@
|
||||
clear()
|
||||
terminal.clear()
|
||||
-- truly so much going on here
|
||||
-- meow
|
||||
@@ -0,0 +1,70 @@
|
||||
local fs = require("filesystem")
|
||||
local shell = require("shell")
|
||||
|
||||
local args = {...}
|
||||
|
||||
if not args[1] then
|
||||
return shell.run("help cp")
|
||||
end
|
||||
|
||||
if not args[2] then
|
||||
terminal.write("\27[91mError: No destination\27[0m\n")
|
||||
return
|
||||
end
|
||||
|
||||
local dest = shell.resolvePath(args[#args])
|
||||
|
||||
if fs.isFile(dest) then
|
||||
if #args ~= 2 then
|
||||
terminal.write("\27[91mError: Destination is not a directory\27[0m\n")
|
||||
return
|
||||
end
|
||||
local src = shell.resolvePath(args[1])
|
||||
if not fs.exists(src) then
|
||||
terminal.write("\27[91mError: " .. src .. ": No such file or directory\27[0m\n")
|
||||
return
|
||||
end
|
||||
if fs.isDirectory(src) then
|
||||
terminal.write("\27[91mError: Cannot write directory " .. src .. " to file " .. dest .. "\27[0m\n")
|
||||
return
|
||||
end
|
||||
fs.copy(src, dest)
|
||||
elseif fs.isDirectory(dest) then
|
||||
for i = 1, #args - 1 do
|
||||
local src = shell.resolvePath(args[i])
|
||||
if src == dest then
|
||||
terminal.write("\27[91mError: Source and destination are the same\27[0m\n")
|
||||
goto continue
|
||||
end
|
||||
|
||||
if not fs.exists(src) then
|
||||
terminal.write("\27[91mError: " .. src .. ": No such file or directory\27[0m\n")
|
||||
goto continue
|
||||
end
|
||||
|
||||
fs.copy(src, fs.concat(dest, fs.basename(src)))
|
||||
::continue::
|
||||
end
|
||||
elseif not fs.exists(dest) then
|
||||
if #args ~= 2 then
|
||||
terminal.write("\27[91mError: " .. dest .. ": No such file or directory\27[0m\n")
|
||||
return
|
||||
end
|
||||
local src = shell.resolvePath(args[1])
|
||||
if not fs.exists(src) then
|
||||
terminal.write("\27[91mError: " .. src .. ": No such file or directory\27[0m\n")
|
||||
return
|
||||
end
|
||||
local destp = fs.parent(dest)
|
||||
if not fs.exists(destp) then
|
||||
terminal.write("\27[91mError: " .. destp .. ": No such file or directory\27[0m\n")
|
||||
return
|
||||
end
|
||||
if not fs.isDirectory(destp) then
|
||||
terminal.write("\27[91mError: " .. destp .. ": Not a directory\27[0m\n")
|
||||
return
|
||||
end
|
||||
fs.copy(src, dest)
|
||||
else
|
||||
terminal.write("\27[91mUnknown error\27[0m\n")
|
||||
end
|
||||
@@ -4,13 +4,13 @@ local component = require("component")
|
||||
local fs = require("filesystem")
|
||||
|
||||
if not component.list("internet")() then
|
||||
print("\27[91mThis program requires an internet card to run.")
|
||||
print("\27[91mThis program requires an internet card to run.\27[0m")
|
||||
return
|
||||
end
|
||||
|
||||
if not url then
|
||||
print("Please enter a URL to download from.")
|
||||
shell.run("help download")
|
||||
require("shell").run("help download")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -26,11 +26,11 @@ local status, errorMessage = pcall(function()
|
||||
request:finishConnect()
|
||||
end)
|
||||
if not status then
|
||||
print("\27[91mDownload failed: " .. errorMessage)
|
||||
print("\27[91mDownload failed: " .. errorMessage .. "\27[0m")
|
||||
end
|
||||
local responseCode = request:response()
|
||||
if responseCode and responseCode ~= 200 then
|
||||
print("\27[91mDownload failed: " .. tostring(responseCode))
|
||||
print("\27[91mDownload failed: " .. tostring(responseCode) .. "\27[0m")
|
||||
end
|
||||
repeat
|
||||
tmpdata = request.read(math.huge)
|
||||
@@ -39,11 +39,11 @@ until not tmpdata
|
||||
local saveLocation
|
||||
local saveLocationOK = false
|
||||
repeat
|
||||
saveLocation = read(nil, "File save location: ", fs.concat(shell.workingDirectory, url:match("/([^/]+)$")))
|
||||
saveLocation = terminal.read(nil, "File save location: ", fs.concat(require("shell").getWorkingDirectory(), url:match("/([^/]+)$")))
|
||||
if fs.isDirectory(saveLocation) then
|
||||
print("\27[91mThe specified location is a directory.")
|
||||
print("\27[91mThe specified location is a directory.\27[0m")
|
||||
elseif fs.exists(saveLocation) then
|
||||
local answer = read(nil, "\27[91mThere is already a file at the specified directory. Overwrite it? [Y/n]")
|
||||
local answer = terminal.read({prefix = "\27[91mThere is already a file at the specified directory. Overwrite it? [Y/n]\27[0m"})
|
||||
if answer:lower() ~= "n" then
|
||||
saveLocationOK = true
|
||||
end
|
||||
@@ -3,6 +3,7 @@ local fs = require("filesystem")
|
||||
local event = require("event")
|
||||
local component = require("component")
|
||||
local unicode = require("unicode")
|
||||
local workingDirectory = require("shell").getWorkingDirectory()
|
||||
local gpu = component.gpu
|
||||
local width, height = gpu.getResolution()
|
||||
local scrollPosX, scrollPosY = 1, 1
|
||||
@@ -15,9 +16,7 @@ local tab = " "
|
||||
--local ocelot = component.ocelot
|
||||
|
||||
local function rawset(x, y, text)
|
||||
termlib.cursorPosX = x
|
||||
termlib.cursorPosY = y
|
||||
termlib.write(text, false)
|
||||
terminal.write("\x1b[".. tostring(y) .. ";" .. tostring(x) .. "H" .. text)
|
||||
end
|
||||
|
||||
local filestring, filepath, handle, data, tmpdata
|
||||
@@ -25,7 +24,7 @@ if file then
|
||||
if file:sub(1, 1) == "/" then
|
||||
filepath = file
|
||||
else
|
||||
filepath = shell.workingDirectory .. file
|
||||
filepath = workingDirectory .. file
|
||||
end
|
||||
handle, data, tmpdata = fs.open(filepath, "r"), "", nil
|
||||
if fs.exists(filepath) then
|
||||
@@ -44,7 +43,7 @@ if file then
|
||||
tmpdata = {data}
|
||||
end
|
||||
else
|
||||
filepath = shell.workingDirectory .. file
|
||||
filepath = workingDirectory .. file
|
||||
filestring = "[NEW FILE]"
|
||||
tmpdata = {""}
|
||||
end
|
||||
@@ -55,7 +54,7 @@ else
|
||||
end
|
||||
local function render()
|
||||
gpu.setActiveBuffer(renderBuffer)
|
||||
clear()
|
||||
terminal.clear()
|
||||
--ocelot.log(tostring(scrollPosY))
|
||||
local realCursorX = math.min(cursorPosX, unicode.wlen(tmpdata[cursorPosY + scrollPosY - 1]) - scrollPosX + 2)
|
||||
if realCursorX < 1 then
|
||||
@@ -152,7 +151,7 @@ local function processEvent(args)
|
||||
if args[1] == "key_down" then
|
||||
local keycode = args[4]
|
||||
local key = keyboard.keys[keycode]
|
||||
if keyboard.ctrlDown then
|
||||
if keyboard.getCtrlDown() then
|
||||
return false, false, key
|
||||
end
|
||||
if key == "down" and cursorPosY < #tmpdata then
|
||||
@@ -261,14 +260,13 @@ local function save()
|
||||
gpu.setBackground(0xFFFFFF)
|
||||
gpu.setForeground(0)
|
||||
gpu.set(1, height - 1, string.rep(" ", width))
|
||||
termlib.cursorPosX = 1
|
||||
termlib.cursorPosY = height - 1
|
||||
local savepath = read(nil, "\27[107m\27[30mSave location: ", filepath)
|
||||
rawset(1, height - 1)
|
||||
local savepath = terminal.read({prefix = "\27[107m\27[30mSave location: ", defaultText = filepath})
|
||||
gpu.setBackground(0xFFFFFF)
|
||||
gpu.setForeground(0)
|
||||
if fs.exists(savepath) then
|
||||
gpu.set(1, height - 1, string.rep(" ", width))
|
||||
local answer = read(nil, "\27[107m\27[30mFile already exists. Overwrite it? [Y/n] ")
|
||||
local answer = terminal.read({prefix = "\27[107m\27[30mFile already exists. Overwrite it? [Y/n] "})
|
||||
if answer:lower() == "n" then
|
||||
gpu.setBackground(0xFFFFFF)
|
||||
gpu.setForeground(0)
|
||||
@@ -301,15 +299,14 @@ while true do
|
||||
renderFlag, cursorRenderFlag, specialKey = processEvent(args)
|
||||
if specialKey == "x" then
|
||||
if changesMade then
|
||||
termlib.cursorPosX = 1
|
||||
termlib.cursorPosY = height - 1
|
||||
local response = read(nil, "\27[107m\27[30mWould you like to save changes? [Y/n] ")
|
||||
rawset(1, height - 1)
|
||||
local response = terminal.read({prefix = "\27[107m\27[30mWould you like to save changes? [Y/n] "})
|
||||
if response:lower() ~= "n" then
|
||||
save()
|
||||
end
|
||||
end
|
||||
gpu.freeAllBuffers()
|
||||
clear()
|
||||
terminal.clear()
|
||||
return
|
||||
end
|
||||
if specialKey == "s" then
|
||||
@@ -0,0 +1,66 @@
|
||||
local component = require("component")
|
||||
local computer = require("computer")
|
||||
local filesystem = require("filesystem")
|
||||
|
||||
local function convert(value, fromUnit, toUnit)
|
||||
local units = {B = 1, KiB = 1024, MiB = 1024^2, GiB = 1024^3}
|
||||
return value * units[fromUnit] / units[toUnit]
|
||||
end
|
||||
|
||||
local function printstat(text)
|
||||
terminal.write("\27[35G" .. text .. "\n")
|
||||
end
|
||||
|
||||
local logo = ""
|
||||
local handle, tmpdata = filesystem.open("/halyde/config/oslogo.ans", "r"), nil
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge)
|
||||
logo = logo .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
handle:close()
|
||||
|
||||
terminal.write(logo)
|
||||
|
||||
terminal.write("\27[17A")
|
||||
|
||||
printstat("\27[92mOS\27[0m: " .. _OSVERSION)
|
||||
printstat("\27[92mArchitecture\27[0m: " .. _VERSION)
|
||||
|
||||
local componentCounter = 0
|
||||
for _ in component.list() do
|
||||
componentCounter = componentCounter + 1
|
||||
end
|
||||
printstat("\27[92mComponents\27[0m: " .. tostring(componentCounter))
|
||||
printstat("\27[92mCoroutines\27[0m: " .. tostring(#tsched.getTasks()))
|
||||
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 function formatBytes(bytes)
|
||||
if convert(bytes, "B", "GiB") >= 1 then
|
||||
return tostring(math.floor(convert(bytes, "B", "GiB") * 100 + 0.5) / 100) .. " GiB"
|
||||
elseif convert(bytes, "B", "MiB") >= 1 then
|
||||
return tostring(math.floor(convert(bytes, "B", "MiB") * 100 + 0.5) / 100) .. " MiB"
|
||||
elseif convert(bytes, "B", "KiB") >= 1 then
|
||||
return tostring(math.floor(convert(bytes, "B", "KiB") * 100 + 0.5) / 100) .. " KiB"
|
||||
else
|
||||
return tostring(bytes) .. " B"
|
||||
end
|
||||
end
|
||||
|
||||
printstat("\27[92mMemory\27[0m: " .. formatBytes(usedMemory) .. " / " .. formatBytes(totalMemory))
|
||||
|
||||
local totalDisk = component.invoke(computer.getBootAddress(), "spaceTotal")
|
||||
local usedDisk = component.invoke(computer.getBootAddress(), "spaceUsed")
|
||||
|
||||
printstat("\27[92mDisk\27[0m: " .. formatBytes(usedDisk) .. " / " .. formatBytes(totalDisk))
|
||||
|
||||
local gpuComponent = component.list("gpu")()
|
||||
local width, height = component.invoke(gpuComponent, "getResolution")
|
||||
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 ")
|
||||
|
||||
terminal.write("\27[5B\27[0m")
|
||||
@@ -0,0 +1,268 @@
|
||||
local fs = require("filesystem")
|
||||
local shell = require("shell")
|
||||
|
||||
local arg = ... or "default"
|
||||
local what = arg
|
||||
|
||||
local aliases = shell.getAliases()
|
||||
if aliases[what] then
|
||||
what = aliases[what]
|
||||
end
|
||||
local path = "/halyde/apps/helpdb/" .. what
|
||||
if not fs.exists(path) then
|
||||
print("Could not find help file for: " .. arg .. ".")
|
||||
return
|
||||
end
|
||||
if path == "/halyde/apps/helpdb/default" then
|
||||
return shell.run("cat " .. path) -- smh
|
||||
end
|
||||
local handle = fs.open(path, "r")
|
||||
local data = {
|
||||
command = "",
|
||||
usage = "",
|
||||
description = "",
|
||||
args = {},
|
||||
examples = {}
|
||||
}
|
||||
|
||||
while true do
|
||||
local line = ""
|
||||
while true do
|
||||
local char = handle:read(1)
|
||||
if not char then
|
||||
if line == "" then
|
||||
line = nil
|
||||
break
|
||||
end
|
||||
break
|
||||
end
|
||||
if char == "\n" then
|
||||
break
|
||||
end
|
||||
if char == "\r" then
|
||||
local next_char = handle:read(1)
|
||||
if next_char and next_char == "\n" then
|
||||
break
|
||||
elseif next_char then
|
||||
local pos = file:seek("cur")
|
||||
if pos then
|
||||
file:seek("set", pos - 1)
|
||||
end
|
||||
break
|
||||
end
|
||||
break
|
||||
end
|
||||
line = line .. char
|
||||
end
|
||||
if line == nil then
|
||||
break
|
||||
end
|
||||
line = line:match("^%s*(.-)%s*$")
|
||||
if line then
|
||||
local key, value = line:match("^(%w+)%s+(.*)$")
|
||||
if not key then goto continue end
|
||||
if key:lower() == "command" then
|
||||
data.command = value
|
||||
end
|
||||
|
||||
if key:lower() == "usage" then
|
||||
data.usage = value
|
||||
end
|
||||
|
||||
if key:lower() == "description" then
|
||||
data.description = value
|
||||
end
|
||||
|
||||
if key:lower():match("^arg%d+$") then
|
||||
local num = key:lower():match("^arg(%d+)$")
|
||||
if not data.args[tonumber(num)] then data.args[tonumber(num)] = {} end
|
||||
data.args[tonumber(num)].name = value
|
||||
end
|
||||
|
||||
if key:lower():match("^arg%d+description$") then
|
||||
local num = key:lower():match("^arg(%d+)description$")
|
||||
if not data.args[tonumber(num)] then data.args[tonumber(num)] = {} end
|
||||
data.args[tonumber(num)].description = value
|
||||
end
|
||||
|
||||
if key:lower():match("^arg%d+sub%d+$") then
|
||||
local main_num, sub_num = key:lower():match("^arg(%d+)sub(%d+)$")
|
||||
if main_num and sub_num then
|
||||
if not data.args[tonumber(main_num)] then data.args[tonumber(main_num)] = {} end
|
||||
if not data.args[tonumber(main_num)].subflags then data.args[tonumber(main_num)].subflags = {} end
|
||||
if not data.args[tonumber(main_num)].subflags[tonumber(sub_num)] then
|
||||
data.args[tonumber(main_num)].subflags[tonumber(sub_num)] = {}
|
||||
end
|
||||
data.args[tonumber(main_num)].subflags[tonumber(sub_num)].name = value
|
||||
end
|
||||
end
|
||||
|
||||
if key:lower():match("^arg%d+sub%d+description$") then
|
||||
local main_num, sub_num = key:lower():match("^arg(%d+)sub(%d+)description$")
|
||||
if main_num and sub_num then
|
||||
if not data.args[tonumber(main_num)] then data.args[tonumber(main_num)] = {} end
|
||||
if not data.args[tonumber(main_num)].subflags then data.args[tonumber(main_num)].subflags = {} end
|
||||
if not data.args[tonumber(main_num)].subflags[tonumber(sub_num)] then
|
||||
data.args[tonumber(main_num)].subflags[tonumber(sub_num)] = {}
|
||||
end
|
||||
data.args[tonumber(main_num)].subflags[tonumber(sub_num)].description = value
|
||||
end
|
||||
end
|
||||
|
||||
if key:lower():match("^example%d+$") then
|
||||
local num = key:lower():match("^example(%d+)$")
|
||||
if not data.examples[tonumber(num)] then data.examples[tonumber(num)] = {} end
|
||||
data.examples[tonumber(num)].name = value
|
||||
end
|
||||
|
||||
if key:lower():match("^example%d+description$") then
|
||||
local num = key:lower():match("^example(%d+)description$")
|
||||
if not data.examples[tonumber(num)] then data.examples[tonumber(num)] = {} end
|
||||
data.examples[tonumber(num)].description = value
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
handle:close()
|
||||
|
||||
--print(require("serialize")(data, "\t"))
|
||||
|
||||
-- Halyde terminal doesn't support bold (CSI 1 m) but who cares
|
||||
|
||||
if data.command then
|
||||
terminal.write("\27[1mUsage: \27[0m\n")
|
||||
terminal.write(" \27[96m" .. data.command)
|
||||
if data.usage then
|
||||
terminal.write("\27[93m " .. data.usage)
|
||||
end
|
||||
terminal.write("\27[0m\n\n")
|
||||
end
|
||||
|
||||
local width, height = terminal.getResolution()
|
||||
|
||||
local function wrap_text(text, indent)
|
||||
if not text then return "" end
|
||||
local words = {}
|
||||
for word in text:gmatch("%S+") do
|
||||
table.insert(words, word)
|
||||
end
|
||||
|
||||
local lines = {}
|
||||
local current_line = ""
|
||||
|
||||
for i, word in ipairs(words) do
|
||||
if #current_line + #word + 1 <= width * 0.66 - indent then
|
||||
if current_line == "" then
|
||||
current_line = word
|
||||
else
|
||||
current_line = current_line .. " " .. word
|
||||
end
|
||||
else
|
||||
table.insert(lines, current_line)
|
||||
current_line = word
|
||||
end
|
||||
end
|
||||
if current_line ~= "" then
|
||||
table.insert(lines, current_line)
|
||||
end
|
||||
|
||||
local result = {}
|
||||
for i, line in ipairs(lines) do
|
||||
if i == 1 then
|
||||
table.insert(result, line)
|
||||
else
|
||||
table.insert(result, string.rep(" ", indent) .. line)
|
||||
end
|
||||
end
|
||||
return table.concat(result, "\n")
|
||||
end
|
||||
|
||||
if data.description then
|
||||
terminal.write("\27[1mDescription:\27[0m\n")
|
||||
terminal.write(" " .. wrap_text(data.description, 2))
|
||||
terminal.write("\n\n")
|
||||
end
|
||||
|
||||
if #data.args > 0 then
|
||||
terminal.write("\27[1mArguments:\27[0m\n")
|
||||
local max_len = 0
|
||||
for _, flag in ipairs(data.args) do
|
||||
if flag.name then
|
||||
max_len = math.max(max_len, #flag.name)
|
||||
end
|
||||
for _, subf in ipairs(flag.subflags or {}) do
|
||||
if subf.name then
|
||||
max_len = math.max(max_len, #subf.name + 2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, flag in ipairs(data.args) do
|
||||
terminal.write(" \27[93m" .. (flag.name or "") .. "\27[0m" .. string.rep(" ", max_len - (flag.name and #flag.name or 0) + 2) .. wrap_text(flag.description, 4 + max_len) .. "\n")
|
||||
for _, subf in ipairs(flag.subflags or {}) do
|
||||
terminal.write(" \27[92m" .. (subf.name or "") .. "\27[0m" .. string.rep(" ", max_len - (subf.name and #subf.name or 0)) .. wrap_text(subf.description, 4 + max_len) .. "\n")
|
||||
end
|
||||
end
|
||||
terminal.write("\n")
|
||||
end
|
||||
|
||||
local function formatExampleName(name, utility)
|
||||
if not name then return name end
|
||||
|
||||
local contains = false
|
||||
if name:find(utility, 1, true) then
|
||||
contains = true
|
||||
else
|
||||
for alias, cmd in pairs(aliases) do
|
||||
if cmd == utility and name:find(alias, 1, true) then
|
||||
contains = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not contains then
|
||||
return "\27[92m" .. name
|
||||
end
|
||||
|
||||
local formatted = name
|
||||
formatted = formatted:gsub("(" .. utility .. ")", "\27[96m%1\27[92m")
|
||||
for alias, cmd in pairs(aliases) do
|
||||
if cmd == utility then
|
||||
formatted = formatted:gsub("(" .. alias .. ")", "\27[96m%1\27[92m")
|
||||
end
|
||||
end
|
||||
|
||||
return formatted
|
||||
end
|
||||
|
||||
if #data.examples > 0 then
|
||||
terminal.write("\27[1mExamples:\27[0m\n")
|
||||
local max_len = 0
|
||||
for _, flag in ipairs(data.examples) do
|
||||
max_len = math.max(max_len, #flag.name)
|
||||
end
|
||||
|
||||
for _, flag in ipairs(data.examples) do
|
||||
terminal.write(" " .. formatExampleName(flag.name, arg) .. "\27[0m" .. string.rep(" ", max_len - #flag.name + 2) .. wrap_text(flag.description, 4 + max_len) .. "\n")
|
||||
end
|
||||
terminal.write("\n")
|
||||
end
|
||||
|
||||
local first = true
|
||||
for k, v in pairs(aliases) do
|
||||
if v == arg then
|
||||
if first then
|
||||
terminal.write("\27[1mAliases:\27[0m\n ")
|
||||
end
|
||||
terminal.write("\27[96m" .. k)
|
||||
if not first then
|
||||
terminal.write("\27[0m, ")
|
||||
end
|
||||
first = false
|
||||
end
|
||||
end
|
||||
if not first then
|
||||
terminal.writec(0xa)
|
||||
end
|
||||
@@ -0,0 +1,47 @@
|
||||
COMMAND ag2
|
||||
USAGE [COMMAND] [PACKAGES] [FLAGS]
|
||||
DESCRIPTION Uses the Argentum 2 package manager.
|
||||
ARG1 COMMAND
|
||||
ARG1SUB1 install
|
||||
ARG1SUB2 remove
|
||||
ARG1SUB3 update
|
||||
ARG1SUB4 list
|
||||
ARG1SUB5 repo-list
|
||||
ARG1SUB6 repo-add
|
||||
ARG1SUB7 repo-remove
|
||||
ARG1SUB8 info
|
||||
ARG2 PACKAGES
|
||||
ARG3 FLAGS
|
||||
ARG3SUB1 -x, --exclude-deps
|
||||
ARG3SUB2 -u, --update-repos
|
||||
ARG3SUB3 -f, --force
|
||||
ARG3SUB4 -c, --clean
|
||||
ARG3SUB5 -s, --source [URL]
|
||||
ARG3SUB6 -C, --cascade
|
||||
ARG1DESCRIPTION Specifies the operation for Argentum 2 to do.
|
||||
ARG1SUB1DESCRIPTION Installs packages.
|
||||
ARG1SUB2DESCRIPTION Removes packages.
|
||||
ARG1SUB3DESCRIPTION Updates packages.
|
||||
ARG1SUB4DESCRIPTION Lists all available packages.
|
||||
ARG1SUB5DESCRIPTION Lists all installed repositories.
|
||||
ARG1SUB6DESCRIPTION Adds a custom repository.
|
||||
ARG1SUB7DESCRIPTION Removes a repository.
|
||||
ARG1SUB8DESCRIPTION Shows a packages version, description and other relevant information.
|
||||
ARG2DESCRIPTION Packages to apply operations to.
|
||||
ARG3DESCRIPTION These flags are available and can be inserted anywhere
|
||||
ARG3SUB1DESCRIPTION Ignore dependencies. WARNING: Using this can and will leave you with broken packages. Use it at your own risk and only when truly necessary.
|
||||
ARG3SUB2DESCRIPTION Update the list of repositories.
|
||||
ARG3SUB3DESCRIPTION Force the operation, even if there are conflicts or unresolvable dependencies. WARNING: Using this can and will leave you with broken packages. Use it at your own risk and only when truly necessary.
|
||||
ARG3SUB4DESCRIPTION Clean up now-unnecessary packages (previous dependencies).
|
||||
ARG3SUB5DESCRIPTION Use a custom source for the operation.
|
||||
ARG3SUB6DESCRIPTION When removing a package that other packages depend on, remove those packages too instead of aborting.
|
||||
EXAMPLE1 ag2 install halyde
|
||||
EXAMPLE2 ag2 list
|
||||
EXAMPLE3 ag2 info halyde
|
||||
EXAMPLE4 ag2 remove -x edit
|
||||
EXAMPLE5 ag2 remove -c hal-draw
|
||||
EXAMPLE1DESCRIPTION Installs the halyde package.
|
||||
EXAMPLE2DESCRIPTION Lists all packages.
|
||||
EXAMPLE3DESCRIPTION Shows information about the halyde package.
|
||||
EXAMPLE4DESCRIPTION Removes edit, but does not remove any packages that depend on it.
|
||||
EXAMPLE5DESCRIPTION Removes hal-draw and any dependencies that are no longer needed.
|
||||
@@ -0,0 +1,29 @@
|
||||
COMMAND argentum
|
||||
USAGE [COMMAND] [PACKAGES]
|
||||
DESCRIPTION Uses the Argentum package manager.
|
||||
ARG1 COMMAND
|
||||
ARG1SUB1 install
|
||||
ARG1SUB2 remove
|
||||
ARG1SUB3 update
|
||||
ARG1SUB4 list
|
||||
ARG1SUB5 search
|
||||
ARG1SUB6 info
|
||||
ARG2 PACKAGES
|
||||
ARG1DESCRIPTION Specifies the operation for Ag to do.
|
||||
ARG1SUB1DESCRIPTION Installs packages.
|
||||
ARG1SUB2DESCRIPTION Removes packages.
|
||||
ARG1SUB3DESCRIPTION Updates packages.
|
||||
ARG1SUB4DESCRIPTION Lists all available packages.
|
||||
ARG1SUB5DESCRIPTION Searches all available packages.
|
||||
ARG1SUB6DESCRIPTION Shows information on a specific package.
|
||||
ARG2DESCRIPTION Packages to apply operations to.
|
||||
EXAMPLE1 ag install hal-draw
|
||||
EXAMPLE2 ag list
|
||||
EXAMPLE3 ag info hal-draw
|
||||
EXAMPLE4 ag update hal-draw
|
||||
EXAMPLE5 ag update hal-draw
|
||||
EXAMPLE1DESCRIPTION Installs the hal-draw package.
|
||||
EXAMPLE2DESCRIPTION Lists all packages.
|
||||
EXAMPLE3DESCRIPTION Shows information about hal-draw.
|
||||
EXAMPLE4DESCRIPTION Updates the hal-draw package if it's not at the newest version.
|
||||
EXAMPLE5DESCRIPTION Updates all packages.
|
||||
@@ -0,0 +1,8 @@
|
||||
COMMAND beep
|
||||
USAGE [FLAGS]
|
||||
DESCRIPTION Make the computer beep.
|
||||
ARG1 FLAGS
|
||||
ARG1SUB1 -f, --frequency
|
||||
ARG1SUB2 -t, --time
|
||||
ARG1SUB1DESCRIPTION Specifies the frequency, in Hz. Defaults to 440Hz.
|
||||
ARG1SUB2DESCRIPTION Specifies how long, in seconds, the computer should beep. Defaults to 0.1s.
|
||||
@@ -0,0 +1,23 @@
|
||||
COMMAND boot
|
||||
USAGE [ADDRESS] [FLAGS]
|
||||
DESCRIPTION Restarts and automatically boots into any storage medium. Meant to be used for systems using a Lua BIOS EEPROM.
|
||||
ARG1 ADDRESS
|
||||
ARG1SUB1 hdd1
|
||||
ARG1SUB2 hdd2
|
||||
ARG1SUB3 floppy
|
||||
ARG1SUB4
|
||||
ARG2 FLAGS
|
||||
ARG2SUB1 -f, --force
|
||||
ARG1DESCRIPTION The storage medium to boot to.
|
||||
ARG1SUB1DESCRIPTION The first hard drive inserted in the computer.
|
||||
ARG1SUB2DESCRIPTION The second hard drive inserted in the computer.
|
||||
ARG1SUB3DESCRIPTION The floppy disk that is inserted in the computer.
|
||||
ARG1SUB4DESCRIPTION The ID of the component, abbreviated. Must have three or more characters.
|
||||
ARG2DESCRIPTION Specifies extra options when executing the command.
|
||||
ARG2SUB1DESCRIPTION Forces booting into the storage medium.
|
||||
EXAMPLE1 boot hdd1
|
||||
EXAMPLE2 boot hdd2
|
||||
EXAMPLE3 boot floppy
|
||||
EXAMPLE1DESCRIPTION Boot into the first hard drive inserted in the computer.
|
||||
EXAMPLE2DESCRIPTION Boot into the second hard drive inserted in the computer.
|
||||
EXAMPLE3DESCRIPTION Boot into the floppy disk inserted in the comuter.
|
||||
@@ -0,0 +1,9 @@
|
||||
COMMAND cat
|
||||
USAGE [FILES]...
|
||||
DESCRIPTION Concatenates and prints a file.
|
||||
ARG1 FILES
|
||||
ARG1DESCRIPTION Specifies the paths to the files to print.
|
||||
EXAMPLE1 cat /init.lua
|
||||
EXAMPLE2 cat help.lua cat.lua
|
||||
EXAMPLE1DESCRIPTION Concatenates and prints init.lua in the root directory.
|
||||
EXAMPLE2DESCRIPTION Concatenates and prints help.lua and cat.lua in the current working directory.
|
||||
@@ -0,0 +1,13 @@
|
||||
COMMAND cd
|
||||
USAGE [PATH]
|
||||
DESCRIPTION Sets the shell working directory.
|
||||
ARG1 PATH
|
||||
ARG1DESCRIPTION Specifies the path to set the shell working directory to.
|
||||
EXAMPLE1 cd /home/
|
||||
EXAMPLE2 cd halyde
|
||||
EXAMPLE3 cd ..
|
||||
EXAMPLE4 ..
|
||||
EXAMPLE1DESCRIPTION Sets the shell working directory to /home/.
|
||||
EXAMPLE2DESCRIPTION Sets the shell working directory to a directory named "halyde" in the current working directory.
|
||||
EXAMPLE3DESCRIPTION Sets the shell working directory back one directory.
|
||||
EXAMPLE4DESCRIPTION Equivalent of "cd ..".
|
||||
@@ -0,0 +1,4 @@
|
||||
COMMAND clear
|
||||
DESCRIPTION Clears the screen.
|
||||
EXAMPLE1 clear
|
||||
EXAMPLE1DESCRIPTION Clears the screen.
|
||||
@@ -0,0 +1,11 @@
|
||||
COMMAND cp
|
||||
USAGE [SOURCES]... [DESTINATION]
|
||||
DESCRIPTION Copy files and directories.
|
||||
ARG1 SOURCES
|
||||
ARG2 DESTINATION
|
||||
ARG1DESCRIPTION Specifies the files and directories to be copied.
|
||||
ARG2DESCRIPTION Specifies the path or a directory to copy to.
|
||||
EXAMPLE1 cp /home/a.txt /b.txt
|
||||
EXAMPLE2 cp c.lua /halyde/apps .
|
||||
EXAMPLE1DESCRIPTION Copies the file at /home/a.txt to /b.txt.
|
||||
EXAMPLE2DESCRIPTION Copies c.lua and /halyde/apps to the shell working directory.
|
||||
@@ -0,0 +1,28 @@
|
||||
All default Halyde shell commands:
|
||||
argentum Uses the Argentum package manager.
|
||||
boot Boots to another OS.
|
||||
cat Concatenates and prints a file.
|
||||
cd Changes directory.
|
||||
clear Clears the screen.
|
||||
cp Copies a file.
|
||||
download Downloads a file from the internet.
|
||||
echo Prints a message.
|
||||
edit Opens the text editor.
|
||||
fetch Displays system information.
|
||||
help Shows this.
|
||||
label Labels storage devices and EEPROMS.
|
||||
ls Lists files.
|
||||
lscor Lists coroutines.
|
||||
lua Starts the Lua shell.
|
||||
mkdir Makes a directory.
|
||||
mv Moves/renames a file.
|
||||
reboot Reboots the computer.
|
||||
resolution Sets the resolution.
|
||||
rm Deletes a file.
|
||||
shutdown Shuts down the computer.
|
||||
|
||||
You can get additional information on any app or command by running:
|
||||
help [COMMAND]
|
||||
|
||||
In the help documentation, an asterisk (*) next to an argument means it is optional.
|
||||
This is excluding flags, which are all optional.
|
||||
@@ -0,0 +1,7 @@
|
||||
COMMAND download
|
||||
USAGE [URL]
|
||||
DESCRIPTION Downloads a file from the internet.
|
||||
ARG1 URL
|
||||
ARG1DESCRIPTION Specifies the URL from which to download the file from.
|
||||
EXAMPLE1 download https://github.com/
|
||||
EXAMPLE1DESCRIPTION Downloads github.com.
|
||||
@@ -0,0 +1,9 @@
|
||||
COMMAND echo
|
||||
USAGE [TEXT]...
|
||||
DESCRIPTION Concatenates and prints text to the standard output.
|
||||
ARG1 TEXT
|
||||
ARG1DESCRIPTION Text to print.
|
||||
EXAMPLE1 echo test
|
||||
EXAMPLE2 echo Hello World!
|
||||
EXAMPLE1DESCRIPTION Prints "test" to the standard output.
|
||||
EXAMPLE2DESCRIPTION Prints "Hello World!" to the standard output.
|
||||
@@ -0,0 +1,9 @@
|
||||
COMMAND edit
|
||||
USAGE [PATH]
|
||||
DESCRIPTION Opens a file with the text editor, or a new blank file if not specified.
|
||||
ARG1 PATH
|
||||
ARG1DESCRIPTION Specifies the file to be opened.
|
||||
EXAMPLE1 edit
|
||||
EXAMPLE2 edit /LICENSE
|
||||
EXAMPLE1DESCRIPTION Opens a new blank file in the text editor.
|
||||
EXAMPLE2DESCRIPTION Opens /LICENSE in the text editor.
|
||||
@@ -0,0 +1,4 @@
|
||||
COMMAND fetch
|
||||
DESCRIPTION Displays system information including OS version, Lua version, memory, etc.
|
||||
EXAMPLE1 fetch
|
||||
EXAMPLE1DESCRIPTION Displays system information.
|
||||
@@ -0,0 +1,9 @@
|
||||
COMMAND help
|
||||
USAGE [COMMAND]
|
||||
DESCRIPTION Displays info on the command specified, or a list of commands if one is not specified.
|
||||
ARG1 COMMAND
|
||||
ARG1DESCRIPTION Command to display information on.
|
||||
EXAMPLE1 help
|
||||
EXAMPLE2 help cp
|
||||
EXAMPLE1DESCRIPTION Displays a list of all default commands available.
|
||||
EXAMPLE2DESCRIPTION Displays information about the cp command.
|
||||
@@ -0,0 +1,24 @@
|
||||
COMMAND label
|
||||
USAGE [ADDRESS] [LABEL]
|
||||
DESCRIPTION Get or set a label of a component that supports labelling.
|
||||
ARG1 ADDRESS
|
||||
ARG1SUB1 eeprom
|
||||
ARG1SUB2 halyde
|
||||
ARG1SUB3 slotN
|
||||
ARG1SUB4 #N
|
||||
ARG2 LABEL
|
||||
ARG1DESCRIPTION The component to use for getting or setting the label.
|
||||
ARG1SUB1DESCRIPTION The computer's EEPROM.
|
||||
ARG1SUB2DESCRIPTION The drive where the Halyde installation resides in.
|
||||
ARG1SUB3DESCRIPTION The slot number of the drive, in top-to-bottom order (range 7-9)
|
||||
ARG1SUB4DESCRIPTION The slot number of the drive, in drive space (range 1-3)
|
||||
ARG1SUB5DESCRIPTION The ID of the component, abbreviated. Must have three or more characters.
|
||||
ARG2DESCRIPTION The label to set the component to. If not found, the current label will be printed out.
|
||||
EXAMPLE1 label #3
|
||||
EXAMPLE2 label eeprom
|
||||
EXAMPLE3 label slot8 Storage
|
||||
EXAMPLE4 label halyde Halyde
|
||||
EXAMPLE1DESCRIPTION Get the label of the third drive in the computer.
|
||||
EXAMPLE2DESCRIPTION Get the label of the EEPROM inserted in the computer.
|
||||
EXAMPLE3DESCRIPTION Set the drive at slot 8 to have the label "Storage"
|
||||
EXAMPLE4DESCRIPTION Set the label of the Halyde installation to "Halyde"
|
||||
@@ -0,0 +1,19 @@
|
||||
COMMAND log
|
||||
USAGE [OPERATION] [ARGS]
|
||||
DESCRIPTION Tool to manage system logs.
|
||||
ARG1 OPERATION
|
||||
ARG1SUB1 view [LOG]
|
||||
ARG1SUB2 list
|
||||
ARG1SUB3 clear [LOG]
|
||||
ARG1SUB4 info/warn/error [LOG] [TEXT]
|
||||
ARG2 ARGS
|
||||
ARG1DESCRIPTION Operation to do with the system logs.
|
||||
ARG1SUB1DESCRIPTION View a log file.
|
||||
ARG1SUB2DESCRIPTION List all logs.
|
||||
ARG1SUB3DESCRIPTION Clear a log file, or all if none specified.
|
||||
ARG1SUB4DESCRIPTION Create a log entry for the specified log at the specified log level.
|
||||
ARG2DESCRIPTION Arguments (specified under OPERATION)
|
||||
EXAMPLE1 log view example
|
||||
EXAMPLE2 log list
|
||||
EXAMPLE3 log clear example
|
||||
EXAMPLE4 log info example This is an example.
|
||||
@@ -0,0 +1,11 @@
|
||||
COMMAND ls
|
||||
USAGE [PATH]...
|
||||
DESCRIPTION Lists all files and directories in the specified path, or in the shell working directory if the path isn't specified. Directories are shown in [93myellow[0m, executable files are shown in [92mgreen[0m, and other files are shown in white.
|
||||
ARG1 PATH
|
||||
ARG1DESCRIPTION Path to the directories to list files and subdirectories from.
|
||||
EXAMPLE1 ls
|
||||
EXAMPLE2 ls /halyde
|
||||
EXAMPLE3 ls apps
|
||||
EXAMPLE1DESCRIPTION Lists all files and directories from the current shell working directory.
|
||||
EXAMPLE2DESCRIPTION Lists all files and directories from /halyde.
|
||||
EXAMPLE3DESCRIPTION Lists all files and directories from the apps directory in the shell working directory.
|
||||
@@ -0,0 +1,4 @@
|
||||
COMMAND lscor
|
||||
DESCRIPTION Lists every active coroutine by ID and name.
|
||||
EXAMPLE1 lscor
|
||||
EXAMPLE1DESCRIPTION Lists every active coroutine by ID and name.
|
||||
@@ -0,0 +1,37 @@
|
||||
COMMAND lsdrv
|
||||
USAGE [FLAGS]
|
||||
DESCRIPTION Shows all drives that are inserted into the computer.
|
||||
ARG1 FLAGS
|
||||
ARG1SUB1 -a, --all
|
||||
ARG1SUB2 -o, --output [COLS]
|
||||
ARG1SUB3 -s, --show [EXPR]
|
||||
ARG1SUB4 -S, --sort [EXPR]
|
||||
ARG1SUB5 EXPR
|
||||
ARG2 PACKAGES
|
||||
ARG1DESCRIPTION Specifies extra options when executing the command.
|
||||
ARG1SUB1DESCRIPTION Shows every column and every component. Acts the same as '-o all -s all'. Possible columns are: "slot", "capacity", "managed", "readOnly", "id", "mount", "bootable", and "label". If the list of columns start with a "+", the default columns will appear first. Default columns are slots, capacity, the entire ID, the mount point, and the drive label.
|
||||
ARG1SUB2DESCRIPTION Specifies the columns to output in the output table.
|
||||
ARG1SUB3DESCRIPTION Only list drives when the expression returns 'true'.
|
||||
ARG1SUB4DESCRIPTION Sort the output by an expression that returns a number. The higher the number, the lower the drive is displayed, and vice-versa.
|
||||
ARG1SUB5DESCRIPTION An expression in Lua, for filtering or sorting output. If this expression contains spaces, make sure to put quotation marks on them!
|
||||
ARG1SUB6DESCRIPTION Built-in variables are: "component", "computer", "type", "id", "readonly", "capacity", "managed", "eeprom", "halyde", "tmp", "proxy", "slot", and "all" (true).
|
||||
EXAMPLE1 lsdrv
|
||||
EXAMPLE2 lsdrv -a
|
||||
EXAMPLE3 lsdrv -o +bootable
|
||||
EXAMPLE4 lsdrv -o slot,label -s halyde
|
||||
EXAMPLE5 lsdrv -o mount,capacity,label -s "not halyde"
|
||||
EXAMPLE6 lsdrv -s type=='filesystem'
|
||||
EXAMPLE7 lsdrv -s slot==1
|
||||
EXAMPLE8 lsdrv -S capacity
|
||||
EXAMPLE9 lsdrv -S -capacity
|
||||
EXAMPLE10 lsdrv -o +managed -S managed
|
||||
EXAMPLE1DESCRIPTION Show regular drives, with the default columns.
|
||||
EXAMPLE2DESCRIPTION Show all storage components, with every column.
|
||||
EXAMPLE3DESCRIPTION Show drives, with an added "bootable" category.
|
||||
EXAMPLE4DESCRIPTION Show the slot and the label of the drive where Halyde is installed.
|
||||
EXAMPLE5DESCRIPTION Show the mount points, capacities and labels of all drives other than Halyde.
|
||||
EXAMPLE6DESCRIPTION Only show managed drives.
|
||||
EXAMPLE7DESCRIPTION Show all drives that aren't physical (Virtual components, tmpfs)
|
||||
EXAMPLE8DESCRIPTION Sort the drives by capacity, in ascending order.
|
||||
EXAMPLE9DESCRIPTION Sort the drives by capacity, in descending order.
|
||||
EXAMPLE10DESCRIPTION Show managed drives first, then unmanaged drives second, with an extra "managed" column.
|
||||
@@ -0,0 +1,4 @@
|
||||
COMMAND lua
|
||||
DESCRIPTION Starts the Lua shell, where you can type commands to interpret them in real time.
|
||||
EXAMPLE1 lua
|
||||
EXAMPLE1DESCRIPTION Starts the Lua shell.
|
||||
@@ -0,0 +1,2 @@
|
||||
COMMAND maindrv
|
||||
DESCRIPTION Shows the entire ID of the drive where Halyde is installed to.
|
||||
@@ -0,0 +1,7 @@
|
||||
COMMAND mkdir
|
||||
USAGE [PATH]...
|
||||
DESCRIPTION Makes a directory.
|
||||
ARG1 PATH
|
||||
ARG1DESCRIPTION Specifies the path to create the directory in.
|
||||
EXAMPLE1 mkdir a
|
||||
EXAMPLE1DESCRIPTION Creates a directory named a in the current shell working directory.
|
||||
@@ -0,0 +1,11 @@
|
||||
COMMAND mv
|
||||
USAGE [SOURCE].. [DESTINATION]
|
||||
DESCRIPTION Moves/renames a file.
|
||||
ARG1 SOURCE
|
||||
ARG2 DESTINATION
|
||||
ARG1DESCRIPTION Specifies the files and directories to be moved.
|
||||
ARG2DESCRIPTION Specifies the path or a directory to copy to.
|
||||
EXAMPLE1 mv /home/a.txt /b.txt
|
||||
EXAMPLE2 mv ../c.lua /halyde/apps .
|
||||
EXAMPLE1DESCRIPTION Moves the file at /home/a.txt to /b.txt.
|
||||
EXAMPLE2DESCRIPTION Moves c.lua from a subdirectory and /halyde/apps to the shell working directory.
|
||||
@@ -0,0 +1,4 @@
|
||||
COMMAND reboot
|
||||
DESCRIPTION Reboots the computer.
|
||||
EXAMPLE1 reboot
|
||||
EXAMPLE1DESCRIPTION Reboots the computer.
|
||||
@@ -0,0 +1,11 @@
|
||||
COMMAND res
|
||||
USAGE [FLAGS]
|
||||
DESCRIPTION Gets or sets the current resolution.
|
||||
ARG1 FLAGS
|
||||
ARG1SUB1 [no flags]
|
||||
ARG1SUB2 -x [number]
|
||||
ARG1SUB3 -y [number]
|
||||
ARG1DESCRIPTION Specifies extra options when executing the command.
|
||||
ARG1SUB1DESCRIPTION Displays the current and maximum resolution.
|
||||
ARG1SUB2DESCRIPTION Displays the current and maximum resolution on the x-axis. A new x-axis resolution can be specified as a number.
|
||||
ARG1SUB3DESCRIPTION Displays the current and maximum resolution on the y-axis. A new y-axis resolution can be specified as a number.
|
||||
@@ -0,0 +1,7 @@
|
||||
COMMAND rm
|
||||
USAGE [PATH]...
|
||||
DESCRIPTION Removes files and directories.
|
||||
ARG1 PATH
|
||||
ARG1DESCRIPTION Specifies the files and directories to be moved/renamed.
|
||||
EXAMPLE1 rm a.txt
|
||||
EXAMPLE1DESCRIPTION Removes a.txt in the current shell working directory.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user