Update sms.lua

This commit is contained in:
Ale32bit 2015-11-01 18:17:28 +01:00
parent da03e75012
commit fc603a55c9

View file

@ -48,6 +48,7 @@ while true do
if not tArgs[1] then if not tArgs[1] then
term.clearLine() term.clearLine()
term.setCursorPos(1,y) term.setCursorPos(1,y)
print("Leave blank to get unread chat\n")
write("Send To: ") write("Send To: ")
sendTo = read() sendTo = read()
else else
@ -70,6 +71,9 @@ while true do
return return
end end
end end
if sendTo == "" then
getAllSMS = true
end
term.clear() term.clear()
local x,y = term.getSize() local x,y = term.getSize()
local mainTerm = term.current() local mainTerm = term.current()
@ -84,12 +88,18 @@ local function readMsg()
term.setCursorBlink(true) term.setCursorBlink(true)
term.setBackgroundColor(colors.green) term.setBackgroundColor(colors.green)
term.setTextColor(colors.white) term.setTextColor(colors.white)
term.clear() term.clear()
term.setCursorPos(1,1) term.setCursorPos(1,1)
term.write("Send: ") term.write("Send: ")
local msg = read() if not getAllSMS then
local msg = base64.encode(msg) local msg = read()
term.clear() else
term.write("Disabled")
sleep(100)
local msg = ""
end
local msg = base64.encode(msg)
term.clear()
if base64.decode(msg) == "/logout" then if base64.decode(msg) == "/logout" then
term.redirect(mainTerm) term.redirect(mainTerm)
return return