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

editing programs under os.PullEvent = os.PullEventRaw

Started by sleawnis, 27 October 2012 - 08:28 PM
sleawnis #1
Posted 27 October 2012 - 10:28 PM
ive made a password login system on my spawn base heres what it looks like:

quite snassy :D/>/>
anyway i need to make it unhackable with os.pull…. all that stuff but if i do would i beable to add users to the system after with a floppy drive maby?
remiX #2
Posted 27 October 2012 - 10:30 PM
Just make an admin account which can add users :D/>/>

Btw - Nice laptop :)/>/>
sleawnis #3
Posted 27 October 2012 - 11:16 PM
ty lol do u think you could help me make a admin account? would it be somethign to like ignore the pull event block? could u make sum quick code pls?
Lyqyd #4
Posted 27 October 2012 - 11:22 PM
Just put a floppy with a blank file named startup into a disk drive next to the computer, then reboot the computer.
ChunLing #5
Posted 27 October 2012 - 11:33 PM
That works well enough. Just have the drive on a side that people can't access unless they've entered the system.
sleawnis #6
Posted 28 October 2012 - 04:37 PM
is there a way to set up a admin account tho cause it would look cool to show my friends :D/>/> ?
ChunLing #7
Posted 28 October 2012 - 06:36 PM
Sure, if you use a table of passwords keyed by user, just make the user a key to a subtable instead of a simple value, and it can contain a "user_level" value, like so:
t_users = {
geraldine = {password = "something",user_level = 3,},fallion = {password = "evil",user_level = 1,},
angelus = {password = "divine",user_level = 5,},almighty = {password = "godly",user_level = 10,},
}
Then give the higher level functions an if t_users[current_user].user_level > 4 then …(body of function)…end structure. Now the function only does anything for users with a user_level higher than 4 (so angelus and almighty). You can create any number of user_levels, as many as you need, but probably two is enough, so you can just have a boolean value and just do "t_users[current_user].user_level then" stuff.
Expenox #8
Posted 28 October 2012 - 10:56 PM
Amazing I must say.
sleawnis #9
Posted 29 October 2012 - 04:42 PM
Amazing I must say.
what is?
remiX #10
Posted 29 October 2012 - 05:30 PM

Your acsii art ;D

Do you have 2 separate files for users and passwords or are you using one file to save them?