Advertisement
nnimos

Untitled

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