Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --********************************--
- --**http://pastebin.com/Gtyeg4fz**--
- --********************************--
- local args = { ... }
- os.loadAPI("MasterOS/SystemFile/APIS/ApisLoader")
- ApisLoader.UserInfo()
- ApisLoader.Vwindow()
- --*****ColorMenu*****--
- local ColorsTXT = {
- " Chose Your ",
- " Favorite Color ",
- "__________________",
- "| |",
- "| |",
- "| |",
- "| |",
- "------------------"
- }
- local ColorsColor = {
- "999999999999999999",
- "999999999999999999",
- "999999999999999999",
- "999999999999999999",
- "999999999999999999",
- "999999999999999999",
- "999999999999999999",
- "999999999999999999"
- }
- local ColorsTXTColors = {
- "000000000000000000",
- "000000000000000000",
- "000000000000000000",
- "099999999999999990",
- "099999999999999990",
- "099999999999999990",
- "099999999999999990",
- "000000000000000000"
- }
- local White = {
- "00",
- "00"
- }
- local Orange = {
- "11",
- "11"
- }
- local Magenta = {
- "22",
- "22"
- }
- local LightBlue = {
- "33",
- "33"
- }
- local Yellow = {
- "44",
- "44"
- }
- local Lime = {
- "55",
- "55"
- }
- local Pink = {
- "66",
- "66"
- }
- local Gray = {
- "77",
- "77"
- }
- local LightGray = {
- "88",
- "88"
- }
- local Cyan = {
- "99",
- "99"
- }
- local Purple = {
- "aa",
- "aa"
- }
- local Blue = {
- "bb",
- "bb"
- }
- local Brown = {
- "cc",
- "cc"
- }
- local Green = {
- "dd",
- "dd"
- }
- local Red = {
- "ee",
- "ee"
- }
- local Black = {
- "ff",
- "ff"
- }
- function CreateColorsMenu ()
- xCoor = 15
- yCoor = 5
- ColorMenu = window.create(term.current(), xCoor + 1, yCoor, 18, 8)
- Vwindow.addTableToWindowBlit(ColorMenu, ColorsTXT, ColorsTXTColors, ColorsColor, 1, 1, 0)
- WindWhite = window.create(term.current(), xCoor + 2, yCoor + 3, 2, 2)
- Vwindow.addTableToWindowBlit(WindWhite, White, White, White, 1, 1, 0)
- WindOrange = window.create(term.current(), xCoor + 4, yCoor + 3, 2, 2)
- Vwindow.addTableToWindowBlit(WindOrange, Orange, Orange, Orange, 1, 1, 0)
- WindMagenta = window.create(term.current(), xCoor + 6, yCoor + 3, 2, 2)
- Vwindow.addTableToWindowBlit(WindMagenta, Magenta, Magenta, Magenta, 1, 1, 0)
- WindLightBlue = window.create(term.current(), xCoor + 8, yCoor + 3, 2, 2)
- Vwindow.addTableToWindowBlit(WindLightBlue, LightBlue, LightBlue, LightBlue, 1, 1, 0)
- WindYellow = window.create(term.current(), xCoor + 10, yCoor + 3, 2, 2)
- Vwindow.addTableToWindowBlit(WindYellow, Yellow, Yellow, Yellow, 1, 1, 0)
- WindLime = window.create(term.current(), xCoor + 12, yCoor + 3, 2, 2)
- Vwindow.addTableToWindowBlit(WindLime, Lime, Lime, Lime, 1, 1, 0)
- WindPink = window.create(term.current(), xCoor + 14, yCoor + 3, 2, 2)
- Vwindow.addTableToWindowBlit(WindPink, Pink, Pink, Pink, 1, 1, 0)
- WindGray = window.create(term.current(), xCoor + 16, yCoor + 3, 2, 2)
- Vwindow.addTableToWindowBlit(WindGray, Gray, Gray, Gray, 1, 1, 0)
- WindLightGray = window.create(term.current(), xCoor + 2, yCoor + 5, 2, 2)
- Vwindow.addTableToWindowBlit(WindLightGray, LightGray, LightGray, LightGray, 1, 1, 0)
- WindCyan = window.create(term.current(), xCoor + 4, yCoor + 5, 2, 2)
- Vwindow.addTableToWindowBlit(WindCyan, Cyan, Cyan, Cyan, 1, 1, 0)
- WindPurple = window.create(term.current(), xCoor + 6, yCoor + 5, 2, 2)
- Vwindow.addTableToWindowBlit(WindPurple, Purple, Purple, Purple, 1, 1, 0)
- WindBlue = window.create(term.current(), xCoor + 8, yCoor + 5, 2, 2)
- Vwindow.addTableToWindowBlit(WindBlue, Blue, Blue, Blue, 1, 1, 0)
- WindBrown = window.create(term.current(), xCoor + 10, yCoor + 5, 2, 2)
- Vwindow.addTableToWindowBlit(WindBrown, Brown, Brown, Brown, 1, 1, 0)
- WindGreen = window.create(term.current(), xCoor + 12, yCoor + 5, 2, 2)
- Vwindow.addTableToWindowBlit(WindGreen, Green, Green, Green, 1, 1, 0)
- WindRed = window.create(term.current(), xCoor + 14, yCoor + 5, 2, 2)
- Vwindow.addTableToWindowBlit(WindRed, Red, Red, Red, 1, 1, 0)
- WindBlack = window.create(term.current(), xCoor + 16, yCoor + 5, 2, 2)
- Vwindow.addTableToWindowBlit(WindBlack, Black, Black, Black, 1, 1, 0)
- end
- --*******************--
- local names = {}
- local function LoadUserName()
- if fs.exists("MasterOS/Users/UserList") then
- userListFile = fs.open("MasterOS/Users/UserList", "r")
- numb = 0
- while numb ~= 10 do
- TxtVar = userListFile.readLine()
- names[numb + 1] = TxtVar
- numb = numb + 1
- end
- userListFile.close()
- else
- end
- end
- --Window
- local function GenerateWindow()
- Entry = window.create(term.current(), 16, 7, 18, 4)
- end
- local function RebuiltWindow(Title)
- Entry.setBackgroundColor(colors.cyan)
- Entry.clear()
- Entry.setTextColor(colors.white)
- Entry.setCursorPos(2, 2)
- Entry.write(Title)
- Entry.setCursorPos(2, 3)
- Entry.setBackgroundColor(colors.lightGray)
- Entry.write(" ")
- Entry.setCursorPos(2, 3)
- Entry.setCursorBlink(true)
- end
- function EnterYourName()
- RebuiltWindow("Enter Your Name:")
- local go = true
- local first = true
- while go do
- if first == false then
- Entry.setCursorPos(2, 3)
- Entry.setBackgroundColor(colors.lightGray)
- Entry.setTextColor(colors.gray)
- Entry.write(" Already Use ")
- Entry.setCursorPos(2, 3)
- Entry.setTextColor(colors.white)
- end
- first = false
- term.setBackgroundColor(colors.lightGray)
- InName = read()
- Good = true
- for k,v in ipairs(names) do
- NamesLowerCase = string.lower(names[k])
- InNameLowerCase = string.lower(InName)
- Space = string.find(NamesLowerCase, " ")
- if (InNameLowerCase == NamesLowerCase) or (InNameLowerCase == nil) or (Space == 1) then
- Good = false
- end
- end
- if Good == true then
- go = false
- end
- end
- return InName
- end
- function EnterPassword()
- local go = true
- while go do
- RebuiltWindow("Enter Password:")
- FirstPass = read("*")
- RebuiltWindow("Repeat Password:")
- SecondPass = read("*")
- if FirstPass == SecondPass then
- go = false
- else
- RebuiltWindow("The 2 Password")
- Entry.write("Don't correspond")
- os.sleep(5)
- end
- end
- return FirstPass
- end
- function CreateUserPicture()
- end
- SelectedColors = "blue"
- local function FWhite()
- Vwindow.clickOn(WindWhite)
- SelectedColors = "white"
- return("white")
- end
- local function FOrange()
- Vwindow.clickOn(WindOrange)
- SelectedColors = "orange"
- return("orange")
- end
- local function FMagenta()
- Vwindow.clickOn(WindMagenta)
- SelectedColors = "magenta"
- end
- local function FLightBlue()
- Vwindow.clickOn(WindLightBlue)
- SelectedColors = "lightBlue"
- end
- local function FYellow()
- Vwindow.clickOn(WindYellow)
- SelectedColors = "yellow"
- end
- local function FLime()
- Vwindow.clickOn(WindLime)
- SelectedColors = "lime"
- end
- local function FPink()
- Vwindow.clickOn(WindPink)
- SelectedColors = "pink"
- end
- local function FGray()
- Vwindow.clickOn(WindGray)
- SelectedColors = "gray"
- end
- local function FLightGray()
- Vwindow.clickOn(WindLightGray)
- SelectedColors = "lightGray"
- end
- local function FCyan()
- Vwindow.clickOn(WindCyan)
- SelectedColors = "cyan"
- end
- local function FPurple()
- Vwindow.clickOn(WindPurple)
- SelectedColors = "purple"
- end
- local function FBlue()
- Vwindow.clickOn(WindBlue)
- SelectedColors = "blue"
- end
- local function FBrown()
- Vwindow.clickOn(WindBrown)
- SelectedColors = "brown"
- end
- local function FGreen()
- Vwindow.clickOn(WindGreen)
- SelectedColors = "green"
- end
- local function FRed()
- Vwindow.clickOn(WindRed)
- --SelectedColors = "red"
- return("red")
- end
- local function FBlack()
- Vwindow.clickOn(WindBlack)
- SelectedColors = "black"
- end
- function ChoseFColor()
- CreateColorsMenu()
- --parallel.waitForAny(FWhite, FOrange)--, FMagenta, FLightBlue,FYellow, FLime, FPink, FGray,FLightGray, FCyan, FPurple, FBlue,FBrown, FGreen, FRed, FBlack)
- --*****White*****--
- WhiteXPos, WhiteYPos = WindWhite.getPosition()
- WhiteX, WhiteY = WindWhite.getSize()
- Whitelenght = WhiteXPos + WhiteX
- Whitewight = WhiteYPos + WhiteY
- -- --*****Orange*****--
- OrangeXPos, OrangeYPos = WindOrange.getPosition()
- OrangeX, OrangeY = WindOrange.getSize()
- Orangelenght = OrangeXPos + OrangeX
- Orangewight = OrangeYPos + OrangeY
- --*****Magenta*****--
- MagentaXPos, MagentaYPos = WindMagenta.getPosition()
- MagentaX, MagentaY = WindMagenta.getSize()
- Magentalenght = MagentaXPos + MagentaX
- Magentawight = MagentaYPos + MagentaY
- --*****LightBlue*****--
- LightBlueXPos, LightBlueYPos = WindLightBlue.getPosition()
- LightBlueX, LightBlueY = WindLightBlue.getSize()
- LightBluelenght = LightBlueXPos + LightBlueX
- LightBluewight = LightBlueYPos + LightBlueY
- --*****Yellow*****--
- YellowXPos, YellowYPos = WindYellow.getPosition()
- YellowX, YellowY = WindYellow.getSize()
- Yellowlenght = YellowXPos + YellowX
- Yellowwight = YellowYPos + YellowY
- --*****Lime*****--
- LimeXPos, LimeYPos = WindLime.getPosition()
- LimeX, LimeY = WindLime.getSize()
- Limelenght = LimeXPos + LimeX
- Limewight = LimeYPos + LimeY
- --*****Pink*****--
- PinkXPos, PinkYPos = WindPink.getPosition()
- PinkX, PinkY = WindPink.getSize()
- Pinklenght = PinkXPos + PinkX
- Pinkwight = PinkYPos + PinkY
- --*****Gray*****--
- GrayXPos, GrayYPos = WindGray.getPosition()
- GrayX, GrayY = WindGray.getSize()
- Graylenght = GrayXPos + GrayX
- Graywight = GrayYPos + GrayY
- --*****LightGray*****--
- LightGrayXPos, LightGrayYPos = WindLightGray.getPosition()
- LightGrayX, LightGrayY = WindLightGray.getSize()
- LightGraylenght = LightGrayXPos + LightGrayX
- LightGraywight = LightGrayYPos + LightGrayY
- --*****Cyan*****--
- CyanXPos, CyanYPos = WindCyan.getPosition()
- CyanX, CyanY = WindCyan.getSize()
- Cyanlenght = CyanXPos + CyanX
- Cyanwight = CyanYPos + CyanY
- --*****Purple*****--
- PurpleXPos, PurpleYPos = WindPurple.getPosition()
- PurpleX, PurpleY = WindPurple.getSize()
- Purplelenght = PurpleXPos + PurpleX
- Purplewight = PurpleYPos + PurpleY
- --*****Blue*****--
- BlueXPos, BlueYPos = WindBlue.getPosition()
- BlueX, BlueY = WindBlue.getSize()
- Bluelenght = BlueXPos + BlueX
- Bluewight = BlueYPos + BlueY
- --*****Brown*****--
- BrownXPos, BrownYPos = WindBrown.getPosition()
- BrownX, BrownY = WindBrown.getSize()
- Brownlenght = BrownXPos + BrownX
- Brownwight = BrownYPos + BrownY
- --*****Green*****--
- GreenXPos, GreenYPos = WindGreen.getPosition()
- GreenX, GreenY = WindGreen.getSize()
- Greenlenght = GreenXPos + GreenX
- Greenwight = GreenYPos + GreenY
- --*****Red*****--
- RedXPos, RedYPos = WindRed.getPosition()
- RedX, RedY = WindRed.getSize()
- Redlenght = RedXPos + RedX
- Redwight = RedYPos + RedY
- --*****Black*****--
- BlackXPos, BlackYPos = WindBlack.getPosition()
- BlackX, BlackY = WindBlack.getSize()
- Blacklenght = BlackXPos + BlackX
- Blackwight = BlackYPos + BlackY
- while true do
- event, side, xCoor, yCoor = os.pullEvent("mouse_click")
- --*****White*****--
- if (xCoor >= WhiteXPos) and (xCoor <= Whitelenght) and (yCoor >= WhiteYPos) and (yCoor <= Whitewight) then
- return("white")
- --*****Orange*****--
- elseif (xCoor >= OrangeXPos) and (xCoor <= Orangelenght) and (yCoor >= OrangeYPos) and (yCoor <= Orangewight) then
- return("orange")
- --*****Magenta*****--
- elseif (xCoor >= MagentaXPos) and (xCoor <= Magentalenght) and (yCoor >= MagentaYPos) and (yCoor <= Magentawight) then
- return("magenta")
- --*****LightBlue*****--
- elseif (xCoor >= LightBlueXPos) and (xCoor <= LightBluelenght) and (yCoor >= LightBlueYPos) and (yCoor <= LightBluewight) then
- return("lightBlue")
- --*****Yellow*****--
- elseif (xCoor >= YellowXPos) and (xCoor <= Yellowlenght) and (yCoor >= YellowYPos) and (yCoor <= Yellowwight) then
- return("yellow")
- --*****Lime*****--
- elseif (xCoor >= LimeXPos) and (xCoor <= Limelenght) and (yCoor >= LimeYPos) and (yCoor <= Limewight) then
- return("lime")
- --*****Pink*****--
- elseif (xCoor >= PinkXPos) and (xCoor <= Pinklenght) and (yCoor >= PinkYPos) and (yCoor <= Pinkwight) then
- return("pink")
- --*****Gray*****--
- elseif (xCoor >= GrayXPos) and (xCoor <= Graylenght) and (yCoor >= GrayYPos) and (yCoor <= Graywight) then
- return("gray")
- --*****LightGray*****--
- elseif (xCoor >= LightGrayXPos) and (xCoor <= LightGraylenght) and (yCoor >= LightGrayYPos) and (yCoor <= LightGraywight) then
- return("lightGray")
- --*****Cyan*****--
- elseif (xCoor >= CyanXPos) and (xCoor <= Cyanlenght) and (yCoor >= CyanYPos) and (yCoor <= Cyanwight) then
- return("cyan")
- --*****Purple*****--
- elseif (xCoor >= PurpleXPos) and (xCoor <= Purplelenght) and (yCoor >= PurpleYPos) and (yCoor <= Purplewight) then
- return("purple")
- --*****Blue*****--
- elseif (xCoor >= BlueXPos) and (xCoor <= Bluelenght) and (yCoor >= BlueYPos) and (yCoor <= Bluewight) then
- return("blue")
- --*****Brown*****--
- elseif (xCoor >= BrownXPos) and (xCoor <= Brownlenght) and (yCoor >= BrownYPos) and (yCoor <= Brownwight) then
- return("brown")
- --*****Green*****--
- elseif (xCoor >= GreenXPos) and (xCoor <= Greenlenght) and (yCoor >= GreenYPos) and (yCoor <= Greenwight) then
- return("green")
- --*****Red*****--
- elseif (xCoor >= RedXPos) and (xCoor <= Redlenght) and (yCoor >= RedYPos) and (yCoor <= Redwight) then
- return("red")
- --*****Black*****--
- elseif (xCoor >= BlackXPos) and (xCoor <= Blacklenght) and (yCoor >= BlackYPos) and (yCoor <= Blackwight) then
- return("black")
- end
- end
- end
- LoadUserName()
- GenerateWindow()
- UserName = EnterYourName()
- User = UserName
- fs.copy("MasterOS/Users/UserAssembler/DefaultUserDictory/Info", "MasterOS/Users/"..UserName.."/Info")
- UserInfo.setName(User, UserName)
- UserInfo.setPassword(User, EnterPassword())
- --UserInfo.setPicture(User, CreateUserPicture())
- FinalColor = ChoseFColor()
- UserInfo.setFColor(User, FinalColor)
- names[tonumber(args[1])] = UserName
- userFile = fs.open("MasterOS/Users/UserList", "w")
- userFile.flush()
- for k,v in ipairs(names) do
- userFile.writeLine(v)
- end
- userFile.close()
- term.setCursorPos(1,1)
- --***************************--
- --**Create By:Vieau 2016--
- --***************************--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement