Advertisement
Marlingaming

Credit Card Reader V3

Dec 9th, 2021
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. --this program recieves the requested amount, and then waits for card input
  2. local tArg = {..}
  3. local RAmount = tArg[0]
  4.  
  5. local Reader = peripheral.find("reader")
  6. repeat
  7. local event, side, id, data = os.pullEvent("mag_swipe")
  8. until event == "mag_swipe"
  9.  
  10. local CardData = {data}
  11. local ClientAccount = CardData[0]
  12. local ServerID = CardData[1]
  13. local Protocol = CardData[2]
  14. local modem = peripherals.find("modem")
  15. local Transmition = {RAmount,ClientAccount,id}
  16. rednet.open("modem")
  17. rednet.send(ServerID,Transmition,Protocol)
  18. repeat
  19. local id, message, protocol = rednet.receive()
  20. until id == ServerID
  21. if message == "Accepted" then
  22. return("true")
  23. elseif message == "Declined" then
  24. return("false")
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement