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

[OS] DelOS [v1.4] [Internet, Downloading, Movies, And More!]

Started by ComputerCraftFan11, 24 March 2012 - 10:02 PM
ComputerCraftFan11 #1
Posted 24 March 2012 - 11:02 PM
This is my first public OS and will be updated*

DelOS v1.4


Code:

Password:
Spoiler


os.pullEvent = os.pullEventRaw

term.clear()
term.setCursorPos(1,1)
local selection = 1;
local version = "1.3.1";
local path = "";
local page = 1;
local function cPrint(text)
local x,y = term.getSize()
local x2,y2 = term.getCursorPos()
term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
print(text)
end
local function cWrite(text)
local x,y = term.getSize()
local x2,y2 = term.getCursorPos()
term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
write(text)
end

function dmenu()
  term.clear()
  term.setCursorPos(1,1)
  cPrint("---------------------")
  cPrint("DelOS v" ..version)
  cPrint("---------------------")
  print("Type 'Downloads' to view downloads.")
  print("Type 'Download' to download files.")
  command = read()
  if command == "Downloads" then
   path = "downloads"
   filemanager()
  elseif command == "Download" then
   term.clear()
   term.setCursorPos(1,1)
   cPrint("---------------------")
   cPrint("DelOS v" ..version)
   cPrint("---------------------")
   write("Please enter the file ID: ")
   code = read()
   write("Please enter the name: ")
   name = read()
   if fs.exists("downloads/" ..name) then
		write(name.. " already exists! Would you like to overwrite this file? ")
		option = read()
		if option == "Yes" then
		 fs.delete("downloads/" ..name)
		 shell.run("pastebin","get", code, "downloads/" ..name)
		 sleep(2)
		 dmenu()
		elseif option == "No" then
		 print("Cancled...")
		 sleep(2)
		 dmenu()
		else
		 print("Option does not exist! Say Yes or No.")
		 sleep(2)
		 dmenu()
		end
   else
		shell.run("pastebin","get", code, "downloads/" ..name)
		sleep(3)
		dmenu()
   end
  else
   print("Command does not exist!")
   sleep(2)
   dmenu()
  end
end
function BootOptions()
term.clear()
term.setCursorPos(1,1)
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("---------------------")
cPrint("")
if page == 1 then
if selection == 1 then
cPrint("--> File Manager <--")
else
cPrint("File Manager")
end
if selection == 2 then
cPrint("--> Internet <--")
else
cPrint("Internet")
end
if selection == 3 then
cPrint("--> Download Manager <--")
else
cPrint("Download Manager")
end

if selection == 4 then
cPrint("--> Switch to monitor mode <--")
else
cPrint("Switch to monitor mode")
end

if selection == 5 then
cPrint("--> Lua mode <--")
else
cPrint("Lua mode")
end
elseif page == 2 then
if selection == 1 then
cPrint("--> Game Library <--")
else
cPrint("Game Library")
end
if selection == 2 then
cPrint("--> Change Password <--")
else
cPrint("Change Password")
end
if selection == 3 then
cPrint("--> Blank <--")
else
cPrint("Blank")
end

if selection == 4 then
cPrint("--> Blank <--")
else
cPrint("Blank")
end

if selection == 5 then
cPrint("--> Blank <--")
else
cPrint("Blank")
end
end

if selection == 6 then
cPrint("--> Shutdown <--")
else
cPrint("Shutdown")
end

print("")
if page == 1 then
cPrint("Page " ..page.. " of 2. -->")
elseif page == 2 then
cPrint("< -- Page " ..page.. " of 2")
end
end

function password()
term.clear()
term.setCursorPos(1,1)
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("---------------------")
cPrint("")
if fs.exists("/.pass") then
cWrite("Password: ")
file = fs.open("/.pass","r")
correctpass = file.readAll()
file.close()
pass = read("*")
if pass == correctpass then
term.clear()
term.setCursorPos(1,1)
print("Welcome!")
sleep(2)
BootOptions()
else
print("")
write("Incorrect! Rebooting!")
sleep(2)
os.reboot()
end
else
cPrint("No password set. Set one now.")
cWrite("New password: ")
newPass = read("*")
cWrite("Comfirm Password: ")
comPass = read("*")
if newPass == comPass then
file = fs.open("/.pass","w")
file.write(newPass)
file.close()
print("Password set, rebooting...")
sleep(2)
os.reboot()
else
print("Password does not match comfirm.")
sleep(2)
password()
end
end
end


function Loader()
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("---------------------")
cPrint("")
cPrint("Loading.")
cPrint("[	  ]")
sleep(1)
term.clear()
term.setCursorPos(1,1)
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("---------------------")
cPrint("")
cPrint("Loading.")
cPrint("[II	]")
sleep(1)
term.clear()
term.setCursorPos(1,1)
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("---------------------")
cPrint("")
cPrint("Loading.")
cPrint("[IIII  ]")
sleep(1)
term.clear()
term.setCursorPos(1,1)
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("---------------------")
cPrint("")
cPrint("Loading.")
cPrint("[IIIIII]")
sleep(1)
--BootOptions()
password()
end

Loader()

while true do
local e,key = os.pullEvent( "key" )
if key == 17 or key == 200 then
  if selection > 1 then
   selection = selection - 1
   BootOptions()
  end
elseif key == 31 or key == 208 then
  if selection < 6 then
   selection = selection + 1
   BootOptions()
  end
elseif key == 203 then
  if page > 1 then
   page = page - 1
   BootOptions()
  end
elseif key == 205 then
  if page < 2 then
   page = page + 1
   BootOptions()
  end
elseif key == 28 then
  if selection == 6 then
   os.shutdown()
  elseif selection > 2 and page == 2 then
   BootOptions()
  else
   break
  end
end
end
function filemanager()
term.clear()
term.setCursorPos(1,1)
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("C://" ..path)
cPrint("---------------------")
shell.run("dir", path)
cPrint("---------------------")
write("C://")
directory = read()
path = directory
if fs.isDir( path ) then
  if path == "disk" then
   print("Browse or Label?")
   write("Do: ")
   command = read()

   if command == "Browse" then
		filemanager()
   elseif command == "Label" then
		write("Choose a side: ")
		diskside = read()
		write("Enter what you want to label it: ")
		diskname = read()
		shell.run("label", "set", diskside, diskname)
		print("Labeled!")
		sleep(1)
		path = ""
		filemanager()
   else
		print("Invalid Command!")
		sleep(1)
		path = ""
		filemanager()
   end
  else
   filemanager()
  end
else
  term.clear()
  term.setCursorPos(1,1)
  cPrint("---------------------")
  cPrint("DelOS v" ..version)
  cPrint("---------------------")
  print("Run, Copy, Delete, Edit, Move, or Upload?")
  write("Do: ")
  command = read()

  if command == "Run" then
   shell.run(path)
  elseif command == "Copy" then
   write("Copy to where?")
   copypath = read()
   fs.copy(path, copypath)
   print("Copied!")
   sleep(1)
   path = ""
   filemanager()
  elseif command == "Delete" then
   print("Deleted.")
   fs.delete(path)
   sleep(1)
   path = ""
   filemanager()
  elseif command == "Upload" then
   shell.run("pastebin","put", path)
   sleep(5)
   path = ""
   filemanager()
  elseif command == "Move" then
   write("Move where?")
   movepath = read()
   fs.move(path, movepath)
   print("Moved!")
   sleep(3)
   path = ""
   filemanager()
  elseif command == "Edit" then
   shell.run("edit", path)
  else
   print("Command does not exist.")
   sleep(1)
   path = ""
   filemanager()
  end
end
end

