android4682

safe-calling

Nov 24th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | None | 0 0
  1. username = "User"
  2. ID = 2
  3. PIN = "0000"
  4.  
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. print ("-")
  8. print ("What is your Name?")
  9. write "Name: "
  10. username=read()
  11. term.clear()
  12. term.setCursorPos(1,1)
  13. print ("-")
  14. print ("Welcome,")
  15. print (username)
  16. print ("to the Android Bank.")
  17. print ("")
  18. print ("What would you like to do?")
  19. print ("")
  20. print ("S) Call/Store the Test Safe")
  21. print ("Q) Exit")
  22. write "Choice: "
  23. input=read()
  24. if input == "S" then
  25.     term.clear()
  26.     term.setCursorPos(1,1)
  27.     print ("-")
  28.     print ("Which safe do you want to call?")
  29.     write "Bank ID: "
  30.     ID=read()
  31.     print ("What is your PIN code?")
  32.     write "PIN code: "
  33.     PIN=read()
  34.     term.clear()
  35.     term.setCursorPos(1,1)
  36.     print ("-")
  37.     print ("Calling your Safe...")
  38.     sleep(2)
  39.     rednet.send(ID, PIN, true)
  40.     print ("Safe is called!")
  41.     sleep(2)
  42.     term.clear()
  43.     term.setCursorPos(1,1)
  44.     print ("-")
  45.     print ("When your done with your safe,")
  46.     print ("")
  47.     write "Press Enter to Store the Safe..."
  48.     input = read()
  49.     term.clear()
  50.     term.setCursorPos(1,1)
  51.     print ("-")
  52.     print ("Storing your Safe...")
  53.     sleep(2)
  54.     rednet.send(ID,"go",true)
  55.     print ("Safe is Stored!")
  56.     sleep(2)
  57.     print ("-")
  58.     print ("Thanks you for visiting, Android Bank")
  59.     print ("-")
  60.     sleep(2)
  61.     shell.run("safe-calling")
  62. elseif input == "Q" then
  63.     term.clear()
  64.     term.setCursorPos(1,1)
  65.     print ("-")
  66.     print ("Thanks you for visiting, Android Bank")
  67.     print ("-")
  68.     sleep(2)
  69. else
  70.     term.clear()
  71.     term.setCursorPos(1,1)
  72.     print ("-")
  73.     print ("Sorry your I didn't understand your input.")
  74.     print ("Please try again")
  75.     print ("-")
  76.     sleep(3)
  77.     shell.run("safe-calling")
  78. end
Advertisement
Add Comment
Please, Sign In to add comment