Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local password = ""
- local username = ""
- if fs.exists("sensData1") then
- local hRead = assert(fs.open("sensData1", "r"))
- saveName = hRead.readLine()
- hRead.close()
- end
- if fs.exists("sensData2") then
- local hRead = assert(fs.open("sensData2", "r"))
- savePassword = hRead.readLine()
- hRead.close()
- end
- function drawBorder()
- term.clear()
- term.setCursorPos(1,1)
- print("X-------------------------------------------------X")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("- -")
- print("X-------------------------------------------------X")
- end
- function loginSeq()
- term.clear()
- drawBorder()
- term.setCursorPos(15,6)
- print("PriestleyOS v1")
- term.setCursorPos(14,7)
- print("X---------------------X")
- term.setCursorPos(14,8)
- print("- Username: -")
- term.setCursorPos(14,9)
- print("- Password: -")
- term.setCursorPos(14,10)
- print("X---------------------X")
- while password ~= savePassword do
- term.setCursorPos(26,8)
- username = read()
- if username == saveName then
- term.setCursorPos(26,9)
- password = read("*")
- end
- term.clear()
- drawBorder()
- loginSeq()
- end
- end
- function drawDesktop()
- local dMenu = 0
- local cpX = 12
- local cpY = 12
- local option = 1
- drawBorder()
- term.setCursorPos(1,16)
- print("X-------------------------------------------------X")
- print("X- Applications ----- Log Off --------- Shutdown -X")
- term.setCursorPos(1,2)
- print("X- PriestleyOS v1 User: "..username)
- print("X-------------------------------------------------X")
- while dMenu ~= 1 do
- drawBorder()
- term.setCursorPos(1,16)
- print("X-------------------------------------------------X")
- print("X- Applications ----- Log Off --------- Shutdown -X")
- term.setCursorPos(1,2)
- print("X- PriestleyOS v1 User: "..username)
- print("X-------------------------------------------------X")
- if option == -1 then
- option = 3
- cpY = 43
- end
- if option == 1 then
- cpY = 8
- end
- if option == 2 then
- cpY = 25
- end
- if option == 3 then
- cpY = 43
- end
- if option == 4 then
- option = 1
- drawDesktop()
- end
- cpX = 12
- term.setCursorPos(cpY,cpX)
- print("III")
- cpX = cpX + 1
- term.setCursorPos(cpY,cpX)
- print("III")
- cpX = cpX + 1
- term.setCursorPos(cpY,cpX)
- print("III")
- cpX = cpX + 1
- term.setCursorPos(cpY,cpX)
- print("VVV")
- while true do
- local sEvent, param = os.pullEvent("key")
- if sEvent == "key" then
- if param == 203 then
- option = option - 1
- break
- end
- if param == 205 then
- option = option + 1
- break
- end
- if param == 28 then
- if option == 1 then
- osApps()
- end
- if option == 2 then
- loginSeq()
- end
- if option == 3 then
- shutdown()
- end
- end
- end
- end
- end
- end
- function shutdown()
- drawBorder()
- term.setCursorPos(19,8)
- write("Shutting down...")
- term.setCursorPos(19,9)
- for loadloop = 0, 16 do
- write("=")
- sleep(0.25)
- end
- os.shutdown()
- end
- function osApps()
- local dMenu = 0
- local cpX = 27
- local cpY = 4
- local option = 1
- drawBorder()
- term.setCursorPos(1,2)
- print("- Applications -")
- print("X-------------------------------------------------X")
- print("X- [1] Calculator -X")
- print("X- [2] PriestleyPapers -X")
- print("X- [3] PriestleyNet -X")
- print("X- [4] NewarkLife -X")
- print("X- [5] plcgame -X")
- print("X- Return to Desktop -X")
- print("X------------------------X")
- while dMenu ~= 1 do
- if option == 7 then
- option = 1
- end
- if option == -1 then
- option = 6
- end
- drawBorder()
- term.setCursorPos(1,2)
- print("- Applications -")
- print("X-------------------------------------------------X")
- print("X- [1] Calculator -X")
- print("X- [2] PriestleyPapers -X")
- print("X- [3] PriestleyNet -X")
- print("X- [4] NewarkLife -X")
- print("X- [5] plcgame -X")
- print("X- Return to Desktop -X")
- print("X------------------------X")
- if option == 1 then
- cpY = 4
- end
- if option == 2 then
- cpY = 5
- end
- if option == 3 then
- cpY = 6
- end
- if option == 4 then
- cpY = 7
- end
- if option == 5 then
- cpY = 8
- end
- if option == 6 then
- cpY = 9
- end
- term.setCursorPos(cpX,cpY)
- print("<==")
- while true do
- local sEvent, param = os.pullEvent("key")
- if sEvent == "key" then
- if param == 200 then
- option = option - 1
- break
- end
- if param == 208 then
- option = option + 1
- break
- end
- if param == 28 then
- if option == 1 then
- startCalculator()
- end
- if option == 2 then
- startPriestleyPapers()
- end
- if option == 3 then
- startPriestleyNet()
- end
- if option == 4 then
- end
- if option == 5 then
- end
- if option == 6 then
- drawDesktop()
- end
- end
- end
- end
- end
- end
- function startCalculator()
- end
- function startPriestleyPapers()
- end
- function startPriestleyNet()
- end
- loginSeq()
- drawDesktop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement