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

A Sample OS - For those beginners...

Started by remiX, 17 January 2013 - 07:02 AM
remiX #1
Posted 17 January 2013 - 08:02 AM
So I made a simple Sample OS for anyone (mostly beginners) that can be used in anyway one pleases.
Not sure if this should go into general or here, but oh well :P/>/>

What does it have?
  • Advanced functions for the most efficient non-flicker display.
  • A start menu with:
    • Your own list of programs
    • A help option that displays all the text in the table with the text (you'll know if you look at the code) with:
      • Scroll feature
    • A reboot option
    • .. More of your own can be added by adding more options into the t_startMenu["main"] table
  • Time at the top right
  • Advanced right-click popup menu.
Code:
Pastebin: Sample OS
I added as many comments as I could… If you still need more explaining, feel free to ask here or PM me.

Screenshots:

SpoilerDesktop
Spoiler

Right click feature
SpoilerDefault position is going right and down:
Spoiler

It won't go past the 'taskbar' (it doesn't show mouse because I used snipping tool for this, so it doesn't display the mouse
Spoiler

Won't get cut off the screen on the right, it will go to the left if there is no space
Spoiler

Start menu
SpoilerWhen clicking the bottom left
Spoiler

Help menu (program menu looks the same)
Spoiler

I'll probably not be updating this because there's probably not much I can add for an 'example/sample' OS, but you may request something if you need.

Well.. enjoy :P/>/>
pielover88888 #2
Posted 17 January 2013 - 12:29 PM
Screenshots? And..wow this kicks my os's butt. :|

Good job, lol!
imef #3
Posted 17 January 2013 - 01:58 PM
This certainly has some potential. You should keep on working on that!
remiX #4
Posted 17 January 2013 - 06:15 PM
Screenshots? And..wow this kicks my os's butt. :|

Actually didn't think of adding screenshots :P/> Will add some now…

This certainly has some potential. You should keep on working on that!

There are so many OS's out there and I really don't feel like keeping something up to date at the moment, I just started my Matric year so I won't have much time.
theoriginalbit #5
Posted 17 January 2013 - 06:21 PM
I just started my Matric year so I won't have much time.
Matric year…. I'm not familiar with that… what is it?
remiX #6
Posted 17 January 2013 - 06:22 PM
I just started my Matric year so I won't have much time.
Matric year…. I'm not familiar with that… what is it?

Pfft :P/>
theoriginalbit #7
Posted 17 January 2013 - 06:34 PM
Pfft :P/>
Its ok… I know now… Helps if i read the correct link off Google :P/>
remiX #8
Posted 18 January 2013 - 09:58 AM
Looks like there aren't any more beginners that need guides / help :lol:/>
Getalife #9
Posted 19 January 2013 - 07:25 AM
This is cool :)/> I've been trying to make my own OS and I'll probably base it off this, thanks!
Mandrewx #10
Posted 19 January 2013 - 12:47 PM
Kind of a noob-ish question… But how do I make the program execute anything and- or run a different file?

Great OS, though. Makes things a lot easier for us noobs. : )
DarkenedEvil #11
Posted 19 January 2013 - 03:38 PM
there are different ways you could do this mandrew. I like to use shell.run(program name) but you can also use os.run({},program name) for example:

term.clear()
term.setCursorPos(1,1)
print("Enter a program name.")
write("> ")
local program = read()
shell.run(program)

OR
print("Running startup!")
shell.run("startup")
Mandrewx #12
Posted 19 January 2013 - 10:33 PM
Yeah, I know the basics and whatnot. : ) Thing is, I want to make the program buttons in the OS activate a command and- or a different program.
Bit hard, you see. Thanks anyway. : )

Edit:
Probably should have specified that before. Terribly sorry, DarkenedEvil.
remiX #13
Posted 20 January 2013 - 01:09 AM
Oh, do you mean for the right-click popup menu, or within the start?

This can be used for the popupmenu:

bValidClick, option = popupMenu(e[3], e[4], colours.black, colours.lightBlue, "Option1", "Option2", "Option3")
--[[ Add an if, elseif, end statement here for
each option and what it must do
--]]
if bValidClick then -- so it only does this code if it was a valid click.
	if option == "Option 1" then

	elseif option == "Option 2" then
	-- Say now option 2 is an option to run a program
	shell.run("programName")
	elseif option == "Option 3" then
	
	end
end
Mandrewx #14
Posted 20 January 2013 - 01:28 AM
Thanks for that popup-thing. I meant when you've clicked Start and opened Programs and click on one of the listed programs there. : )
remiX #15
Posted 20 January 2013 - 02:34 AM
Oh! I'll need to change that then, the programs that show up aren't clickable, it just lists what it does.

Let me do this and I'll get back to you.
Mandrewx #16
Posted 20 January 2013 - 03:39 AM
Oh! I'll need to change that then, the programs that show up aren't clickable, it just lists what it does.

Let me do this and I'll get back to you.

You're a lifesaver! : ) Been learning snippets and bits of LUA and whatnot lately, and so far your OS is quite the helper. : )
remiX #17
Posted 20 January 2013 - 06:08 AM
Oh! I'll need to change that then, the programs that show up aren't clickable, it just lists what it does.

Let me do this and I'll get back to you.

You're a lifesaver! : ) Been learning snippets and bits of LUA and whatnot lately, and so far your OS is quite the helper. : )

I'm busy with the changes now and it actually requires me to change quite a bit. I'll be out tonight so i'll only be done tomorrow :)/>
remiX #18
Posted 20 January 2013 - 11:20 AM
Check the pastebin link in the OP, and add programs within the t_startMenu["programsMenu"].programs table with the programs it must list :)/> If there are more than 16 programs, it allows scrolling :)/>
Mandrewx #19
Posted 20 January 2013 - 01:36 PM
You are a god. : ) Thanks a lot, mate.
remiX #20
Posted 20 January 2013 - 08:28 PM
Haha why thank you :P/>

Enjoy it
Getalife #21
Posted 20 January 2013 - 10:24 PM
Even better now :D/> nice
remiX #22
Posted 20 January 2013 - 10:39 PM
Even better now :D/> nice

Thanks :P/>

I wanted to make the programs spot bigger with a description but it'll take too long xD
Christian77777 #23
Posted 31 January 2013 - 04:31 PM
So my question probably dosent go here, but i think it does have something to this, if you make a simple, enter password to proceed program, and save it a startup, and it works, there is one problem, the program ends there, i want it to go back to craft OS after the correct password is entered, is there a way to do that, or do i need to paste in a whole new OS?
Lyqyd #24
Posted 31 January 2013 - 04:33 PM
So my question probably dosent go here, but i think it does have something to this, if you make a simple, enter password to proceed program, and save it a startup, and it works, there is one problem, the program ends there, i want it to go back to craft OS after the correct password is entered, is there a way to do that, or do i need to paste in a whole new OS?

The script ending would return the computer to the command prompt.
remiX #25
Posted 31 January 2013 - 05:22 PM
So my question probably dosent go here, but i think it does have something to this, if you make a simple, enter password to proceed program, and save it a startup, and it works, there is one problem, the program ends there, i want it to go back to craft OS after the correct password is entered, is there a way to do that, or do i need to paste in a whole new OS?

Are you using a loop? Use break/return to end the loop.
NeptunasLT #26
Posted 09 February 2013 - 03:01 AM
Looks Like Windows 95 :D/>
I like it,
remiX #27
Posted 10 February 2013 - 03:25 AM
Haha, wow - I barely remember what Windows 95 even looks like :P/>