Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --DuoStep Client v0.2
- --Please use the installer to download DuoStep v0.1; The installer is located at: http://pastebin.com/RdPg0Rmr
- --(c)2013 NewCoolPC, willwac, and Thy.me Programs
- clientVer = "0.2"
- local isTrue = 2021185
- local isFalse = 6112195
- local function menu()
- --Config
- local side = "top"
- local sID = 2
- rednet.open( side )
- local id = os.getComputerID()
- --local validVer = {"ver",clientVer}
- --rednet.send(sID,validVer)
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.black)
- print("Please click on the player detector.")
- local p = nil
- while p == nil do
- event, p = os.pullEvent("player")
- end
- event = nil
- term.clear()
- term.setCursorPos(1,1)
- print("Requesting Validation check...")
- local plr = {"player",p}
- rednet.send(sID,plr)
- local sndr, isValid = rednet.receive(3)
- if isValid == isFalse then
- printError(p.." is not allowed on the computers.")
- menu()
- elseif isValid == isTrue then
- print("Username: "..p)
- print("Please enter in your password below.")
- print(" ")
- term.write("Password: ")
- local pass = read("*")
- local x,y=term.getCursorPos()
- term.setCursorPos( 1,y+1 )
- x,y = nil
- print("Requesting Validation check...")
- local cred = {"login",p,pass}
- rednet.send(sID, cred)
- sndr, isValid = rednet.receive(3)
- if isValid == isFalse then
- printError("Incorrect Password.")
- sleep(3)
- menu()
- elseif isValid == isTrue then
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome, "..p.."!")
- print("")
- print("Menu:")
- --print("1: Change Password")
- --print("2: Delete Account*")
- print("3: Log out")
- print("4: Shutdown")
- print("5: CraftOS")
- print("")
- term.write(">")
- local option = read()
- --if read == "1" then
- --term.clear()
- --term.setCursorPos(1,1)
- --print("Change Password:")
- --print("")
- --term.write("Old Password: ")
- --local pass = read("*")
- --local x,y = term.getCursorPos()
- --term.setCursorPos(1,y+2)
- --term.write("New Password: ")
- --local npass = read("*")
- --term.setCursorPos(y+3)
- --term.write("Again: ")
- --local npv = read("*")
- --if npass ~= npv then
- --menu()
- --else
- --local ps = {"change",p,pass,npass}
- --local sndr, stat = rednet.receive(10)
- --if stat == isFalse then
- --printError("Failure")
- --sleep(3)
- --menu()
- --elseif stat == isTrue then
- --print("Pass Changed.")
- --sleep(3)
- --menu()
- --end
- --end
- --elseif option == "2" then
- --term.clear()
- --term.setCursorPos(1,1)
- --print("Your admin must enter in their password.")
- --print("Have admin click on player detector.")
- --ap = nil
- --while ap == nil do
- --event, ap = os.pullEvent("player")
- --event = nil
- --end
- --print("Validating Player...")
- --local admin = {"delete",ap}
- --rednet.send(sID, admin)
- --local sndr, isAdmin = rednet.receive(3)
- --if isAdmin == isFalse then
- --printError(admin.." is not the admin.")
- --sleep(3)
- --menu()
- --elseif isAdmin == isTrue then
- --print("Delete "..p.."'s account?")
- --term.write(":")
- --local cmd = read(" ")
- --local x,y = term.getCursorPos()
- --term.setCursorPos(1,y+1)
- --if cmd == "grate" then
- --print(p..", enter in your pass.")
- --term.write(">")
- --local dpass = read("*")
- --local del = {"delconf",p,dpass}
- --rednet.send(sID,del)
- --print("Getting response...")
- --local sndr, conf = rednet.receive()
- --if conf == isTrue then
- --printError(p.."'s Account has been deleted.")
- --menu()
- --elseif conf == isFalse then
- --print(p.."'s Account has NOT been deleted.")
- --menu()
- --end
- --else
- --menu()
- --end
- --end
- if option == "3" then
- menu()
- elseif option == "4" then
- os.shutdown()
- elseif option == "5" then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- return
- else
- printError("Not a valid option.")
- sleep(4)
- menu()
- end
- end
- end
- end
- menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement