Update sPhone.lua
This commit is contained in:
parent
d70b06dd49
commit
02680b2e40
1 changed files with 40 additions and 5 deletions
|
@ -382,6 +382,7 @@ local function kernel()
|
||||||
local name
|
local name
|
||||||
local pw
|
local pw
|
||||||
local pwr
|
local pwr
|
||||||
|
local rServer
|
||||||
while true do
|
while true do
|
||||||
term.clear()
|
term.clear()
|
||||||
term.setCursorPos(1,1)
|
term.setCursorPos(1,1)
|
||||||
|
@ -448,6 +449,7 @@ local function kernel()
|
||||||
|
|
||||||
local choose = sPhone.yesNo("Setup Sertex ID", "Do you have a Sertex ID?")
|
local choose = sPhone.yesNo("Setup Sertex ID", "Do you have a Sertex ID?")
|
||||||
if not choose then
|
if not choose then
|
||||||
|
term.setBackgroundColor(colors.white)
|
||||||
term.clear()
|
term.clear()
|
||||||
term.setCursorPos(1,1)
|
term.setCursorPos(1,1)
|
||||||
local w, h = term.getSize()
|
local w, h = term.getSize()
|
||||||
|
@ -486,6 +488,40 @@ local function kernel()
|
||||||
local pwf = fs.open("/.sPhone/config/.sIDPw", "w")
|
local pwf = fs.open("/.sPhone/config/.sIDPw", "w")
|
||||||
pwf.write(pw)
|
pwf.write(pw)
|
||||||
pwf.close()
|
pwf.close()
|
||||||
|
else
|
||||||
|
while true do
|
||||||
|
term.setBackgroundColor(colors.white)
|
||||||
|
term.clear()
|
||||||
|
term.setCursorPos(1,1)
|
||||||
|
local w, h = term.getSize()
|
||||||
|
paintutils.drawLine(1,1,w,1,colors.gray)
|
||||||
|
term.setTextColor(colors.black)
|
||||||
|
term.setBackgroundColor(colors.white)
|
||||||
|
sertextext.center(3," Setup Sertex ID")
|
||||||
|
sertextext.center(7," Your Username")
|
||||||
|
term.setCursorPos(3,8)
|
||||||
|
name = read()
|
||||||
|
sertextext.center(9, " Your Password")
|
||||||
|
term.setCursorPos(3,10)
|
||||||
|
term.clearLine()
|
||||||
|
pw = read("*")
|
||||||
|
sertextext.center(11, " Checking...")
|
||||||
|
rServer = http.post("http://sertex.esy.es/login.php", "user="..name.."&password="..pw).readAll()
|
||||||
|
if rServer ~= "true" then
|
||||||
|
print(" Wrong Username/Password")
|
||||||
|
sleep(2)
|
||||||
|
else
|
||||||
|
f = fs.open("/.sPhone/config/username", "w")
|
||||||
|
f.write(name)
|
||||||
|
f.close()
|
||||||
|
f = fs.open("/.sPhone/config/.sIDpw", "w")
|
||||||
|
f.write(pw)
|
||||||
|
f.close()
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
sertextext.center(13," All Set!")
|
sertextext.center(13," All Set!")
|
||||||
sertextext.center(14,"Have fun with sPhone")
|
sertextext.center(14,"Have fun with sPhone")
|
||||||
sPhone.user = name
|
sPhone.user = name
|
||||||
|
@ -493,7 +529,6 @@ local function kernel()
|
||||||
home()
|
home()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
login()
|
login()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue