Update sPhone.lua

This commit is contained in:
Ale32bit 2015-11-27 22:39:21 +01:00
parent df37b6deac
commit 49e66769ff

View file

@ -446,9 +446,9 @@ end
term.setCursorPos(1,3) term.setCursorPos(1,3)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
term.setTextColor(colors.black) term.setTextColor(colors.black)
sertextext.center(3, " "..title) visum.align("center", " "..title, false, 3)
if desc then if desc then
sertextext.center(6, " "..desc) visum.align("center", " "..desc,false,6)
end end
paintutils.drawFilledBox(3, 16, 9, 18, colors.green) paintutils.drawFilledBox(3, 16, 9, 18, colors.green)
paintutils.drawFilledBox(18, 16, 24, 18, colors.red) paintutils.drawFilledBox(18, 16, 24, 18, colors.red)
@ -556,7 +556,7 @@ end
paintutils.drawLine(1,1,w,1,colors.blue) paintutils.drawLine(1,1,w,1,colors.blue)
term.setCursorBlink(false) term.setCursorBlink(false)
term.setTextColor(colors.white) term.setTextColor(colors.white)
sertextext.center(1," Chat") visum.align("center," Chat",6)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
term.setTextColor(colors.black) term.setTextColor(colors.black)
term.setCursorPos(2, 5) term.setCursorPos(2, 5)
@ -598,7 +598,7 @@ end
local w, h = term.getSize() local w, h = term.getSize()
paintutils.drawLine(1,1,w,1, colors.blue) paintutils.drawLine(1,1,w,1, colors.blue)
term.setTextColor(colors.white) term.setTextColor(colors.white)
sertextext.right(1,"vvv") visum.align("right","vvv ",false,1)
term.setCursorPos(1,1) term.setCursorPos(1,1)
if not sPhone.newUpdate then if not sPhone.newUpdate then
write(" "..sPhone.user) write(" "..sPhone.user)
@ -622,8 +622,8 @@ end
graphics.box(1,2,w,4,colors.blue) graphics.box(1,2,w,4,colors.blue)
term.setTextColor(colors.white) term.setTextColor(colors.white)
term.setBackgroundColor(colors.blue) term.setBackgroundColor(colors.blue)
sertextext.right(1,"^^^") visum.align("right","^^^ ",false,1)
sertextext.right(3, "Reboot") visum.align("right", "Reboot ",false,3)
term.setCursorPos(11,3) term.setCursorPos(11,3)
write("Settings") write("Settings")
term.setCursorPos(2,3) term.setCursorPos(2,3)
@ -708,11 +708,11 @@ end
if sPhone.wrongPassword then if sPhone.wrongPassword then
term.setTextColor(colors.red) term.setTextColor(colors.red)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
sertextext.center(13," Wrong Password") visum.align("center"," Wrong Password",false,13)
end end
term.setTextColor(colors.black) term.setTextColor(colors.black)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
sertextext.center(7," Insert Password") visum.align("center"," Insert Password",false,7)
local loginTerm = window.create(term.native(), 8,10,12,1, true) local loginTerm = window.create(term.native(), 8,10,12,1, true)
term.redirect(loginTerm) term.redirect(loginTerm)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
@ -740,12 +740,12 @@ end
paintutils.drawImage(paintutils.loadImage("/.sPhone/interfaces/login"),1,1) paintutils.drawImage(paintutils.loadImage("/.sPhone/interfaces/login"),1,1)
if sPhone.wrongPassword then if sPhone.wrongPassword then
term.setTextColor(colors.red) term.setTextColor(colors.red)
sertextext.center(13," Wrong Password") visum.align("center"," Wrong Password",false,13)
end end
term.setTextColor(colors.black) term.setTextColor(colors.black)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
sertextext.center(3," Setup") visum.align("center"," Setup",false,3)
sertextext.center(7," Insert Password") visum.align("center"," Insert Password",false,5)
local loginTerm = window.create(term.native(), 8,10,12,1, true) local loginTerm = window.create(term.native(), 8,10,12,1, true)
term.redirect(loginTerm) term.redirect(loginTerm)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
@ -759,8 +759,8 @@ end
paintutils.drawImage(paintutils.loadImage("/.sPhone/interfaces/login"),1,1) paintutils.drawImage(paintutils.loadImage("/.sPhone/interfaces/login"),1,1)
term.setTextColor(colors.black) term.setTextColor(colors.black)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
sertextext.center(3," Setup") visum.align("center"," Setup",false,3)
sertextext.center(7," Repeat") visum.align("center"," Repeat",false,7)
local loginTerm = window.create(term.native(), 8,10,12,1, true) local loginTerm = window.create(term.native(), 8,10,12,1, true)
term.redirect(loginTerm) term.redirect(loginTerm)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
@ -774,7 +774,7 @@ end
f.write(sha256.sha256(password1)) f.write(sha256.sha256(password1))
f.close() f.close()
term.setTextColor(colors.lime) term.setTextColor(colors.lime)
sertextext.center(13," Password set!") visum.align("center"," Password set!",false,13)
sleep(2) sleep(2)
break break
else else
@ -789,11 +789,11 @@ end
paintutils.drawLine(1,1,w,1,colors.blue) paintutils.drawLine(1,1,w,1,colors.blue)
term.setTextColor(colors.black) term.setTextColor(colors.black)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
sertextext.center(3," Setup Sertex ID") visum.align("center"," Setup Sertex ID",false,3)
local isDown = http.get("http://sertex.x10.bz/status.php").readAll() local isDown = http.get("http://sertex.x10.bz/status.php").readAll()
if isDown ~= "true" then if isDown ~= "true" then
sertextext.center(5, " The server is down") visum.align("center", " The server is down",false,5)
sertextext.center(6, " Run sID on the home") visum.align("center", " Run sID on the home",false,6)
name = "Run sID" name = "Run sID"
sleep(2) sleep(2)
else else
@ -807,16 +807,16 @@ end
paintutils.drawLine(1,1,w,1,colors.blue) paintutils.drawLine(1,1,w,1,colors.blue)
term.setTextColor(colors.black) term.setTextColor(colors.black)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
sertextext.center(3," Setup Sertex ID") visum.align("center"," Setup Sertex ID",false,3)
sertextext.center(7," Your Username") visum.align("center"," Your Username",false,5)
term.setCursorPos(3,8) term.setCursorPos(3,8)
name = read() name = read()
while true do while true do
sertextext.center(9, " Your Password") visum.align("center", " Your Password",false,9)
term.setCursorPos(3,10) term.setCursorPos(3,10)
term.clearLine() term.clearLine()
pw = read("*") pw = read("*")
sertextext.center(11, " Repeat") visum.align("center", " Repeat",false,11)
term.setCursorPos(3,12) term.setCursorPos(3,12)
term.clearLine() term.clearLine()
pwr = read("*") pwr = read("*")
@ -848,15 +848,15 @@ end
paintutils.drawLine(1,1,w,1,colors.blue) paintutils.drawLine(1,1,w,1,colors.blue)
term.setTextColor(colors.black) term.setTextColor(colors.black)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
sertextext.center(3," Setup Sertex ID") visum.align("center"," Setup Sertex ID",false,3)
sertextext.center(7," Your Username") visum.align("center"," Your Username",false,7)
term.setCursorPos(3,8) term.setCursorPos(3,8)
name = read() name = read()
sertextext.center(9, " Your Password") visum.align("center", " Your Password",false,9)
term.setCursorPos(3,10) term.setCursorPos(3,10)
term.clearLine() term.clearLine()
pw = read("*") pw = read("*")
sertextext.center(11, " Checking...") visum.align("center", " Checking...",false,11)
rServer = http.post("http://sertex.x10.bz/login.php", "user="..name.."&password="..pw).readAll() rServer = http.post("http://sertex.x10.bz/login.php", "user="..name.."&password="..pw).readAll()
if rServer ~= "true" then if rServer ~= "true" then
print(" Wrong Username/Password") print(" Wrong Username/Password")
@ -876,10 +876,10 @@ end
os.setComputerLabel(sPhone.user.."'s sPhone") os.setComputerLabel(sPhone.user.."'s sPhone")
term.setCursorPos(1,13) term.setCursorPos(1,13)
term.clearLine() term.clearLine()
sertextext.center(13," All Set!") visum.align("center"," All Set!",false,13)
term.setCursorPos(1,14) term.setCursorPos(1,14)
term.clearLine() term.clearLine()
sertextext.center(14," Have fun with sPhone") visum.align("center"," Have fun with sPhone",false,14)
sleep(2) sleep(2)
sPhone.locked = false sPhone.locked = false
return return