function games()
term.clear()
term.setCursorPos(1,1)
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("---------------------")
cPrint("Game Library: ")
if fs.exists("games") then
shell.run("dir", "games")
else
fs.makeDir("games")
fs.copy("rom/programs/computer/worm", "games/Worm")
shell.run("dir", "games")
end
write("C://games/")
input = read()
if fs.exists("games/"..input) then
shell.run("games/" ..input)
else
print("This game does not exist, would you like to download it (y/n)?")
input = read()
if input == "n" then
games()
elseif input == "y" then
write("Enter the pastebin game ID: ")
fileid = read()
write("Enter the game name: ")
filename = read()
shell.run("pastebin", "get", fileid, "games/" ..filename)
games()
else
print("Unknown...")
sleep(3)
games()
end
end
end


function password()
term.clear()
term.setCursorPos(1,1)
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("---------------------")
cPrint("")
cWrite("Old Password: ")
file = fs.open("/.pass","r")
correctpass = file.readAll()
file.close()
pass = read("*")
if pass == correctpass then
cWrite("New Password: ")
oldpass = read("*")
fs.delete("/.pass")

else
print("")
write("Incorrect! Rebooting!")
sleep(2)
os.reboot()
end
end

if page == 1 then
if selection == 1 then
if fs.exists("movies") then
else
fs.makeDir("movies")
fs.copy("rom/programs/secret/alongtimeago", "movies/starwars")
end
term.clear()
term.setCursorPos(1,1)
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("C://" ..path)
cPrint("---------------------")
shell.run("dir", path)
cPrint("---------------------")
write("C://")
directory = read()
path = directory
if fs.isDir( path ) then
if path == "disk" then
  print("Browse or Label?")
  write("Do: ")
  command = read()

  if command == "Browse" then
filemanager()
  elseif command == "Label" then
write("Choose a side: ")
diskside = read()
write("Enter what you want to label it: ")
diskname = read()
shell.run("label", "set", diskside, diskname)
print("Labeled!")
sleep(1)
path = ""
filemanager()
  else
print("Invalid Command!")
sleep(1)
path = ""
filemanager()
  end
else
  filemanager()
end
else
term.clear()
term.setCursorPos(1,1)
cPrint("---------------------")
cPrint("DelOS v" ..version)
cPrint("---------------------")
print("Run, Copy, Delete, Edit, Move, or Upload?")
write("Do: ")
command = read()

if command == "Run" then
  shell.run(path)
elseif command == "Copy" then
  write("Copy to where?")
  copypath = read()
  fs.copy(path, copypath)
  print("Copied!")
  sleep(1)
  path = ""
  filemanager()
elseif command == "Delete" then
  print("Deleted.")
  fs.delete(path)
  sleep(1)
  path = ""
  filemanager()
elseif command == "Upload" then
  shell.run("pastebin","put", path)
  sleep(5)
  path = ""
  filemanager()
elseif command == "Move" then
  write("Move where?")
  movepath = read()
  fs.move(path, movepath)
  print("Moved!")
  sleep(3)
  path = ""
  filemanager()
elseif command == "Edit" then
  shell.run("edit", path)
else
  print("Command does not exist.")
  sleep(1)
  path = ""
  filemanager()
end
end
end
if selection == 2 then
if fs.exists("rn") then
shell.run("rn")
else
shell.run("pastebin","get","Y320Z2K0","rn")
shell.run("rn")
end
end
if selection == 4 then
  term.clear()
  term.setCursorPos(1,1)
  cPrint("---------------------")
  cPrint("DelOS v" ..version)
  cPrint("---------------------")
  print("Please choose a monitor side (left or right?): ")
  monitorside = read()
  term.clear()
  term.setCursorPos(1,1)
  cPrint("---------------------")
  cPrint("DelOS v" ..version)
  cPrint("---------------------")
  shell.run("monitor", monitorside, "startup")
end

if selection == 5 then
  term.clear()
  term.setCursorPos(1,1)
  cPrint("---------------------")
  cPrint("DelOS v" ..version)
  cPrint("---------------------")
  if fs.exists("newluacode") then
	 shell.run("newluacode")
  else
	 shell.run("pastebin", "get", "emFiR2kK", "newluacode")
	term.clear()
	term.setCursorPos(1,1)
	cPrint("---------------------")
	cPrint("DelOS v" ..version)
	cPrint("---------------------")
shell.run("newluacode")
  end
end

if selection == 3 then
if fs.exists("downloads") then
else
  fs.makeDir("downloads")
end
dmenu()
end
elseif page == 2 then
if selection == 1 then
games()
end

if selection == 2 then
	cPrint("---------------------")
	cPrint("DelOS v" ..version)
	cPrint("---------------------/n")
cWrite("Old password: ")
newPass = read("*")
file = fs.open("/.pass","r")
correctpass = file.readAll()
file.close()
if newPass == correctpass then
cWrite("New password: ")
comPass = read("*")
fs.delete("/.pass")
file = fs.open("/.pass","w")
file.write(newPass)
file.close()
cPrint("Password set! Rebooting")
sleep(2)
os.reboot()
else
cPrint("Incorrect password!")
sleep(2)
os.reboot()
end
end
end

Screenshots:
Spoiler







With this OS, there is a File Manager, REX (Internet), Download Manager, movies (/movies in file manager), and a shutdown button (lol?)!

More features are coming soon…

(To make a new file, type the name/path of the file in the file manager and press Edit)

Upcoming:

* Turtle Manager
* Stuff for rednet
* More movies in the /movies folder
* REX Server Hosting
(Somethings are not listed and might be added.)
ComputerCraftFan11 #2
Posted 25 March 2012 - 06:10 AM
*Put code in spoilers

*NEW in v1.1!
  • Monitor Mode
  • Disk Manager, when opening "disk" in file manager it will give you some options like browse and label
  • There is now pages, but right now it only has 1 (Will add more when I get more programs).
Screenshots:



ComputerCraftFan11 #3
Posted 25 March 2012 - 09:21 PM
DOes anyone have any feedback?
Ian-Moone #4
Posted 25 March 2012 - 09:31 PM
COOL
would like to see pics of internet though
BlackRa1n #5
Posted 25 March 2012 - 09:33 PM
I must ask, what are those blocks at the top of your images and why are they there? xD
OT: Vandie, how did you edit your profile title? :o/>/>
ComputerCraftFan11 #6
Posted 25 March 2012 - 09:35 PM
COOL
would like to see pics of internet though

I posted pics in my old internet post (along with a domain name host.) But that is outdated so as soon as I put a downloader for a domain server I'll add pics

