Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Modem = peripheral.wrap("bottom")
- local LCh = 234
- local SCh = 455
- local function OpenFile(Cat,Ac,Fl)
- local Path = fs.combine("Accounts",Ac,Cat,Fl)
- local file = fs.open(Path,"r")
- local data = textutils.unserialize(file.readAll())
- file.close()
- return data
- end
- local function Loop()
- Modem.open(LCh)
- local Response = {}
- while true do
- local a, b, c, d, e = os.pullEvent("modem_message")
- local MSG = textutils.unserialize(e)--Category,Account,action,file
- local Cat = MSG[1]--Properties,Income,Loans
- if MSG[3] == "open" then
- Response = OpenFile(MSG[1],MSG[2],MSG[4])
- elseif MSG[3] == "update" then
- if MSG[1] == "Property" then
- elseif MSG[1] == "Income" then
- elseif MSG[1] == "Loans" then
- end
- elseif MSG[3] == "create" then
- elseif MSG[3] == "cancel" then
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement