Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Program which asks for username and password
- 'Change Username Name And Passwords
- user1Username = "Niklas"
- user2Username = "Banana"
- user1Password = "Apples"
- user2Password = "pwd"
- 'Select Username
- start:
- loggedOnBefore = "false"
- TextWindow.ForegroundColor = "Yellow"
- TextWindow.WriteLine("What user do you want to log on with?")
- TextWindow.ForegroundColor = "Gray"
- TextWindow.WriteLine("[1] " + user1Username)
- Program.Delay(150)
- TextWindow.WriteLine("[2] " + user2Username)
- Program.Delay(150)
- TextWindow.WriteLine("[3] Guest")
- username = TextWindow.Read()
- TextWindow.ForegroundColor = "Yellow"
- If username = "1" or username = user1Username Then
- Goto user1Logon
- EndIf
- If username = "2" Or username = user2Username Then
- Goto user2Logon
- EndIf
- If username = "3" Then
- Goto guestLogon
- EndIf
- TextWindow.Clear()
- selectedWrongUsername = "true"
- Goto start
- 'Checks To See If Password Is Correct
- user1Logon:
- TextWindow.Write("Enter your password: ")
- password = TextWindow.Read()
- If password = user1Password Then
- user1LoggedOn = "true"
- Goto logon
- EndIf
- user2Logon:
- TextWindow.Write("Enter your password: ")
- password = TextWindow.Read()
- If password = user2Password Then
- user2LoggedOn = "true"
- Goto logon
- EndIf
- guestLogon:
- TextWindow.ForegroundColor = "Green"
- TextWindow.WriteLine("As you are logging on to Guest, you do not need to enter a password")
- Program.Delay(750)
- 'Logon Screen
- logon:
- selectedWrongUsername = "true"
- TextWindow.ForegroundColor = "Yellow"
- TextWindow.Write(".")
- Program.Delay("400")
- TextWindow.Write(".")
- Program.Delay("400")
- TextWindow.Write(".")
- Program.Delay("400")
- TextWindow.Write(".")
- Program.Delay("400")
- TextWindow.Write(".")
- Program.Delay("650")
- Goto loggedOn
- loggedOn:
- TextWindow.Clear()
- TextWindow.ForegroundColor = "Green"
- If loggedOnBefore = "false" Then
- TextWindow.WriteLine("Hello, you have logged on!")
- EndIf
- Program.Delay(500)
- TextWindow.WriteLine("What would you like to do now?")
- Program.Delay(750)
- TextWindow.ForegroundColor = "Gray"
- TextWindow.WriteLine("[1] Surf the Web")
- Program.Delay(150)
- TextWindow.WriteLine("[2] Sign Out")
- Program.Delay(150)
- TextWindow.WriteLine("[3] Shutdown")
- action = TextWindow.ReadNumber()
- If action = "1" Then
- Goto surfWeb
- EndIf
- If action = "2" Then
- Goto signOut
- EndIf
- If action = "3" Then
- Goto shutdown
- EndIf
- 'Web Search
- surfWeb:
- If user1LoggedOn = "true" Or user2LoggedOn = "true" Then
- Goto surfWebAllowed
- Else
- TextWindow.ForegroundColor = "Red"
- TextWindow.WriteLine("You do not have permission to load NiklasChrome!")
- Program.Delay(1000)
- Goto loggedOn
- EndIf
- surfWebAllowed:
- TextWindow.Clear()
- TextWindow.ForegroundColor = "White"
- TextWindow.WriteLine("NiklasChrome is loading")
- Program.Delay("400")
- TextWindow.Write(".")
- Program.Delay("400")
- TextWindow.Write(".")
- Program.Delay("400")
- TextWindow.Write(".")
- Program.Delay("400")
- TextWindow.Write(".")
- Program.Delay("650")
- TextWindow.Clear()
- TextWindow.ForegroundColor = "Green"
- TextWindow.WriteLine("NiklasChrome has loaded.")
- TextWindow.ForegroundColor = "Purple"
- Program.Delay(1000)
- Goto niklasChromeLoaded
- niklasChromeLoaded:
- TextWindow.Clear()
- TextWindow.ForegroundColor = "Purple"
- TextWindow.WriteLine("What would you like to do?")
- Program.Delay(750)
- TextWindow.ForegroundColor = "Gray"
- TextWindow.WriteLine("[1] Search Google")
- Program.Delay(150)
- TextWindow.WriteLine("[2] Define Word")
- Program.Delay(150)
- TextWindow.WriteLine("[3] Calculator")
- Program.Delay(150)
- TextWindow.WriteLine("[4] Close Niklas Chrome")
- whatWouldYouLikeToDo = TextWindow.ReadNumber()
- If whatWouldYouLikeToDo = "1" Then
- Goto searchGoogle
- EndIf
- If whatWouldYouLikeToDo = "2" Then
- Goto define
- EndIf
- If whatWouldYouLikeToDo = "3" Then
- Goto calculator
- EndIf
- If whatWouldYouLikeToDo = "4" Then
- Goto chromeClose
- EndIf
- searchGoogle:
- TextWindow.Clear()
- TextWindow.ForegroundColor = "Purple"
- TextWindow.WriteLine("If you would like to search google, then open google in a normal browser..")
- Program.Delay(1000)
- TextWindow.ForegroundColor = "Purple"
- Goto niklasChromeLoaded
- 'Define
- define:
- TextWindow.Clear()
- TextWindow.ForegroundColor = "Purple"
- TextWindow.Write("Type the word you would like to know the definition of: ")
- wordToDefine = TextWindow.Read()
- Dictionary.GetDefinition(wordToDefine)
- GraphicsWindow.Title = ("Definition of "+wordToDefine+"")
- GraphicsWindow.FontBold = "False"
- GraphicsWindow.FontName = "Verdana"
- GraphicsWindow.FontSize = 24
- GraphicsWindow.BrushColor = "DarkGreen"
- GraphicsWindow.DrawText(10, 10, wordToDefine)
- definition = Dictionary.GetDefinition(wordToDefine)
- GraphicsWindow.FontSize = 12
- GraphicsWindow.BrushColor = "Black"
- GraphicsWindow.DrawText(10, 60, definition)
- Program.Delay(2500)
- Goto defineAnotherWord
- defineAnotherWord:
- TextWindow.ForegroundColor = "Purple"
- TextWindow.WriteLine("Would you like to know the definition of another word?")
- TextWindow.WriteLine("[Y] Yes")
- TextWindow.WriteLine("[N] No")
- defineAnotherWord = TextWindow.Read()
- If defineAnotherWord = "Y" Or defineAnotherWord = "Yes" or defineAnotherWord = "y" Then
- Goto define
- EndIf
- If defineAnotherWord = "N" Or defineAnotherWord = "No" or defineAnotherWord = "n" Then
- Goto niklasChromeLoaded
- EndIf
- Goto defineAnotherWord
- 'Calculator
- calculator:
- TextWindow.Clear()
- TextWindow.ForegroundColor = "White"
- TextWindow.Write("Type the first number: ")
- num1 = TextWindow.ReadNumber()
- TextWindow.Write("Would you like to do: + , - , * , / : ")
- mathOperation = TextWindow.Read()
- TextWindow.Write("Type the second number: ")
- num2 = TextWindow.ReadNumber()
- If mathOperation = "+" Then
- num3 = num1 + num2
- EndIf
- If mathOperation = "-" Then
- num3 = num1 - num2
- EndIf
- If mathOperation = "*" Then
- num3 = num1 * num2
- EndIf
- If mathOperation = "/" Then
- num3 = num1 / num2
- EndIf
- TextWindow.ForegroundColor = "White"
- TextWindow.Write("The answer is: ")
- TextWindow.ForegroundColor = "Yellow"
- TextWindow.Write(num3)
- TextWindow.WriteLine("")
- Program.Delay(2500)
- TextWindow.ForegroundColor = "White"
- TextWindow.WriteLine("Would you like to do another equation?")
- TextWindow.WriteLine("[Y] Yes")
- TextWindow.WriteLine("[N] No")
- anotherEquation = TextWindow.Read()
- If anotherEquation = "Yes" Or anotherEquation = "yes" Or anotherEquation = "Y" Or anotherEquation = "y" Then
- Goto calculator
- EndIf
- If anotherEquation = "No" Or anotherEquation = "no" Or anotherEquation = "N" Or anotherEquation = "n" Then
- Goto closeCalculator
- EndIf
- closeCalculator:
- TextWindow.ForegroundColor = "Red"
- TextWindow.WriteLine("Are you sure you would like to close Calculator")
- TextWindow.ForegroundColor = "Gray"
- TextWindow.WriteLine("[Y] Yes")
- TextWindow.WriteLine("[N] No")
- likeToCloseCalculator = TextWindow.Read()
- If likeToCloseCalculator = "Yes" Or likeToCloseCalculator = "yes" Or likeToCloseCalculator = "Y" Or likeToCloseCalculator = "y" Then
- Goto niklasChromeLoaded
- EndIf
- If likeToCloseCalculator = "No" Or likeToCloseCalculator = "no" Or likeToCloseCalculator = "N" Or likeToCloseCalculator = "n" Then
- Goto calculator
- EndIf
- chromeClose:
- TextWindow.ForegroundColor = "Red"
- TextWindow.WriteLine("Are you sure you would like to close NiklasChrome?")
- TextWindow.ForegroundColor = "Gray"
- TextWindow.WriteLine("[Y] Yes")
- TextWindow.WriteLine("[N] No")
- likeToCloseChrome = TextWindow.Read()
- If likeToCloseChrome = "Y" or likeToCloseChrome = "Yes" Then
- TextWindow.ForegroundColor = "Yellow"
- TextWindow.WriteLine("NiklasChrome will be closed.")
- Program.Delay(500)
- Goto loggedOn
- EndIf
- If likeToCloseChrome = "N" Or likeToCloseChrome = "No" then
- TextWindow.ForegroundColor = "Yellow"
- TextWindow.WriteLine("NiklasChrome will not be closed")
- Program.Delay(1000)
- Goto niklasChromeLoaded
- EndIf
- Goto chromeClose
- 'Signout
- signOut:
- TextWindow.Clear()
- TextWindow.ForegroundColor = "Red"
- TextWindow.WriteLine("Are you sure you would like to logout?")
- TextWindow.ForegroundColor = "Gray"
- TextWindow.WriteLine("[Y] Yes")
- TextWindow.WriteLine("[N] No")
- likeToSignOut = TextWindow.Read()
- If likeToSignOut = "Y" or likeToSignOut = "Yes" Then
- TextWindow.ForegroundColor = "Yellow"
- TextWindow.WriteLine("You will be logged off.")
- Program.Delay(750)
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine(" ")
- Goto start
- EndIf
- If likeToSignOut = "N" Or likeToSignOut = "No" then
- TextWindow.ForegroundColor = "Yellow"
- TextWindow.WriteLine("You will not be logged off.")
- Program.Delay(1000)
- Goto loggedOn
- EndIf
- Goto loggedOn
- 'Shutdown Program
- shutdown:
- TextWindow.Clear()
- TextWindow.ForegroundColor = "Red"
- TextWindow.WriteLine("Are you sure you would like to shutdown?")
- TextWindow.ForegroundColor = "Gray"
- TextWindow.WriteLine("[Y] Yes")
- TextWindow.WriteLine("[N] No")
- likeToShutDown = TextWindow.Read()
- If likeToShutDown = "Y" Or likeToShutDown = "Yes" Then
- TextWindow.WriteLine("This Program will now shutdown.")
- Program.Delay(750)
- Program.End()
- EndIf
- If likeToShutDown = "N" Or likeToShutDown = "No" Then
- Goto loggedOn
- EndIf
- Goto shutdown
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement