Posted 05 April 2015 - 04:40 PM
I have removed the content since I might be working on some new programs.
Edited on 20 April 2016 - 07:05 PM
Hello fellow dutchie! (stroopwafels ftw)
Cool programs, but a password manager is quite pointless in Computercraft, because there are so many ways to bypass it.
Also, using textutils.slowPrint is generally a bad practice. Use print() instead.
It would be better if the updater only updates when there is a newer version.
There are a few redundancies in your code, like == true and 2>1, but I can't fix them now :(/>
this makes the whole program pointless as it tells the program it is configured at the start. try http://pastebin.com/pqxNBrrL and add it to the computercraft1.XX.jar in jar/assets/computercraft/autorun as there is no way to bypass that fileconfigured = true
There is no need to put it in autorun, just name the file "startup".this makes the whole program pointless as it tells the program it is configured at the start. try http://pastebin.com/pqxNBrrL and add it to the computercraft1.XX.jar in jar/assets/computercraft/autorun as there is no way to bypass that fileconfigured =true
if there is a disk drive attatched to it, it will run the startup program on the disk, NOT the computer.There is no need to put it in autorun, just name the file "startup".
How does it make it pointless? Just change a few things and you're set
-- computer password protection with built-in password setup
local pullEvent = os.pullEvent -- stops people from using ctrl + t
os.pullEvent = os.pullEventRaw -- ..
local loop = true
local Tries = 3 -- after this amount of tries the computer shuts down
while loop do -- loop :)/>/>/>
term.clear()
term.setCursorPos(1,1)
if fs.exists("Password") then -- check if there is a password set already
file = io.open("Password", "r")
Password == file:read() -- get actual password
textutils.slowPrint("Enter password: ")
local Input = read("*")
if Input == Password then -- compare actual password to user input
textutils.slowPrint("Password correct.")
loop = false
os.pullEvent = pullEvent -- you can use ctrl + t if it crashed here
else -- password wrong
Tries = (Tries - 1) -- minus 1 try
textutils.slowPrint("Password incorrect.")
textutils.slowPrint("Tries left: ")
textutils.slowPrint(Tries)
if Tries == 0 then
sleep(2)
os.shutdown() -- reboot if tries = 0
end
end
else -- no password yet
textutils.slowPrint("Please choose a password:")
PasswordFile = read("*") -- type password
textutils.slowPrint("Password chosen: "..Passwordfile)
print("Do you want this password?") -- confirm
PasswordOK = read()
if PasswordOK == "Yes" then
file = io.open("Password", "w")
file:write(PasswordFile) -- store password
file:close()
end
end
end