Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local w,h = term.getSize()
- if fs.exists("/C/system/.core/system") then
- local data = fs.open ("/C/system/.core/system", "r")
- edice = data.readLine()
- data.close()
- else
- edice = "Standard"
- end
- if (edice == "Server") then ServerMode = true end
- local function prc(text, y)
- local w = term.getSize()
- local _, cy = term.getCursorPos()
- curs(math.ceil((w-#text)/2), y or cy)
- write(text)
- end
- function pozadi()
- local myWindow = window.create(term.current(),1,1,12,h)
- myWindow.setBackgroundColor(colors.blue)
- myWindow.clear()
- myWindow.setCursorPos(2,5)
- myWindow.setTextColor(colors.white)
- myWindow.write("- Edition")
- myWindow.setCursorPos(2,7)
- myWindow.setTextColor(colors.white)
- myWindow.write("- Install")
- myWindow.setCursorPos(2,9)
- myWindow.setTextColor(colors.white)
- myWindow.write("- Network")
- myWindow.setCursorPos(2,11)
- myWindow.setTextColor(colors.lightGray)
- myWindow.write("- Account")
- myWindow.setCursorPos(2,h)
- myWindow.setTextColor(colors.white)
- myWindow.write("Pepek@Soft")
- plocha = window.create(term.current(),13,1,w-12,h)
- ww = w-12
- plocha.setBackgroundColor(colors.white)
- plocha.clear()
- plocha.setTextColor(colors.black)
- plocha.setCursorPos(ww/2-12,1)
- plocha.write("Pepdroll Seven Installer")
- plocha.setBackgroundColor(colors.lightGray)
- plocha.setCursorPos(ww/2-4,h-1)
- plocha.write" Next "
- plocha.setBackgroundColor(colors.white)
- plocha.setTextColor(colors.black)
- end
- function dokoncit()
- plocha.setBackgroundColor(colors.gray)
- plocha.setCursorPos(ww/2-4,h-1)
- plocha.write" Done "
- sleep(0.1)
- if not (nUser == "") then
- if (cPass == nPass) then
- local o=fs.open ("/C/system/Users/"..nUser.."/.data", "w")
- o.writeLine(nUser)
- o.writeLine(nPass)
- o.writeLine("")
- o.writeLine("")
- o.writeLine("t")
- o.writeLine("t")
- o.close()
- o=fs.open ("/C/system/.core/defuser", "w")
- o.writeLine(nUser)
- o.close()
- local ucet = fs.open("/C/system/.core/ucet","w")
- ucet.close()
- if ServerMode then
- local data = fs.open("/C/system/Users/"..nUser.."/.Registry/colors", "w")
- data.writeLine("256")
- data.writeLine("32768")
- data.close ()
- local data = fs.open("/C/system/Users/"..nUser.."/.Registry/.showItem", "w") data.close()
- else
- local data = fs.open("/C/system/Users/"..nUser.."/.Registry/colors", "w")
- data.writeLine("2048")
- data.writeLine("1")
- data.close ()
- end
- local data = fs.open("/C/system/RAM/NewUser", "w") data.writeLine(nUser) data.close()
- data = fs.open("/C/system/Users/"..nUser.."/Desktop/This PC.src", "w") data.close()
- data = fs.open("/C/system/Users/"..nUser.."/.Registry/.disableAnim", "w") data.close()
- end
- end
- end
- function account()
- pozadi()
- if nUser == nil then
- if ServerMode then
- nUser = "Administrator"
- else
- nUser = "User"
- end
- end
- plocha.setBackgroundColor(colors.lightGray)
- plocha.setCursorPos(ww/2-4,h-1)
- plocha.write" Done "
- plocha.setCursorPos(18,8)
- plocha.write" "
- plocha.setCursorPos(19,8)
- plocha.write(nUser)
- plocha.setCursorPos(18,10)
- plocha.write" "
- if not (nPass == "") then plocha.setCursorPos(19,10) plocha.write("Password") end
- plocha.setCursorPos(18,12)
- plocha.write" "
- if (cPass == nPass) then
- plocha.setTextColor(colors.lime)
- plocha.setCursorPos(19,12)
- plocha.write("Same")
- else
- plocha.setTextColor(colors.red)
- plocha.setCursorPos(19,12)
- plocha.write("Different")
- end
- plocha.setTextColor(colors.black)
- plocha.setBackgroundColor(colors.white)
- plocha.setCursorPos(7,4)
- plocha.write" Create your first Account "
- plocha.setCursorPos(8,8)
- plocha.write"Username:"
- plocha.setCursorPos(8,10)
- plocha.write"Password:"
- plocha.setCursorPos(8,12)
- plocha.write"Password:"
- term.setBackgroundColor(colors.lightBlue)
- while true do
- event, button, x,y = os.pullEvent()
- if event == "mouse_click" and x >= 30 and x<= 44 and y == 8 and button == 1 then
- plocha.setBackgroundColor(colors.lightBlue)
- plocha.setCursorPos(18,8)
- plocha.write" "
- plocha.setCursorPos(19,8)
- nUser = read()
- elseif event == "mouse_click" and x >= 30 and x<= 44 and y == 10 and button == 1 then
- plocha.setBackgroundColor(colors.lightBlue)
- plocha.setCursorPos(18,10)
- plocha.write" "
- plocha.setCursorPos(19,10)
- nPass = read(string.char(7))
- elseif event == "mouse_click" and x >= 30 and x<= 44 and y == 12 and button == 1 then
- plocha.setBackgroundColor(colors.lightBlue)
- plocha.setCursorPos(18,12)
- plocha.write" "
- plocha.setCursorPos(19,12)
- cPass = read(string.char(7))
- term.setCursorPos(w/2, h-2)
- elseif event == "mouse_click" and x >= (w/2)+2 and x<= (w/2)+7 and y == h-1 and button == 1 then dokoncit() return
- elseif event == "key" and (button == keys.enter or button == keys.numEnter) then dokoncit() return
- end
- end
- end
Add Comment
Please, Sign In to add comment