Marlingaming

Banknet wireless access API

Nov 6th, 2022 (edited)
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. local Auth = 3434
  3. local LCh = 455
  4. local SCh = 233
  5. local Version = "1.1.0"
  6.  
  7. local function TextField()
  8. local input
  9. local TX, TY = term.getCursorPos()
  10. TY = TY - 1
  11. while true do
  12. term.setCursorPos(TX,TY)
  13. term.clearLine()
  14. term.write()
  15. local e, a, b, c = os.pullEvent("key")
  16. if a == keys.enter then break elseif e == "key" then input = read(C) end
  17. end
  18. return input
  19. end
  20.  
  21. function GetV()
  22. return Version
  23. end
  24.  
  25. function AuthenticateAccount(Key)
  26. local Router = peripheral.find("wireless_modem")
  27. local M = {"Auth",{{Key}},Auth}
  28. Router.transmit(SCh,LCh,textutils.serialize(M))
  29. local a, b, c, d, e
  30. repeat
  31. a, b, c, d, e = os.pullEvent("modem_message")
  32. until b == LCh
  33. return e
  34. end
  35.  
  36. function charge(Key2,Amount)
  37. term.clear()
  38. term.setCursorPos(1,1)
  39. term.write("===Secure=Connection===")
  40. term.setCursorPos(1,2)
  41. term.write("enter Bank Key")
  42. term.setCursorPos(2,3)
  43. local Key = TextField()
  44. local Router = peripheral.find("wireless_modem")
  45. local M = {"transfer",{Pin,Key,Key2,Amount},Auth}
  46. Router.transmit(SCh,LCh,textutils.serialize(M))
  47. local a, b, c, d, e
  48. repeat
  49. a, b, c, d, e = os.pullEvent("modem_message")
  50. until b == LCh
  51. return e
  52. end
Advertisement
Add Comment
Please, Sign In to add comment