Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- rednet.open("top")
- local bankID = 217;
- local w, h = term.getSize()
- function cPrint(str, ypos)
- term.setCursorPos(w/2-#str/2, ypos)
- write(str)
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- print("Entering fullscreen in 3...")
- sleep(1)
- print("2...")
- sleep(1)
- print("1...")
- sleep(1)
- selection = 1
- while true do
- clear()
- if selection == 1 then
- print("> Login < Register \n")
- else
- print(" Login > Register <\n")
- end
- cPrint("+-------------------+", 3)
- cPrint("| |", 4)
- cPrint("| Username: |", 5)
- cPrint("| Password: |", 6)
- cPrint("| |", 7)
- cPrint("+-------------------+", 8)
- local event, key = os.pullEvent("key")
- if key == 203 then
- selection = 1
- elseif key == 205 then
- selection = 94897983697
- elseif key == 28 then
- break
- end
- end
- statusMessage = "| |"
- while true do
- clear()
- cPrint("+-------------------+", 3)
- cPrint(statusMessage, 4)
- cPrint("| Username: |", 5)
- cPrint("| Password: |", 6)
- cPrint("| |", 7)
- cPrint("+-------------------+", 8)
- str = "| Username: |"
- map = w/2-#str/2+string.len("| Username: ")
- term.setCursorPos(map, 5)
- username = read()
- term.setCursorPos(map, 6)
- password = read()
- if selection == 1 then
- rednet.send(bankID, "VERIFY:" ..username.. ":" ..password)
- repeat
- id, message = rednet.receive()
- until id == bankID
- if message == "Correct" then
- break
- else
- statusMessage = "| Login failed. |"
- end
- else
- break
- end
- end
- if username == "" and password == "" then
- clear()
- shell.run("shell")
- else
- if selection == 94897983697 then
- rednet.send(bankID, "NEW:" ..username.. ":" ..password)
- end
- function updateBalance()
- rednet.send(bankID, "CHECK:" ..username)
- repeat
- id, balance = rednet.receive()
- until id == bankID
- print("Balance: " ..balance.. "$ (CTRL = Update)")
- end
- function hai()
- clear()
- print("Welcome, " ..username.. "!")
- updateBalance()
- for i=1,w-1 do
- write("-")
- end
- print("Recent Actions: ")
- print("<Coming Soon>\n")
- print("Press Enter to donate.")
- while true do
- event, key = os.pullEvent("key")
- if key == 29 then
- hai()
- elseif key == 28 then
- donate()
- end
- end
- end
- function donate()
- clear()
- write("Who would you like to donate to? ")
- input = read()
- write("How much would you like to donate? $")
- test = read()
- --GIVE:<YOUR NAME>:<YOUR PASS>:<HOW MUCH U WANNA GIVE TO...>:<YOUR FRIEND>
- rednet.send(bankID, "GIVE:" ..username.. ":" ..password.. ":" ..test.. ":" ..input)
- hai()
- end
- hai()
- end
Advertisement
Add Comment
Please, Sign In to add comment