Posted 05 January 2014 - 02:13 PM
This cool little utility allows you to put a text box wherever you want, you can specify the maximum length of the input, and you can set whether or not it is censored.
Pastebin:
http://pastebin.com/j9pYxix1
Just pop in the function and you're good to go!
Tell me, should I make this an API? Would that be easier?
Plans:
Comments and concerns appreciated!
Pastebin:
http://pastebin.com/j9pYxix1
-- modular text box
term.clear()
function textbox(lineNumber,lineSpaces,length,protected)
term.setCursorPos(lineNumber,lineSpaces)
if protected then this="*" else this=nil end
input=read(this) -- get the input
if string.len(input) > length then
return string.sub(input, 1, length) -- return chars from 1 to length
else
return input -- returns the whole thing
end
end
Just pop in the function and you're good to go!
Tell me, should I make this an API? Would that be easier?
Plans:
Spoiler
- Minimum Length
- Colored BG
Comments and concerns appreciated!