Advertisement
nnimos

Untitled

May 5th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. -- Startup code for Sending PC
  2.  
  3. function HomeScreen()
  4. term.setTextColor(colors.blue)
  5. textutils.slowPrint("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. ChoiceSelection()
  13. end
  14.  
  15. function ChoiceSelection()
  16. write("Please enter the number of your choice: ")
  17. choice = tonumber(read())
  18. HomeChoice(choice)
  19. end
  20.  
  21. function HomeChoice(choice1)
  22. print(choice1)
  23.  
  24. if choice1 == 1 then
  25. write("You have selected: ")
  26. os.sleep(1)
  27. term.setTextColor(colors.green)
  28. write("Access account\n")
  29. os.sleep(1)
  30. term.setTextColor(colors.white)
  31. print("Please wait... ")
  32. os.sleep(2)
  33. restart()
  34. elseif choice1 == 2 then
  35. write("You have selected: ")
  36. os.sleep(1)
  37. term.setTextColor(colors.green)
  38. write("Deposit into safety box\n")
  39. os.sleep(1)
  40. term.setTextColor(colors.white)
  41. print("Please wait... ")
  42. os.sleep(2)
  43. restart()
  44. -- shell.run("BoxDeposit")
  45. elseif choice1 == 3 then
  46. write("You have selected: ")
  47. os.sleep(1)
  48. term.setTextColor(colors.green)
  49. write("View Account details\n")
  50. os.sleep(2)
  51. term.setTextColor(colors.white)
  52. print("Please wait... ")
  53. os.sleep(2)
  54. restart()
  55. else
  56. term.setTextColor(colors.red)
  57. textutils.slowPrint("Choice is not correct, please try again")
  58. term.setTextColor(colors.white)
  59. os.sleep(2)
  60. ChoiceSelection()
  61. end
  62.  
  63. end
  64.  
  65. function restart()
  66. os.reboot()
  67. end
  68.  
  69. -- Actual program
  70.  
  71. HomeScreen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement