From 827a6fa17670806f709cb3b00005a2dcf865a713 Mon Sep 17 00:00:00 2001 From: Ale2610 Date: Sat, 29 Aug 2015 16:06:03 +0200 Subject: [PATCH] Update sID.lua --- src/apps/system/sID.lua | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/apps/system/sID.lua b/src/apps/system/sID.lua index bdc6da2..b269a3f 100644 --- a/src/apps/system/sID.lua +++ b/src/apps/system/sID.lua @@ -1,3 +1,8 @@ +if not sPhone then + print("This app is for sPhone") + return +end + local function clear() term.setBackgroundColor(colors.white) term.setTextColor(colors.black) @@ -19,19 +24,12 @@ local function header() term.setTextColor(colors.black) end -header() - -if fs.exists("/.sPhone/config/.sIDpw") then - sPhone.winOk("Sertex ID", "Already Set!") +clear() +print("Checking Server...") +isDown = http.get("http://sertex.esy.es/status.php").readAll() +if isDown ~= "true" then + sPhone.winOk("The server is down", "Retry later") return end -while true do - header() - term.setCursorPos(1,4) - print(" Set Sertex ID") - write(" Username: ") - local name = read() - local nExists = http.post("http://sertex.esy.es/exists.php", "user="..name).readAll() - --later -end +header()