e
This commit is contained in:
2
AceVM/disks/1h/bin_/beep
Normal file
2
AceVM/disks/1h/bin_/beep
Normal file
@@ -0,0 +1,2 @@
|
||||
local computer=component.getFirst("computer")
|
||||
computer.beep(800, 0.2, 1)
|
||||
2
AceVM/disks/1h/bin_/clear
Normal file
2
AceVM/disks/1h/bin_/clear
Normal file
@@ -0,0 +1,2 @@
|
||||
local term=component.getFirst("screen")
|
||||
term.clear()
|
||||
17
AceVM/disks/1h/bin_/debug
Normal file
17
AceVM/disks/1h/bin_/debug
Normal file
@@ -0,0 +1,17 @@
|
||||
local args={...}
|
||||
local term=component.getFirst("screen")
|
||||
local hpv=require("hypervisor")
|
||||
local fs=require("filesystem")
|
||||
if not (fs.exists("/bin/"..args[1]) and (not fs.isDir("/bin/"..args[1]))) then error("not a file") end
|
||||
local handle = hpv.createProcessFromFile("/bin/"..args[1], args[1], table.unpack(args, 2))
|
||||
local pid=handle.getID()
|
||||
local debugger=hpv.attachDebugger(handle)
|
||||
debugger.addEvent("threadReturn", function(...)
|
||||
term.print("threadReturn", ...)
|
||||
end)
|
||||
debugger.addEvent("threadError", function(...)
|
||||
term.print("threadError", ...)
|
||||
end)
|
||||
while hpv.isrunning(pid) do
|
||||
sleep(0.5)
|
||||
end
|
||||
0
AceVM/disks/1h/bin_/ls
Normal file
0
AceVM/disks/1h/bin_/ls
Normal file
24
AceVM/disks/1h/bin_/neofetch
Normal file
24
AceVM/disks/1h/bin_/neofetch
Normal file
@@ -0,0 +1,24 @@
|
||||
local term=component.getFirst("screen")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | root@hyperion ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ------------- ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | OS: Hyperion AC ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | Host: $Computer_id ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | Kernel: Hyprkrnl 1.0.0 ")
|
||||
term.print("⠀⢷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡞⠀ | Uptime: 2:00 ")
|
||||
term.print("⠀⠈⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⠁⠀ | Packages: 204 ")
|
||||
term.print("⠀⠀⠘⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⠃⠀⠀ | Shell: DoomieShell ")
|
||||
term.print("⠀⠀⠀⢹⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⡏⠀⠀⠀ | Resolution: $monitor_size ")
|
||||
term.print("⠀⠀⠀⠀⢻⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡟⠀⠀⠀⠀ | DE: ComputeX ")
|
||||
term.print("⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀⠀ | WM: HWMS ")
|
||||
term.print("⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⡿⠋⠁⠀⠀⠀⠀⠀ | WM Theme: Standard dark ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣦⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⣠⣿⣿⣿⣿⡿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀ | Theme: Standard dark ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⢠⣀⠀⠀⠈⠛⢿⣿⣿⣷⣄⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⣠⣾⣿⣿⡿⠛⠁⠀⠀⣀⡄⠀⠀⠀⠀⠀⠀⠀ | Icons: Standard ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠈⢿⣿⣶⣤⣀⠀⠈⠛⢿⣿⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⣿⡿⠛⠁⠀⣀⣤⣶⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀ | Terminal: Goterm ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣶⡄⢸⣿⠀⠀⠸⣿⣿⣿⣿⡏⠀⠀⣿⡇⢠⣶⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀ | ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⠿⠿⠿⠟⠛⠃⢸⣿⠀⠀⠀⠹⣿⣿⡟⠀⠀⠀⣿⡇⠘⠛⠻⠿⠿⠿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⡄⢸⣿⡀⠀⠀⠀⢻⡿⠁⠀⠀⢀⣿⡇⢠⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⣿⣿⠇⠘⢿⣿⣦⡀⠀⠀⠁⠀⢀⣴⣿⡿⠃⠸⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡿⠋⠀⠀⠀⠀⠙⣿⣿⣦⡀⢀⣴⣿⡿⠋⠀⠀⠀⠈⠙⠿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ")
|
||||
term.print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ")
|
||||
13
AceVM/disks/1h/bin_/pge
Normal file
13
AceVM/disks/1h/bin_/pge
Normal file
@@ -0,0 +1,13 @@
|
||||
local function func(tble,space)
|
||||
space=space or ""
|
||||
for i,v in pairs(tble) do
|
||||
print(space..tostring(i).." | "..tostring(v))
|
||||
if type(v) == "table" then
|
||||
if i=="_G" then else
|
||||
func(v,space.." ")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
func(_G)
|
||||
2
AceVM/disks/1h/bin_/reboot
Normal file
2
AceVM/disks/1h/bin_/reboot
Normal file
@@ -0,0 +1,2 @@
|
||||
local computer=component.getFirst("computer")
|
||||
computer.reboot()
|
||||
52
AceVM/disks/1h/bin_/shell
Normal file
52
AceVM/disks/1h/bin_/shell
Normal file
@@ -0,0 +1,52 @@
|
||||
local stringBuffer=""
|
||||
local hpv = require("hypervisor")
|
||||
local fs = require("filesystem")
|
||||
local term=component.getFirst("screen")
|
||||
local captureInput=true
|
||||
local exit=false
|
||||
local function printPrefix()
|
||||
term.printInline("root@testharness:/& ")
|
||||
end
|
||||
|
||||
local function tokenize(str)
|
||||
return string.split(str, " ")
|
||||
end
|
||||
|
||||
hpv.addEvent("keyTyped",function(...)
|
||||
if not captureInput then return end
|
||||
local char=({...})[1]
|
||||
if char == "\n" then
|
||||
captureInput=false
|
||||
term.print("")
|
||||
elseif char == "\b" then
|
||||
if #stringBuffer > 0 then
|
||||
stringBuffer=stringBuffer:sub(1,#stringBuffer-1)
|
||||
term.printInline(char)
|
||||
end
|
||||
else
|
||||
stringBuffer=stringBuffer..char
|
||||
term.printInline(char)
|
||||
end
|
||||
end)
|
||||
|
||||
printPrefix()
|
||||
while not exit do
|
||||
while captureInput do
|
||||
sleep(1)
|
||||
end
|
||||
local token = tokenize(stringBuffer)
|
||||
if token[1] == "exit" then
|
||||
exit=true
|
||||
elseif fs.exists("/bin/"..token[1]) and (not fs.isDir("/bin/"..token[1])) then
|
||||
local handle = hpv.createProcessFromFile("/bin/"..token[1], token[1], table.unpack(token, 2))
|
||||
local pid=handle.getID()
|
||||
while hpv.isrunning(pid) do
|
||||
sleep(0.5)
|
||||
end
|
||||
else
|
||||
term.print("Command not recognized")
|
||||
end
|
||||
stringBuffer=""
|
||||
printPrefix()
|
||||
captureInput=true
|
||||
end
|
||||
2
AceVM/disks/1h/bin_/t
Normal file
2
AceVM/disks/1h/bin_/t
Normal file
@@ -0,0 +1,2 @@
|
||||
local print=component.getFirst("screen").print
|
||||
print("test")
|
||||
23
AceVM/disks/1h/bin_/top
Normal file
23
AceVM/disks/1h/bin_/top
Normal file
@@ -0,0 +1,23 @@
|
||||
local hpv=require("hypervisor")
|
||||
local term=component.getFirst("screen")
|
||||
|
||||
term.clear()
|
||||
local function m(str, m)
|
||||
if #str>m then
|
||||
return str:sub(1,m-1).."- "
|
||||
else
|
||||
while #str~=m do
|
||||
str=str.." "
|
||||
end
|
||||
return str.." "
|
||||
end
|
||||
end
|
||||
|
||||
for i in hpv.listProc() do
|
||||
term.print(m(i.name, 15)..m(i.status, 7)..m(i.pid, 4))
|
||||
for _,v in ipairs(i.threads) do
|
||||
if v.name~="main" then
|
||||
term.print(" "..m(v.name, 12)..m(v.status, 7))
|
||||
end
|
||||
end
|
||||
end
|
||||
19
AceVM/disks/1h/bin_/unitest
Normal file
19
AceVM/disks/1h/bin_/unitest
Normal file
@@ -0,0 +1,19 @@
|
||||
local errors={}
|
||||
local function tables_equal(t1, t2)
|
||||
if #t1 ~= #t2 then return false end
|
||||
for i = 1, #t1 do
|
||||
if t1[i] ~= t2[i] then return false end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
local function run_test(name, test_func)
|
||||
local status, err = pcall(test_func)
|
||||
if status then
|
||||
print("[PASS] " .. name)
|
||||
else
|
||||
print("[FAIL] " .. name .. ": " .. err)
|
||||
errors[name]=err
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user