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

ComputerLock. Multiple users supported.

Started by libraryaddict, 29 April 2012 - 09:46 AM
libraryaddict #1
Posted 29 April 2012 - 11:46 AM
http://pastebin.com/dbQi5xAE

Just run this.
If you don't want it asking for a login then set the username and password as "NA"

That means if you are the owner of the server/world.
You can have this on every computer :)/>/>
And those who don't want a password don't need to have one.
Aside from remembering to input "NA" xD


On first run it will ask for a username and password.
It will then save the username and password in Users.F
To add a user then edit Users.F and make a new line.
Then use Username:Password.
To delete a password you must either take out the ":" or delete the line the password is on.
So I can use to add myself with the password "floo"
libraryaddict:floo

When you enter the password details and username correctly.
It goes into the main computer.

libraryaddict #2
Posted 01 May 2012 - 10:09 PM
Wonder if I should improve on this to add accounts that you can give permissions to.
Eg. Permissions to use commands with parameters.
Guest's can only use reboot. shutdown and list.
Users can only use the programs.
Administrators can edit.
And you can control what each one can do with as many ranks as you like :
ComputerCraftFan11 #3
Posted 02 May 2012 - 06:08 AM
Not sure if this is what you did, but you should add this:
Store the username as a folder
Store the password inside the folder
If you login to that account, then execute this code:

shell.run("cd", username.."/programs")
So each user can have their own programs
libraryaddict #4
Posted 02 May 2012 - 07:36 AM
Thanks for the suggestion