Update sms.lua

This commit is contained in:
Ale32bit 2015-11-02 21:35:55 +01:00
parent d8f35b61ab
commit d9c61565a3

View file

@ -54,9 +54,6 @@ while true do
else else
sendTo = tArgs[1] sendTo = tArgs[1]
end end
if sendTo == "" then
local getAllSMS = true
end
local doesUserExist = http.post(server.."exists.php", "user="..sendTo).readAll() local doesUserExist = http.post(server.."exists.php", "user="..sendTo).readAll()
if doesUserExist ~= "true" then if doesUserExist ~= "true" then
sPhone.winOk(sendTo.." does","not exist!", colors.lime, colors.green, colors.white, colors.lime) sPhone.winOk(sendTo.." does","not exist!", colors.lime, colors.green, colors.white, colors.lime)
@ -90,22 +87,8 @@ local function readMsg()
term.setTextColor(colors.white) term.setTextColor(colors.white)
term.clear() term.clear()
term.setCursorPos(1,1) term.setCursorPos(1,1)
if not getAllSMS then
term.write("Send: ") term.write("Send: ")
else
term.write("Enter to exit")
term.setCursorBlink(false)
end
if not getAllSMS then
local msg = read() local msg = read()
else
_,c = os.pullEvent("key")
if c == keys.enter then
term.redirect(mainTerm)
return
end
end
local msg = base64.encode(msg) local msg = base64.encode(msg)
term.clear() term.clear()
if base64.decode(msg) == "/logout" then if base64.decode(msg) == "/logout" then
@ -162,9 +145,7 @@ local function recMsg()
end end
end end
end end
if not getAllSMS then printMsg("Type /logout to exit")
printMsg("Type /logout to exit")
end
while true do while true do
stream = http.post(server.."update.php",head) stream = http.post(server.."update.php",head)
newMessages = {} newMessages = {}