I must ask, what are those blocks at the top of your images and why are they there? xD
OT: Vandie, how did you edit your profile title? :o/>/>
oh, those are the monitors from my media post (that's why the monitor looks like a computer)
BlackRa1n #7
Posted 25 March 2012 - 09:39 PM
Ah, ok :o/>/>
Wolvan #8
Posted 25 March 2012 - 09:46 PM
What does Movies mean? Can u give an example?
ComputerCraftFan11 #9
Posted 25 March 2012 - 10:40 PM
What does Movies mean? Can u give an example?

Its a folder for storing long animations (like secret/alon…..) based off of real movies.
ComputerCraftFan11 #10
Posted 25 March 2012 - 10:58 PM
COOL
would like to see pics of internet though

Here:





*NEW IN 1.2:



Lua mode!: Test out your code

Improved Internet!: You can now host websites in your client (I combined the client and the server)
ComputerCraftFan11 #11
Posted 26 March 2012 - 08:50 AM
To install this on a server, type this:

pastebin get PtKEsVs3 startup
Wolvan #12
Posted 26 March 2012 - 06:08 PM
nice. But is there a program for downloading pastebin files in CC?
Espen #13
Posted 26 March 2012 - 06:27 PM
nice. But is there a program for downloading pastebin files in CC?
Yes there is, type 'help pastebin' for more info. :o/>/>
BlackRa1n #14
Posted 26 March 2012 - 06:57 PM
This look pretty neat!
Wolvan #15
Posted 26 March 2012 - 07:04 PM
nice. But is there a program for downloading pastebin files in CC?
Yes there is, type 'help pastebin' for more info. :o/>/>
so pastebin is an API? Or just a program?
Espen #16
Posted 26 March 2012 - 07:42 PM
so pastebin is an API? Or just a program?
The latter.
ComputerCraftFan11 #17
Posted 26 March 2012 - 08:41 PM
This look pretty neat!

Thanks, and for people that don't know how to exit the file manager:

Select the file you saved DelOS in and press "Run" and the OS will reboot
ComputerCraftFan11 #18
Posted 26 March 2012 - 11:09 PM
*New update:
v1.3
  • Added functional pages (took the most time)
  • Added Game Library
The reason why this took so long is because I spent the most time making pages and a way to add new pages easily. And the other reason is the game library (didn't take long) because if you try to run a game that doesn't exist, it will ask you if you want to download it
ComputerCraftFan11 #19
Posted 27 March 2012 - 02:03 AM
*New update:
v1.3
  • Added functional pages (took the most time)
  • Added Game Library
The reason why this took so long is because I spent the most time making pages and a way to add new pages easily. And the other reason is the game library (didn't take long) because if you try to run a game that doesn't exist, it will ask you if you want to download it

*New minor update:
v1.3.1
  • Fixed lua mode to go back to the os when you type exit() instead of going to craftOS
Ian-Moone #20
Posted 28 March 2012 - 09:10 PM
thanks its probably my Favorited os yet
BlackRa1n #21
Posted 28 March 2012 - 10:15 PM
thanks its probably my Favorited os yet

Other than RedWorksOS, I couldn't agree more! :o/>/>
ComputerCraftFan11 #22
Posted 29 March 2012 - 01:39 AM
Thanks !!

I'm making it so if you select a program named "Blank", you can set your own programs and make shortcuts :o/>/>
ComputerCraftFan11 #23
Posted 29 March 2012 - 03:38 AM
Update:

Added a password!!
ComputerCraftFan11 #24
Posted 29 March 2012 - 04:00 AM
If you wanna change your password again, go onto file manager and type .pass
Wolvan #25
Posted 29 March 2012 - 08:27 AM
If you wanna change your password again, go onto file manager and type .pass
Why not create another command for that? Where you have to input the old pass and then input the new one 2 times
ComputerCraftFan11 #26
Posted 30 March 2012 - 06:36 AM
If you wanna change your password again, go onto file manager and type .pass
Why not create another command for that? Where you have to input the old pass and then input the new one 2 times

Done.
JohnSmith41 #27
Posted 03 April 2012 - 11:44 PM
coool bro just cool
so downloading
ComputerCraftFan11 #28
Posted 04 April 2012 - 02:47 AM
coool bro just cool
so downloading


Thanks, this needs to have http API loaded atleast once so it can Download the programs, but after that you can disable it
ComputerCraftFan11 #29
Posted 05 April 2012 - 05:40 AM
This OS look is overused, i'm switching to windows :)/>/>

New OS:
http://www.computercraft.info/forums2/index.php?/topic/1122-131-v01-winos-remade/

The WinOS is better because you can add your own programs easily
gaiaalpha #30
Posted 04 August 2012 - 03:39 AM
Uh, when i tell a computer to run this OS, it Spits out this message:
"bios:206 [string "startup"]:769: 'end' expected (to close 'if' at line 378)
Any help?
Noodle #31
Posted 06 August 2012 - 07:16 AM
Why not just use your handle (modz)?
filipkwro #32
Posted 13 August 2012 - 11:44 AM
Uh, when i tell a computer to run this OS, it Spits out this message:
"bios:206 [string "startup"]:769: 'end' expected (to close 'if' at line 378)
Any help?
Try edit startup, go to 769th line and type "end" there…
TheOddByte #33
Posted 11 October 2012 - 06:31 PM
I gotta say this os looks pretty awsome :P/>/>
casr144 #34
Posted 13 October 2012 - 05:39 AM
Pretty cool :)/>/>
JohnSmith41Junk #35
Posted 18 February 2013 - 07:51 AM
can you tell me how to add programs in place of the blanks? I got one blank to show up as "Thunderbird" but i have no idea how to get it to launch thunderbird. i even made a function just for it!