print([[
_______ ______ _____ __ __ _____ _ _ _
|__ __| ____| __ \| \/ |_ _| \ | | /\ | |
| | | |__ | |__) | \ / | | | | \| | / \ | |
| | | __| | _ /| |\/| | | | | . ` | / /\ \ | |
| | | |____| | \ \| | | |_| |_| |\ |/ ____ \| |____
|_| |______|_| \_\_| |_|_____|_| \_/_/ \_\______|
]])
local system = {
version = "1.0.5",
status = "READY.",
pashint = "password is Password!",
update = "2004/3/9",
files = { ["memo.txt"] = { content = "Password is 'password!'", time = "2004/3/9" },
["hint.sys"] = { content = "The update date might be important...", time = "2004/3/9" }
}
}
setmetatable(system, { __index = function(t, key)
return ">>ERROR: '" .. tostring(key) .. "' は無効な命令です"
end
}
)
local commands = {}
commands.help = function()
print("AVAILABLE: status, update, help, ls, cat, write, exit")
end
commands.status = function() print("VERSION: " .. system.version) end
commands.update = function() print("LAST UPDATED: " .. system.update) end
commands.ls = function()
print("--- VIRTUAL FILES ---")
for name, data in pairs(system.files) do
local time = (type(data) == "table") and data.time or system.update
print(string.format("- %-12s [%s]", name, time))
end
end
commands.cat = function()
io.write("ENTER FILENAME: ")
io.flush()
local target = io.read():lower()
local file = system.files[target]
if file and type(file) == "table" then
print("----------------------------")
print("FILE: " .. target)
print("TIME: " .. file.time)
print("CONTENT: " .. file.content)
print("----------------------------")
else
print(">>ERROR: ファイルが見つかりません")
end
end
commands.write = function()
io.write("ENTER FILENAME: ")
io.flush()
local name = io.read():lower()
io.write("ENTER CONTENT: ")
io.flush()
local body = io.read()
system.files[name] = {
content = body,
time = os.date("%Y/%m/%d %H:%M:%S")
}
print("\nSYSTEM@admin: The `write` command is still under development and the method for saving data hasn't been finalized yet, so you won't be able to view it later:( sorry guys")
print("SUCCESS: FILE CREATED?")
end
print("--- SYSTEM TERMINAL BOOTING ---")
while true do
io.write("\nTYPE 'START' TO LOGIN: ")
io.flush()
local raw_input = io.read()
if raw_input == nil then return end
local cmd = raw_input:lower()
if cmd == "start" then
io.write("ENTER PASSWORD: ")
io.flush()
local pass = io.read()
if pass == "password!" then
print("OS INITIALIZED. WELCOME ADMIN.")
break
else
print("ACCESS DENIED.")
end
elseif cmd == "exit" then return end
end
while true do
io.write("\nADMIN@ROOT: ")
io.flush()
local input = io.read()
if input == nil then break end
local cmd = input:lower()
if cmd == "exit" then
print("-- SYSTEM SHUTDOWN ... --")
break
elseif commands[cmd] then
commands[cmd]()
else
print(system[cmd])
end
end
To embed this project on your website, copy the following code and paste it into your website's HTML: