Update sms.lua

This commit is contained in:
Ale32bit 2015-10-10 14:22:27 +02:00
parent 7e567c518c
commit fb443d3a03

View file

@ -110,7 +110,7 @@ local function readMsg()
elseif e[1] == "http_success" then elseif e[1] == "http_success" then
displayWin.setCursorPos(1,y) displayWin.setCursorPos(1,y)
displayWin.write("<You> "..base64.decode(msg)) displayWin.write("<You> "..base64.decode(msg))
if y == my then displayWin.scroll(1) else y = y +1 end if y == my then displayWin.scroll(1) else if #msg < 20 then y = y + 1 else y = y + 2 end end
break break
elseif e[1] == "http_failure" then elseif e[1] == "http_failure" then
term.redirect(ntv) term.redirect(ntv)
@ -128,13 +128,22 @@ local function recMsg()
displayWin.setTextColor(colors.black) displayWin.setTextColor(colors.black)
displayWin.clear() displayWin.clear()
local function printMsg(msg) local function printMsg(msg)
local
displayWin.setCursorBlink(false) displayWin.setCursorBlink(false)
displayWin.setCursorPos(1,y) displayWin.setCursorPos(1,y)
local nTerm = term.current() local nTerm = term.current()
term.redirect(displayWin) term.redirect(displayWin)
print(msg) print(msg)
term.redirect(nTerm) term.redirect(nTerm)
if y == my then displayWin.scroll(1) else y = y + 1 end if y == my then
displayWin.scroll(1)
else
if #msg < 26 then
y = y + 1
else
y = y + 2
end
end
end end
printMsg("Type /logout to exit") printMsg("Type /logout to exit")
while true do while true do