TheDrunx

Transaction

Apr 8th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. serverComputer = 6
  2.  
  3. function OpenAll()
  4. for _,side in ipairs(rs.getSides()) do
  5. rednet.open(side)
  6. end
  7. end
  8.  
  9. function runApp()
  10. OpenAll()
  11. shell.run("clear")
  12. while true do
  13. event, param1 = os.pullEvent()
  14. shell.run("clear")
  15. if event == "disk" then
  16. term.write("Enter Transaction Amount: ")
  17. t = read()
  18. path = disk.getMountPath(param1)
  19. rPath = path.."/card"
  20. l = fs.open(rPath, "r")
  21. f = l.readAll()
  22. l.close()
  23. shell.run("clear")
  24. sleep(.5)
  25. print("Processing")
  26. sleep(.5)
  27. shell.run("clear")
  28. print("Processing.")
  29. sleep(.5)
  30. shell.run("clear")
  31. print("Processing..")
  32. sleep(.5)
  33. shell.run("clear")
  34. print("Processing...")
  35. sleep(.5)
  36. shell.run("clear")
  37. term.write("PUT IN SECOND CARD")
  38. while true do
  39. event1, param2 = os.pullEvent()
  40. shell.run("clear")
  41. if event1 == "disk" then
  42. term.write("TRANSACTION AMMOUNT IS "..t.."$")
  43. path = disk.getMountPath(param2)
  44. rPath = path.."/card"
  45. l = fs.open(rPath, "r")
  46. g = l.readAll()
  47. l.close()
  48. shell.run("clear")
  49. sleep(.5)
  50. print("Processing")
  51. sleep(.5)
  52. shell.run("clear")
  53. print("Processing.")
  54. sleep(.5)
  55. shell.run("clear")
  56. print("Processing..")
  57. sleep(.5)
  58. shell.run("clear")
  59. print("Processing...")
  60. sleep(.5)
  61. shell.run("clear")
  62. k = f.."!SP!Transaction!SP!"..g.."!SP!"..t
  63. rednet.send(serverComputer, k)
  64. print("INFORMATION SENT")
  65. print("ID 1: "..f)
  66. print("ID 2: "..g)
  67. print("TRANSACTION AMMOUT: "..t)
  68. read()
  69. shell.run("clear")
  70. break
  71. end
  72. end
  73. end
  74. end
  75. end
  76.  
  77. runApp()
Advertisement
Add Comment
Please, Sign In to add comment