Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[ Made by "Kolten *****" a.k.a "Spongy141"
- -- Progam may be ONLY used as allowed
- -- You may not edit without permission,
- -- You may use DynationOS as a OS for ComputerCraft
- -- Credit for DynationOS
- -- Kolten ***** a.k.a "Spongy141" for making DynationOS
- -- Shnupbups100 for CCScreensaver
- --]
- function start()
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.yellow)
- print("DynationOS")
- term.setTextColor(colors.lightBlue)
- textutils.slowPrint("DynationOS, making things easy.")
- term.setTextColor(colors.white)
- end
- function button()
- local tCoords = {
- [1] = { 36, 50, 15, 16, "Create Account" },
- [2] = { 2, 7, 15, 16, "Login" },
- }
- term.setCursorPos(36,15)
- print("Create Account")
- term.setCursorPos(2,15)
- print("Login")
- term.setCursorPos(1,3)
- local evt, button, x, y = os.pullEvent("mouse_click")
- for i = 1, #tCoords do
- if x >= tCoords[i][1] and x <= tCoords[i][2] and y >= tCoords [i][3] and y <= tCoords [i][4] then
- button = i
- setup()
- break
- end
- end
- for i = 2, #tCoords do
- if x >= tCoords[i][1] and x <= tCoords[i][2] and y >= tCoords [i][3] and y <= tCoords [i][4] then
- button = i
- clickUsername()
- break
- end
- end
- end
- function name()
- local file = fs.open("file.username","r")
- local user = {file.readLine()}
- file.close()
- return user
- end
- function password()
- local file = fs.open("file.password","r")
- local pass = {file.readLine()}
- file.close()
- return pass
- end
- function clickUsername()
- start()
- term.setCursorPos(14,14)
- print("Accounts")
- term.setCursorPos(21,9)
- local username = {name()}
- print(username)
- term.setCursorPos(1,3)
- local sCoords = {
- [1] = { 21, 30, 9, 10, "Spongy" },
- }
- local evt, button, x, y = os.pullEvent("mouse_click")
- for i = 1, #sCoords do
- if x >= sCoords[i][1] and x <= sCoords[i][2] and y >= sCoords[i][3] and y <= sCoords[i][4] then
- button = i
- login()
- break
- end
- end
- end
- function login()
- local usernameX = {name()}
- term.setTextColor(colors.lime)
- print("Welcome ",usernameX," you will need to type in your password")
- password()
- term.write("Password: ")
- term.setTextColor(colors.white)
- local passw = read()
- if passw == (pass) then
- User()
- else
- term.setTextColor(colors.red)
- print("Wrong Password, redirecting you back to start menu")
- sleep(2)
- term.setTextColor(colors.white)
- button()
- end
- end
- function setup()
- term.setTextColor(colors.lime)
- print("Welcome to DynationOS setup program, today you will be setting up your DynationOS!")
- print("(Please quote your info) First, what is your name?: ")
- term.setTextColor(colors.white)
- local name = read()
- file = fs.open("/DOS/file.username","w")
- file.writeLine('("'..user..'")')
- term.setTextColor(colors.lime)
- print("Alright ",name,", what would you like your password to be?: ")
- term.setTextColor(colors.white)
- file.close()
- file = fs.open("/DOS/file.password","w")
- local pass = read()
- file.writeLine('("'..pass..'")')
- file.close()
- term.setTextColor(colors.lime)
- print("Alright ",name,", would you like to use rednet (yes or no): ")
- term.setTextColor(colors.white)
- local ans = read()
- if ans == ("yes") then
- term.setTextColor(colors.lime)
- print("Alright where is your wireless modem located?: ")
- term.setTextColor(colors.white)
- file = fs.open("/DOS/file.rednet","w")
- local side = read()
- rednet.open(side)
- file.writeLine("local rednet = true")
- term.setTextColor(colors.lime)
- print("Well this is the end of the setup, goodbye!")
- file.close()
- start()
- elseif ans == ("no") then
- term.setTextColor(colors.lime)
- print("Alright",name,", I will turn off rednet mode, NOTE: Call me Simple")
- file.writeLine("local rednet = false")
- print("Well this is the end of the setup, goodbye!")
- sleep(1)
- file.close()
- start()
- end
- end
- function User() -- All this does is let the player do commands
- term.setTextColor(colors.brown)
- print("Please enter: help : if you need help")
- while true do
- term.setTextColor(colors.lime)
- write("Command: ")
- term.setTextColor(colors.white)
- local cmd = read()
- if cmd == ("help") then
- term.setTextColor(colors.brown)
- print("Commands are: ")
- write("help :")
- term.setTextColor(colors.lightBlue)
- print("This is the help command")
- term.setTextColor(colors.brown)
- print("No more commands ATM, since I'm lazy")
- end
- if cmd == ("Music.add") then
- term.setTextColor(colors.lightBlue)
- write("What side is the new music disk on?: ")
- term.setTextColor(colors.white)
- local sidesong = read()
- term.setTextColor(colors.blue)
- textutils.slowPrint("...........",0.8)
- sleep(0.5)
- textutils.slowPrint("Testing new song")
- shell.run("dj","play ",side)
- sleep(3)
- shell.run("dj","stop")
- print("Test Complete, if no sound then please retry")
- print("If you heard sound then please enter the name (can be anything)")
- write("Name: ")
- term.setTextColor(colors.white)
- local name = read()
- file = fs.open("songs","w")
- file.writeLine("local song = (",name,")")
- file.close()
- end
- if cmd == ("exit") then
- os.exit()
- end
- if cmd == ("time") then
- os.time(times)
- print(times)
- else
- end
- function setAlarm()
- term.setTextColor(colors.yellow)
- print("What time will you want your alarm to go off at?")
- os.clock(clocks)
- print(clocks)
- term.write("Alarm Time: ")
- term.setTextColor(colors.white)
- local AlarmTime = read()
- os.setAlarm(AlarmTime)
- end
- if cmd == ("set alarm") then
- setAlarm()
- end
- if cmd == ("") then
- term.setTextColor(colors.red)
- print("Please enter a valid command")
- end
- if cmd == ("69") then -- this was for earler testing of mine for me to get back to the setup function..
- term.setTextColor(colors.red)
- print("Thats not a command...")
- sleep(0.2)
- print("Being redirected to setup.")
- sleep(1)
- setup()
- end
- if cmd == ("afk") then
- term.setTextColor(colors.lime)
- term.write("What would you like your screen saver to be?: ")
- term.setTextColor(colors.white)
- local screen = read()
- shell.run("/DOS/screensaver","-u" ..screen)
- end
- end
- end
- start()
- button()
Advertisement
Add Comment
Please, Sign In to add comment