Advertisement
nnimos

Untitled

May 5th, 2015
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. -- Startup code for Sending PC
  2.  
  3. function HomeScreen()
  4. term.setTextColor(colors.blue)
  5. print("Welcome to The Bank Of Nimrodia")
  6. term.setTextColor(colors.white)
  7. print("Please select an option from below:")
  8. print("")
  9. print("1 - Access Account")
  10. print("2 - Deposit into Safety Box")
  11. print("3 - View Account details")
  12. wait(5)
  13. ChoiceSelection()
  14. end
  15.  
  16. function ChoiceSelection()
  17. write("Please enter the number of your choice: ")
  18. local choice = read("")
  19. end
  20.  
  21. function HomeChoice(choice)
  22. if choice == 1 then
  23. write("You have selected: ")
  24. term.setTextColor(colors.green)
  25. write("Access account")
  26. term.setTextColor(colors.white)
  27. print("Please wait... ")
  28. HomeScreen() -- Add in the shell
  29. if choice == 2 then
  30. write("You have selected: ")
  31. term.setTextColor(colors.green)
  32. write("Deposit into safety box")
  33. term.setTextColor(colors.white)
  34. print("Please wait... ")
  35. -- shell.run("BoxDeposit")
  36. if choice == 3 then
  37. write("You have selected: ")
  38. term.setTextColor(colors.green)
  39. write("View Account details")
  40. term.setTextColor(colors.white)
  41. print("Please wait... ")
  42. else
  43. term.setTextColor(colors.red)
  44. print("Choice is not correct, please try again")
  45. term.setTextColor(colors.white)
  46. ChoiceSelection()
  47. end
  48. end
  49. end
  50. -- actual program
  51.  
  52. HomeScreen()
  53. HomeChoice(choice)
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement