Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables--
- local UserAccount
- local userPIN
- local otherAccount = "Business Account Here"
- local input
- local senderId
- local message
- local protocol
- --Setup Networking--
- rednet.open("back")
- --Basic Functions--
- local function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- local function SendMoney()
- Clear()
- term.write("Input Total Amount:")
- term.setCursorPos(1,2)
- amount = read()
- term.setCursorPos(1,3)
- term.write("Input Account Name:")
- term.setCursorPos(1,4)
- UserAccount = read()
- term.setCursorPos(1,5)
- term.write("Enter PIN:")
- term.setCursorPos(1,6)
- userPIN = read("*")
- rednet.send(11, "SendMoney", "bankFunction")
- senderId, message, protocol = rednet.receive("confirmation")
- if message == "confirmed" then
- rednet.send(11, userAccount,"bankSend")
- else
- clear()
- term.write("Connection To Bank Server Not Established")
- os.sleep(3)
- os.reboot()
- end
- senderId, message, protocol = rednet.receive("confirmation")
- if message == "confirmed" then
- rednet.send(11, otherAccount,"bankSend")
- else
- clear()
- term.write("Connection To Bank Server Not Established")
- os.sleep(3)
- os.reboot()
- end
- senderId, message, protocol = rednet.receive("confirmation")
- if message == "confirmed" then
- rednet.send(11, amount,"bankSend")
- else
- clear()
- term.write("Connection To Bank Server Not Established")
- os.sleep(3)
- os.reboot()
- end
- senderId, message, protocol = rednet.receive("confirmation")
- if message == "confirmed" then
- rednet.send(11, userPIN,"bankSend")
- else
- clear()
- term.write("Connection To Bank Server Not Established")
- os.sleep(3)
- os.reboot()
- end
- senderId, message, protocol = rednet.receive("bankStatus")
- Clear()
- term.write(message)
- os.sleep(3)
- os.reboot()
- end
- SendMoney()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement