Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function reg()
- shell.run('clear')
- shell.run('/.Firewolf_Data/servers/craft.net/back')
- term.setCursorPos(1,5)
- shell.run('mkdir', '.u')
- term.setTextColour(colours.white)
- centerPrint("Registration")
- print''
- print(" Username ")
- term.setBackgroundColour(colours.grey)
- print(" ")
- term.setCursorPos(1,8)
- user = io.read()
- term.setBackgroundColour(colours.black)
- print''
- print(" Password ")
- term.setBackgroundColour(colours.grey)
- print(" ")
- term.setCursorPos(1,11)
- pass = read('x')
- term.setBackgroundColour(colours.black)
- if not fs.exists('/.u/' ..user) then
- file = fs.open('/.u/' ..user, 'w')
- file.write(pass)
- file.close()
- print''
- print(" Registered ")
- sleep(.5)
- log()
- else
- print''
- Print("Already Registered")
- sleep(.5)
- reg()
- end
- end
- function log()
- shell.run('clear')
- shell.run('/.Firewolf_Data/servers/craftnet.net/back')
- term.setCursorPos(1,5)
- term.setTextColour(colours.white)
- centerPrint("Login")
- print''
- print(" Username ")
- term.setBackgroundColour(colours.grey)
- print(" ")
- term.setCursorPos(1,8)
- user = io.read()
- term.setBackgroundColour(colours.black)
- print''
- print(" Password ")
- term.setBackgroundColour(colours.grey)
- print(" ")
- term.setCursorPos(1,11)
- pass = read('x')
- term.setBackgroundColour(colours.black)
- if not fs.exists('/.u/' ..user) then
- print''
- print(" Bad Login ")
- sleep(.5)
- log()
- else
- local file = fs.open('/.u/' ..user, 'r')
- local sText = file.readAll()
- file.close()
- if sText == pass then
- print''
- print(user.. " Logging In")
- sleep(.5)
- home()
- else
- print''
- print(" Bad Login ")
- log()
- end
- end
- end
- function home()
- shell.run('clear')
- term.setBackgroundColour(colours.green)
- print(" ")
- term.setBackgroundColour(colours.black)
- term.setTextColour(colours.grey)
- centerPrint("CraftNet Home")
- end
- if not fs.exists('/.Firewolf_Data/servers/craftnet.net/back') then
- file = fs.open('/.Firewolf_Data/servers/craftnet.net/back')
- file.write(term.setBackgroundColour(colours.green))
- file.write(print(" "))
- file.write(term.setBackgroundColour(colours.black))
- file.write(term.setTextColour(colours.grey))
- file.write(centerPrint("CraftNet"))
- file.write(term.setCursorPos(1,17))
- file.write(term.setBackgroundColour(colours.green))
- file.write(print(" "))
- file.close()
- if not fs.exists('/.u') then
- reg()
- else
- log()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement