Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- local user = ""
- if fs.exists("user") then
- passf = fs.open("pass", "r")
- userf = fs.open("user", "r")
- password = passf.readLine()
- username = userf.readLine()
- passf.close()
- userf.close()
- else
- print("please choose a username")
- username = read()
- ispassok = false
- while ispassok==false do
- term.clear()
- term.setCursorPos(1,1)
- print("please choose a password")
- password = read("*")
- print("retype password")
- if read("*")==password then
- ispassok = true
- end
- end
- passf = fs.open("pass", "w")
- userf = fs.open("user", "w")
- passf.writeLine(password)
- userf.writeLine(username)
- passf.close()
- userf.close()
- end
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.black)
- term.clear()
- local image = paintutils.loadImage("menupic")
- paintutils.drawImage(image, 13, 5)
- intrue = true
- while intrue do
- local event, button, x, y = os.pullEvent( "mouse_click" )
- if y==8 and x>13 and x<31 then
- paintutils.drawLine(14,8,30,8,colors.lightBlue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(14, 8)
- user = read()
- end
- if y==11 and x>13 and x<31 then
- paintutils.drawLine(14,11,30,11,colors.lightBlue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(14, 11)
- pass = read("*")
- end
- if y==13 and x>13+18 and x<31+18 then
- term.setCursorPos(14, 13)
- if user==username and pass==password then
- term.clear()
- intrue = false
- else
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.red)
- term.write("incorrect")
- term.setTextColor(colors.black)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement