Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server=19
- term.clear()
- rednet.open("top")
- paintutils.drawFilledBox(1,1,51,51,colors.blue)
- paintutils.drawFilledBox(13,5,39,14,colors.black)
- finnishedWaiting=false
- login=false
- correctInput=false
- verified=false
- hidden="*"
- newHidden=nil
- term.setCursorPos(16,7)
- write("Username:")
- term.setCursorPos(16,9)
- write("Password:")
- term.setCursorPos(24,11)
- term.setTextColor(colors.green)
- write("LOGIN")
- term.setCursorPos(32,13)
- term.setTextColor(colors.gray)
- write("Sign In")
- term.setCursorPos(35,6)
- term.setTextColor(colors.red)
- write("hide")
- term.setTextColor(colors.white)
- term.setCursorPos(13,5)
- write("###########################")
- term.setCursorPos(13,14)
- write("###########################")
- for i=6,13 do
- term.setCursorPos(13,i)
- write("#")
- end
- for i=6,13 do
- term.setCursorPos(39,i)
- write("#")
- end
- --DESIGN
- --connectionTest
- rednet.send(server,"test")
- testTimer=os.startTimer(3)
- while finnishedWaiting==false do
- event,a,b=os.pullEvent()
- if a==19 and b=="." and event=="rednet_message" then
- connection=true
- finnishedWaiting=true
- elseif event=="timer" then
- connection=false
- finnishedWaiting=true
- end
- end
- if connection==false then
- term.setBackgroundColor(colors.red)
- term.setCursorPos(20,4)
- write("no connection")
- term.setBackgroundColor(colors.black)
- end
- --connectionTest
- --Login-Screen
- while login==false do
- event,numb,x,y=os.pullEvent("mouse_click")
- term.setCursorPos(x,y)
- if y==7 then
- paintutils.drawFilledBox(26,7,38,7,colors.black)
- term.setCursorPos(26,7)
- name=read()
- elseif y==9 then
- paintutils.drawFilledBox(26,9,38,9,colors.black)
- term.setCursorPos(26,9)
- pass=read(hidden)
- elseif y==11 then
- login=true
- elseif y==6 then
- hidden=newHidden
- if hidden=="*" then
- newHiden=nil
- else
- newHidden="*"
- end
- elseif y==13 then
- --Register-Screen
- paintutils.drawFilledBox(14,6,38,13,colors.black)
- term.setBackgroundColor(colors.orange)
- term.setCursorPos(15,7)
- print("Username:")
- term.setCursorPos(15,9)
- print("Password:")
- term.setCursorPos(15,11)
- print("confirm PW:")
- term.setBackgroundColor(colors.black)
- term.setCursorPos(14,13)
- term.setTextColor(colors.green)
- print("COMPLETE")
- term.setCursorPos(33,13)
- term.setTextColor(colors.red)
- print("cancel")
- term.setTextColor(colors.white)
- --Design
- while verified==false do
- event,numb,x,y=os.pullEvent("mouse_click")
- term.setCursorPos(x,y)
- if y==7 then
- paintutils.drawFilledBox(26,7,38,7,colors.black)
- term.setCursorPos(26,7)
- newUser=read()
- elseif y==9 then
- paintutils.drawFilledBox(26,9,38,9,colors.black)
- term.setCursorPos(26,9)
- newPass=read()
- elseif y==11 then
- paintutils.drawFilledBox(26,11,38,11,colors.black)
- term.setCursorPos(26,11)
- newPassC=read()
- elseif y==13 and x>13 and x<20 then
- if newPass==newPassC then
- rednet.send(server,"newProfile")
- sleep(1)
- rednet.send(server,newUser)
- rednet.send(server,newPass)
- verified=true
- shell.run("loginClient")
- shell.run("clear")
- error()
- end
- elseif y==13 and x>24 and x<32 then
- verified=true
- shell.run("password2")
- shell.run("clear")
- error()
- end
- end
- end
- end
- rednet.send(server,"testProfile")
- term.setTextColor(colors.purple)
- term.setCursorPos(16,13)
- textutils.slowPrint("..connecting..")
- sleep(1)
- rednet.send(server,name)
- rednet.send(server,pass)
- event,a,b,c=os.pullEvent("rednet_message")
- if a==server then
- found=b
- end
- if found=="true" then
- paintutils.drawFilledBox(1,1,51,51,colors.green)
- sleep(2)
- shell.run("clear")
- else
- paintutils.drawFilledBox(1,1,51,51,colors.red)
- sleep(2)
- rednet.close("top")
- shell.run("loginClient")
- end
- paintutils.drawFilledBox(1,1,51,51,colors.black)
- shell.run("clear")
- rednet.close("top")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement