Posted 22 February 2012 - 04:12 PM
DERP DERP. I JUT REALISED read("*") DOES THE SAME…
function maskedInput(pReplace)
local replace = pReplace or "*"
local x,y = term.getCursorPos()
local input = {}
term.setCursorBlink(true)
while true do
local event, p1 = os.pullEvent()
if event == "char" then
input[#input+1]=p1
write(replace)
elseif event == "key" then
if p1 == 28 then --enter
break
elseif p1 == 14 then --backspace
table.remove(input)
term.setCursorPos(x+#input, y)
write(" ")
term.setCursorPos(x+#input, y)
end
end
end
print("")
term.setCursorBlink(false)
return table.concat(input)
end