Advertisement
Marlingaming

Banking records Server system

Nov 22nd, 2022
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. local Modem = peripheral.wrap("bottom")
  2. local LCh = 234
  3. local SCh = 455
  4.  
  5. local function OpenFile(Cat,Ac,Fl)
  6. local Path = fs.combine("Accounts",Ac,Cat,Fl)
  7. local file = fs.open(Path,"r")
  8. local data = textutils.unserialize(file.readAll())
  9. file.close()
  10. return data
  11. end
  12.  
  13. local function Loop()
  14. Modem.open(LCh)
  15. local Response = {}
  16. while true do
  17. local a, b, c, d, e = os.pullEvent("modem_message")
  18. local MSG = textutils.unserialize(e)--Category,Account,action,file
  19. local Cat = MSG[1]--Properties,Income,Loans
  20. if MSG[3] == "open" then
  21. Response = OpenFile(MSG[1],MSG[2],MSG[4])
  22. elseif MSG[3] == "update" then
  23. if MSG[1] == "Property" then
  24.  
  25. elseif MSG[1] == "Income" then
  26.  
  27. elseif MSG[1] == "Loans" then
  28.  
  29. end
  30. elseif MSG[3] == "create" then
  31.  
  32. elseif MSG[3] == "cancel" then
  33.  
  34. end
  35. end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement