This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
BlackRa1n's profile picture

[LUA] Making Input *'s

Started by BlackRa1n, 25 March 2012 - 09:38 AM
BlackRa1n #1
Posted 25 March 2012 - 11:38 AM
Hey, so I have this code for a password to unlock a door…


os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1,1)
print("BlackRa1n Inc.")
print("-------------------")
print("")
print("Please Enter Password: ")
p = read()
if p == 'lol123' then
print("")
textutils.slowPrint(". . .")
print("")
sleep(3)
print("Password Correct! You may enter!")
rs.setOutput("right", true)
sleep(3)
rs.setOutput("right", false)
else
print("")
textutils.slowPrint(". . .")
sleep(3)
print("")
print("Password Incorrect! Please Try Again!")
sleep(3)
end
os.reboot()

How would I make it so whatever the user types in come out as *****'s?
zedalius #2
Posted 25 March 2012 - 11:40 AM
use

read("*")
instead of
read()
:(/>/>
BlackRa1n #3
Posted 25 March 2012 - 11:44 AM
use

read("*")
instead of
read()
:)/>/>

You are now offically my new best friend. :(/>/>
Thanks!