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

Help with password gui

Started by Condings, 29 August 2012 - 10:59 PM
Condings #1
Posted 30 August 2012 - 12:59 AM
Hi im a noob to lua but im picking stuff up so i decided to try to make a login gui to open a door nothing fancy but when i run the program you type the password and its under the gui is there a way to get it to type next to the password: field?

this is my code


pass = "base"
print (" _____________ ")
print ("|   Welcome   |")
print ("|_____________|")
print ("| User: Admin |")
write ("| Pass:	   |")
print ("|_____________|")
input = read ("*")
if input == pass then
rs.setOutput ("left", true)
sleep (5)
os.shutdown ()
else
term.clear ()
term.setCursorPos(1,1)
write ("Access Denied!")
sleep (5)
os.reboot()
end

any help will be appreciated
Luanub #2
Posted 30 August 2012 - 01:40 AM
Just use term.setCursorPos() to position the cursor next to the pass field and then do your input = read("*").