local author = "austinv11"
globalVersion = "0.1.0PR1"
function checkInstallation()
local check = fs.exists("internal")
if check == false then
return false
end
end
function sp() --internal system profiler
local ver = "0.1"
term.clear()
local text = string.len("Sytstem Profiler V."..ver)
local x,y = term.getSize()
local l = term.setCursorPos(math.ceil((x / 2) - ( text/ 2)), y)
term.setCursorPos(1,2)
local over = os.version()
if turtle then
local f = turtle.getFuelLevel()
print("OS ="..over)
print("Fuel Level: "..f)
else
print("OS ="..over)
end
print("Anvil V."..globalVersion)
local id = os.getComputerID()
print("Computer ID = "..id)
local ll = os.getComputerLabel()
if ll == nil then
ll = "nil"
end
print("Computer Label = "..ll)
local internal = os.clock()
print("Operating Time = "..internal)
local internal = os.time()
print("Current Time = "..internal)
local internal = os.day()
print("Current Day = "..internal)
--[[local internal = disk.isPresent() CURRENTLY BROKEN
local n = diskgetID()
if internal == true then
print("Disk: True ("..n..")")
else
print("Disk: False")
end ]]--
local check = fs.getFreeSpace("/")
print("Remaining Space: "..check.." bytes")
local check = term.isColor()
if check == true then
check = "True"
else
check = "False"
end
print("Advanced Computer: "..check)
print("Screen Size; X = "..x.." Y = "..y)
end
function main()
term.setTextColor(colors.yellow)
term.write("> ")
term.setTextColor(colors.white)
local i = read()
if i == "AML help" then -- demonstrates usages
term.setTextColor(colors.red)
print("Usages: AML help <list or name> <if list, apis or programs")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help list" then
term.setTextColor(colors.red)
print("Usages AML help list <apis or programs>")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help list apis" then
term.setTextColor(colors.yellow)
print("Available APIs:")
print("GridLock, austinLib, loginUtil, ggui, goroutine, redirect, ctrlkeys, GameUtils")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help list programs" then
term.setTextColor(colors.yellow)
print("Available Programs:")
print("system profiler, luaIDE, NPaintPro, lightshot, laserblast")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help GridLock" then
term.setTextColor(colors.yellow)
print("A button api by me, austinv11, it offers a unique way for declaring and drawing buttons")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help austinLib" then
term.setTextColor(colors.yellow)
print("A general/random api by me, austinv11, it offers random, but useful, functions")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help loginUtil" then
term.setTextColor(colors.yellow)
print("A security/login api created by me, austinv11, it offers many useful security functions")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help ggui" then
term.setTextColor(colors.yellow)
print("A gui api by GopherAtl, it's a BETA build, and is very 'robust'")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help goroutine" then
term.setTextColor(colors.yellow)
print("An enhancement API for coroutines by GopherAtl, replace parallels with this!")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help redirect" then
term.setTextColor(colors.yellow)
print("A buffer API by GopherAtl, creates buffer objects which can be used by term.redirect")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help ctrlkeys" then
term.setTextColor(colors.yellow)
print("A 'button shortcut' API by GopherAtl, it is a flexible API for commands tha involve CTRL + <any key>")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help GameUtils" then
term.setTextColor(colors.yellow)
print("A useful game utility library by NitrogenFingers, use either paint or NPaintPro to import and create objects for games!")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help luaIDE" then
term.setTextColor(colors.yellow)
print("luaIDE is an extremely in-depth and well-done code editor by GravityScore")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help NPaintPro" then
term.setTextColor(colors.yellow)
print("The original (and better) paint program, by NitrogenFingers, export these files to make games (through GameUtils)")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help lightshot" then
term.setTextColor(colors.yellow)
print("The fantastic screen recorder (yup, you read that right) by GravityScore")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "AML help laserblast" then
term.setTextColor(colors.yellow)
print("The cool game by NitrogenFingers")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "luaIDE" then
os.run({}, "internal/luaIDE")
os.reboot()
elseif i == "NPaintPro" then
os.run({}, "internal/NPaintPro")
os.reboot()
elseif i == "lightshot" then
os.run({}, "internal/lightshot")
os.reboot()
elseif i == "laserblast" then
os.run({}, "internal/laserblast")
os.reboot()
elseif i == "AML help system profiler" then
term.setTextColor(colors.yellow)
print("Shows general system info")
term.setTextColor(colors.white)
os.run({},"internal/Anvil_Shell")
elseif i == "system profiler" then
sp()
os.run({},"internal/Anvil_Shell")
else
shell.run(i)
os.reboot()
end
end
local c = checkInstallation()
if c == false then
print("Anvil not correctly installed!")
else
main()
end
if i were to write an input like "system profiler" which is recognized as a "command", it runs, or "NPaintPro", but anything else like, "edit <name>" (where it should go to the shell.run(i) line, it says, "attempt to index ? (a nil value)"