Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- CODED AND DESIGNED BY OWEN FLAHERTY AKA thatsimplekid
- -- ORIGINAL IDEA BY ANTONY DUERDOTH AKA Anteater46
- -- MAIN TESTERS, Mattz83, Anteater46, thatsimplekid
- -- ALL CREDIT Goes To The Creator(OWEN FLAHERTY) of this program
- -- ALL RIGHTS RESERVED
- --
- -- DONT STEAL THIS CODE
- -- YOU ARE ALLOWED TO REDISTRIBUTE (ONLY UNMODIFIED), BUT THIS BANNER MUST NOT BE REMOVED
- while true do
- n = 0
- a = 0
- term.clear()
- term.setCursorPos(1,1)
- print("ANT N CO Banking Server v0.1")
- rednet.open("back")
- rednet.open("top")rednet.open("bottom")
- rednet.open("left")
- rednet.open("right")
- if fs.exists(".database") then
- local file = fs.open(".database","r")
- local database = textutils.unserialize(file.readAll())
- file.close()
- else
- local database = {
- ["ANTNCO"] = {
- pin = 1234;
- balance = 500000;
- };
- ["thatsimplekid"] = {
- pin = 8080;
- balance = 25000;
- };
- }
- local file = fs.open(".database","w")
- file.write(textutils.serialize(database))
- file.close()
- os.reboot()
- end
- --[Now Time For The ACTUAL Banking System]--
- id, msg = rednet.receive()
- if msg == "addrem"then
- rednet.send(id, "IGN")
- idd,msgg = rednet.receive()
- ign = msgg
- if idd==id then
- rednet.send(idd, "AMT")
- iddd,msggg = rednet.receive()
- amount = tonumber(msggg)
- dmsgb = tonumber(database[ign].balance)
- abcde = database[ign].balance
- abcde = dmsgb - amount
- print(msgg .. " - " .. dmsgb)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment