This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
thewmatt's profile picture

ThewOS!

Started by thewmatt, 13 July 2014 - 08:18 PM
thewmatt #1
Posted 13 July 2014 - 10:18 PM
Hello! This is My first OS so please treat me gently.

function color(back,text)
term.setBackgroundColor(back)
term.setTextColor(text)
end
function menu()
term.setBackgroundColor(colors.blue)
term.clear()
term.setBackgroundColor(colors.green)
term.setCursorPos(1,19)
print("												   ")
term.setCursorPos(2,18)
color(colors.red, 1)
term.write(" ")
color(colors.lime, 1)
print(" ")
term.setCursorPos(2,19)
color(colors.blue, 1)
term.write(" ")
color(colors.yellow, 1)
term.write(" ")
term.setCursorPos(1,1)
color(colors.blue,1)
print("ThewOS 1.9")
end
menu()
while true do
scrap, scrap, xx, yy = os.pullEvent("mouse_click")
if xx > 1 and xx < 4 and yy > 17 and yy < 20 then
start = paintutils.loadImage("thewos/start")
paintutils.drawImage(start, 1, 10)
term.setCursorPos(1,11)
term.setTextColor(colors.black)
print("Reboot")
print("shutdown")
print("minecraft")
print("run")
print("uninstall")
print("adventure")
print("worm")
term.setTextColor(1)
elseif xx < 7 and xx > 0 and yy == 11 then
sleep(1)
os.reboot()
elseif xx < 9 and xx > 0 and yy == 12 then
sleep(1)
os.shutdown()
elseif xx < 9 and xx > 0 and yy == 13 then
sleep(1)
shell.run("thewos/mc")
menu()
elseif xx < 4 and xx > 0 and yy == 14 then
color(colors.black , colors.yellow)
term.clear()
term.setCursorPos(1,1)
run = read()
shell.run(run)
sleep(1)
menu()
elseif xx < 10 and xx > 0 and yy == 15 then
shell.run("thewos/un")
elseif xx < 10 and xx > 0 and yy == 16 then
color(colors.black,1)
shell.run("clear")
shell.run("adventure")
menu()
elseif xx < 5 and xx > 0 and yy == 17 then
color(colors.black,1)
shell.run("clear")
shell.run("worm")
menu()
else
starto = false
menu()
end
end

Download: pastebin run m4cen3RC
Saldor010 #2
Posted 14 July 2014 - 03:22 AM
Hey, I have to admit, this is better then most peoples first OS. Put some more work into it, rewrite a few things, add some Desktop functionality, and I think you got a pretty spiffy Operating System.
thewmatt #3
Posted 07 August 2014 - 09:06 AM
thanks!
DannySMc #4
Posted 11 December 2014 - 03:49 PM
Hello! This is My first OS so please treat me gently.

function color(back,text)
term.setBackgroundColor(back)
term.setTextColor(text)
end
function menu()
term.setBackgroundColor(colors.blue)
term.clear()
term.setBackgroundColor(colors.green)
term.setCursorPos(1,19)
print("												   ")
term.setCursorPos(2,18)
color(colors.red, 1)
term.write(" ")
color(colors.lime, 1)
print(" ")
term.setCursorPos(2,19)
color(colors.blue, 1)
term.write(" ")
color(colors.yellow, 1)
term.write(" ")
term.setCursorPos(1,1)
color(colors.blue,1)
print("ThewOS 1.9")
end
menu()
while true do
scrap, scrap, xx, yy = os.pullEvent("mouse_click")
if xx > 1 and xx < 4 and yy > 17 and yy < 20 then
start = paintutils.loadImage("thewos/start")
paintutils.drawImage(start, 1, 10)
term.setCursorPos(1,11)
term.setTextColor(colors.black)
print("Reboot")
print("shutdown")
print("minecraft")
print("run")
print("uninstall")
print("adventure")
print("worm")
term.setTextColor(1)
elseif xx < 7 and xx > 0 and yy == 11 then
sleep(1)
os.reboot()
elseif xx < 9 and xx > 0 and yy == 12 then
sleep(1)
os.shutdown()
elseif xx < 9 and xx > 0 and yy == 13 then
sleep(1)
shell.run("thewos/mc")
menu()
elseif xx < 4 and xx > 0 and yy == 14 then
color(colors.black , colors.yellow)
term.clear()
term.setCursorPos(1,1)
run = read()
shell.run(run)
sleep(1)
menu()
elseif xx < 10 and xx > 0 and yy == 15 then
shell.run("thewos/un")
elseif xx < 10 and xx > 0 and yy == 16 then
color(colors.black,1)
shell.run("clear")
shell.run("adventure")
menu()
elseif xx < 5 and xx > 0 and yy == 17 then
color(colors.black,1)
shell.run("clear")
shell.run("worm")
menu()
else
starto = false
menu()
end
end

Download: pastebin run m4cen3RC

I get this is your first 'OS' but let's start with a few basics, this is not an OS, just a program, that can do like 2 things. You can run games that you can in CraftOS, no offense a little useless.

Try the following:
+ More than 75 lines would be nice, a decent based OS is at least 1000 lines, if anything.
+ Add programs that are useful!
+ Create a desktop, I have an API that can do this?
+ Look into Lua more and research other OS's and what they can do,