Update sPhone.lua
This commit is contained in:
parent
5d55ba5945
commit
5b9e85caaf
1 changed files with 60 additions and 45 deletions
|
@ -447,6 +447,22 @@ local function kernel()
|
|||
end
|
||||
end
|
||||
|
||||
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")
|
||||
local isDown = http.get("http://sertex.esy.es/status.php").readAll()
|
||||
if isDown ~= "true" then
|
||||
sertextext.center(5, " The server is down")
|
||||
sertextext.center(6, " Run sID on the home")
|
||||
name = "Run sID"
|
||||
sleep(2)
|
||||
else
|
||||
|
||||
local choose = sPhone.yesNo("Setup Sertex ID", "Do you have a Sertex ID?")
|
||||
if not choose then
|
||||
term.setBackgroundColor(colors.white)
|
||||
|
@ -478,8 +494,7 @@ local function kernel()
|
|||
end
|
||||
local rServer = http.post("http://sertex.esy.es/register.php", "user="..name.."&password="..pw).readAll()
|
||||
if rServer ~= "Success!" then
|
||||
print("The server is down")
|
||||
print("Or Username already exists")
|
||||
print("Username already exists")
|
||||
print("Retry later in the app sID")
|
||||
sleep(1)
|
||||
end
|
||||
|
@ -487,10 +502,9 @@ local function kernel()
|
|||
f.write(name)
|
||||
f.close()
|
||||
local pwf = fs.open("/.sPhone/config/.sIDPw", "w")
|
||||
pwf.write(pw)
|
||||
pwf.write(base64.encode(pw))
|
||||
pwf.close()
|
||||
else
|
||||
while true do
|
||||
term.setBackgroundColor(colors.white)
|
||||
term.clear()
|
||||
term.setCursorPos(1,1)
|
||||
|
@ -510,6 +524,7 @@ local function kernel()
|
|||
rServer = http.post("http://sertex.esy.es/login.php", "user="..name.."&password="..pw).readAll()
|
||||
if rServer ~= "true" then
|
||||
print(" Wrong Username/Password")
|
||||
print(" Run sID")
|
||||
sleep(2)
|
||||
else
|
||||
f = fs.open("/.sPhone/config/username", "w")
|
||||
|
|
Loading…
Reference in a new issue