Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fileName = "client"
- if(fs.exists(fileName) == true)then
- print("Installing BlueBank Client System")
- shell.run("rename "..fileName.." startup")
- sleep(5)
- os.reboot()
- end
- --[ BlueBank Client by TrumpetMiner v3.5
- --[ pastebin get bpf4TVGb client
- --[ Setup
- log = 0 -- Don't Change This!
- logU = "Guest" -- Don't Worry About This
- side = nil
- ser = nil -- Change To Server's ID#
- function getserver()
- local fname = "ServerID"
- if fs.exists(fname) then
- file = fs.open(fname, "r")
- ser = tonumber(file.readAll())
- file.close()
- print("Server ID: "..ser)
- else
- print("No server configured")
- print("This ID is: ".. os.getComputerID())
- term.write("Server ID: ")
- ser = io.read()
- file = fs.open(fname, "w")
- file.write(ser)
- file.close()
- ser = tonumber(ser)
- end
- end
- getserver()
- -- Determine where the modem is.
- print("Looking for modem,")
- if peripheral.isPresent("left") and peripheral.getType("left")=="modem" then
- side = "left"
- elseif peripheral.isPresent("right") and peripheral.getType("right")=="modem" then
- side = "right"
- elseif peripheral.isPresent("top") and peripheral.getType("top")=="modem" then
- side = "top"
- elseif peripheral.isPresent("back") and peripheral.getType("back")=="modem" then
- side = "back"
- elseif peripheral.isPresent("bottom") and peripheral.getType("bottom")=="modem" then
- side = "bottom"
- else
- print("No Modem Found")
- side = false
- end
- while side == false do
- sleep(5)
- shell.run("startup")
- end
- print("Modem found on "..side)
- rednet.open(side)
- -- Functions
- function start()
- backC(8)
- textC(16)
- term.clear()
- cur(1,1)
- print("Welcome, "..logU)
- if log == 1 then
- cur(3,4)
- print "[Logout]"
- cur(3,6)
- print "[Balance]"
- cur(3,8)
- print "[Transfer]"
- else
- cur(3,4)
- print "[Login]"
- cur(3,6)
- print "[Create Account]"
- end
- event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 3 and X <= 10 and Y == 4 and log == 0 then
- rednet.send(ser,"Login")
- term.clear()
- cur(3,4)
- write "User: "
- user = read()
- cur(3,5)
- write "Pass: "
- pass = read("*")
- rednet.send(ser,user)
- rednet.send(ser,pass)
- ser, message = rednet.receive()
- if message == "Login Successful" then
- log = 1
- logU = user
- end
- cur(3,2)
- print(message)
- sleep(1)
- start()
- elseif X >= 3 and X <= 10 and Y == 4 and log == 1 then
- log = 0
- logU = "Guest"
- start()
- elseif X >= 3 and X <= 11 and Y == 6 and log == 1 then
- rednet.send(ser,"Balance")
- sleep(.5)
- rednet.send(ser,logU)
- ser, bal = rednet.receive()
- term.clear()
- cur(1,1)
- print("Balance is $"..bal)
- os.pullEvent("mouse_click")
- start()
- elseif X >= 3 and X <= 12 and Y == 8 and log == 1 then
- rednet.send(ser,"Transfer")
- term.clear()
- cur(3,4)
- write "Amount: $"
- am = read()
- cur(3,6)
- write "To User: "
- user2 = read()
- rednet.send(ser,logU)
- rednet.send(ser,user2)
- rednet.send(ser,am)
- id, message = rednet.receive()
- cur(3,2)
- print(message)
- os.pullEvent("mouse_click")
- start()
- elseif X >= 3 and X <= 18 and Y == 6 and log == 0 then
- term.clear()
- cur(3,4)
- write "Username: "
- user = read()
- term.clear()
- cur(3,4)
- write "Passcode: "
- pass = read()
- term.clear()
- rednet.send(ser,"Create")
- rednet.send(ser,user)
- rednet.send(ser,pass)
- id, msg = rednet.receive()
- cur(3,4)
- print(msg)
- os.pullEvent("mouse_click")
- start()
- else
- start()
- end
- end
- function cur(cX,cY)
- term.setCursorPos(cX,cY)
- end
- function backC(color)
- term.setBackgroundColor(color)
- end
- function textC(color)
- term.setTextColor(color)
- end
- -- Programs
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement