Tutorial/Log in and Log out Code

To make a simple login for Computer Craft you need to use the text below:


shell.run('clear')

done = true

while done == true do

 shell.run('clear')


 print ("Please enter your Username")

 input1 = read()

 print ("Please enter your Password")

 input2 = read()

 if input1 == "Enter a Username Here" and input2 == "Enter a Password Here" then

 print ("Welcome")

 done = false

 sleep (1)

 shell.run('clear')

 else

 print ("Error")

 sleep(2)

 end

end

Note:  You need to save the file as "startup" so it runs when you turn on your computer.  If you forget your password/username hold Ctrl + T for a few seconds and it will exit.

To log out of your computer you need to run the code below:

shell.run("startup")

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Need wiki hosting?

Do you need a wiki for your Minecraft mod/gaming wiki? We'll host it for free! Contact us.

Other wikis

Indie-game wikis
Powered by Indie Wikis