Update sms.lua

This commit is contained in:
Ale32bit 2015-11-02 21:44:31 +01:00
parent d9c61565a3
commit fd265bb5a4

View file

@ -87,6 +87,7 @@ local function readMsg()
term.setTextColor(colors.white) term.setTextColor(colors.white)
term.clear() term.clear()
term.setCursorPos(1,1) term.setCursorPos(1,1)
if sendTo ~= "" then
term.write("Send: ") term.write("Send: ")
local msg = read() local msg = read()
local msg = base64.encode(msg) local msg = base64.encode(msg)
@ -122,6 +123,16 @@ local function readMsg()
end end
end end
end end
else
term.write("Press enter to exit")
while true do
local _, k = os.pullEvent("key")
if k == keys.enter then
term.redirect(mainTerm)
return
end
end
end
end end
end end
local function recMsg() local function recMsg()
@ -145,7 +156,9 @@ local function recMsg()
end end
end end
end end
if sendTo ~= "" 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 = {}