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

Computer Lock 1.1 (PROTECT YOUR COMPUTER!)

Started by djblocksaway, 31 March 2012 - 02:56 AM
djblocksaway #1
Posted 31 March 2012 - 04:56 AM
Term Lock 1.1

This is a simple terminal locking program with Termination Blocking so no easy bypassing and it even has an install disk so you can put it on computers easier this program also works on turtles
Default Password for the term lock is 123

Install Disk
—————————-
Put this code to a floppy disk and name the file startup


--Made By Djblocksaway
--TermLock 1.1


while true do
term.clear()
term.setCursorPos(1,1)
print "Press Enter To Install Term Lock 1.1"
aba = read()
term.clear()
term.setCursorPos(1,1)
disk.setLabel("left","Term Lock Installer!")
disk.setLabel("right","Term Lock Installer!")
disk.setLabel("top","Term Lock Installer!")
disk.setLabel("bottom","Term Lock Installer!")
disk.setLabel("back","Term Lock Installer!")
disk.setLabel("front","Term Lock Installer!")
print "Welcome to Term Lock 1.1 Installer!"
sleep(2)
print " "
print "Installing!"
sleep(1)
print " "
if fs.exists("startup") then
term.clear()
term.setCursorPos(1,1)
print "File Already Exists!"
print " "
print "Ejecting Disk!"
disk.eject("top")
disk.eject("bottom")
disk.eject("back")
disk.eject("front")
disk.eject("left")
disk.eject("right")
sleep(3)
os.shutdown()
end
fs.copy("disk/termlock","startup")
print "Copying File disk/termlock"
sleep(2)
print " "
print "Thanks For Useing Term Lock Installer!"
print " "
print "Default Pass is 123"
print "Use (edit startup) To Change It!"
disk.eject("top")
disk.eject("back")
disk.eject("left")
disk.eject("front")
disk.eject("right")
disk.eject("bottom")
sleep(3)
os.shutdown()
end

Put this code on the same floppy disk and call the file termlock

function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
end
return event, p1, p2, p3, p4, p5
end
term.clear()
term.setCursorPos(1,1)
print "Term Lock 1.1"
print " "
write ("Password: ")
--Pass Can Be Changed Here
correctpass = "123"
pass = read("*")
if pass == (correctpass) then
term.clear()
term.setCursorPos(1,1)
write("Correct!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
print "Welcome!"
term.setCursorPos(1,3)
rs.setOutput("left", true)
rs.setOutput("right",true)
rs.setOutput("back",true)
rs.setOutput("bottom",true)
rs.setOutput("top",true)
rs.setOutput("front",true)
sleep(4)
rs.setOutput("left", false)
rs.setOutput("back",false)
rs.setOutput("top",false)
rs.setOutput("right",false)
rs.setOutput("bottom",false)
rs.setOutput("front",false)
else
print " "
write("Incorrect! Rebooting!")
sleep(2)
os.reboot()
end
—————————



—————————
Direct Way
—————————
Put this code on a computer and call the file startup


--Made By Djblocksaway
--Term Lock Version 1.1

function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
end
return event, p1, p2, p3, p4, p5
end

term.clear()
term.setCursorPos(1,1)
print "Term Lock 1.1"
print " "
write ("Password: ")
--Pass Can Be Changed Here
correctpass = "123"
pass = read("*")

if pass == (correctpass) then
term.clear()
term.setCursorPos(1,1)
write("Correct!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
print "Welcome!"
term.setCursorPos(1,3)
rs.setOutput("left", true)
rs.setOutput("right",true)
rs.setOutput("back",true)
rs.setOutput("bottom",true)
rs.setOutput("top",true)
rs.setOutput("front",true)
sleep(4)
rs.setOutput("left", false)
rs.setOutput("back",false)
rs.setOutput("top",false)
rs.setOutput("right",false)
rs.setOutput("bottom",false)
rs.setOutput("front",false)

else
print " "
write("Incorrect! Rebooting!")
sleep(2)
os.reboot()
end
cant_delete_account #2
Posted 31 March 2012 - 06:11 AM
This is very simple…
djblocksaway #3
Posted 31 March 2012 - 06:48 AM
it wasnt ment to be advanced xD
sabian8 #4
Posted 31 March 2012 - 01:47 PM
Nice!, love your server by the way.

just tested doesn't work. i changed it so the startup on the disk had the word end on the end,it worked.
but then when it had finished the startup on the computer didn't work so i added the word end again and now every time i reboot it gets stuck in a loop of the words "press enter to install term lock" then the password screen over and over again.
Edited on 31 March 2012 - 12:37 PM
djblocksaway #5
Posted 31 March 2012 - 02:25 PM
Thanks :o/>/>
djblocksaway #6
Posted 03 April 2012 - 09:17 AM
hm ill fix the code but you must have the startup's mixed up like you put the startup as the termlock file so it copied the startup file instead of the actual lock :)/>/> thanks for telling me about the end thing
djblocksaway #7
Posted 03 April 2012 - 09:19 AM
FIXED! :)/>/>
sabian8 #8
Posted 03 April 2012 - 10:46 AM
Great! I will get this as soon as I get home.
djblocksaway #9
Posted 03 April 2012 - 02:29 PM
aha cool and i love your spoler :)/>/>
sabian8 #10
Posted 03 April 2012 - 04:31 PM
aha cool and i love your spoler :)/>/>

Thanks! :D/>/>
sabian8 #11
Posted 03 April 2012 - 04:44 PM
Unless I am just a complete idiot (which is probably true) it is still doing the same thing, i tried switching the names of the files so it's not that. i don't think i am doing anything wrong.
djblocksaway #12
Posted 04 April 2012 - 03:05 PM
ok im updateing the code completely so first put the installer code on a floppy and call this file startup

than get termlock code and put this file on a disk and call file name termlock

than reboot and install :)/>/>
djblocksaway #13
Posted 04 April 2012 - 03:07 PM
i will update code tomorrow when i have time :)/>/>
djblocksaway #14
Posted 06 April 2012 - 12:43 PM
Still need to update the code (will try do when i get back from my shack :)/>/> )
djblocksaway #15
Posted 10 June 2012 - 05:05 AM
Code Is Fixed :)/>/>
Custom Boot Maker #16
Posted 10 June 2012 - 12:14 PM
Term Lock 1.1

This is a simple terminal locking program with Termination Blocking so no easy bypassing and it even has an install disk so you can put it on computers easier this program also works on turtles
Default Password for the term lock is 123

Install Disk
—————————-
Put this code to a floppy disk and name the file startup


--Made By Djblocksaway
--TermLock 1.1


while true do
term.clear()
term.setCursorPos(1,1)
print "Press Enter To Install Term Lock 1.1"
aba = read()
term.clear()
term.setCursorPos(1,1)
disk.setLabel("left","Term Lock Installer!")
disk.setLabel("right","Term Lock Installer!")
disk.setLabel("top","Term Lock Installer!")
disk.setLabel("bottom","Term Lock Installer!")
disk.setLabel("back","Term Lock Installer!")
disk.setLabel("front","Term Lock Installer!")
print "Welcome to Term Lock 1.1 Installer!"
sleep(2)
print " "
print "Installing!"
sleep(1)
print " "
if fs.exists("startup") then
term.clear()
term.setCursorPos(1,1)
print "File Already Exists!"
print " "
print "Ejecting Disk!"
disk.eject("top")
disk.eject("bottom")
disk.eject("back")
disk.eject("front")
disk.eject("left")
disk.eject("right")
sleep(3)
os.shutdown()
end
fs.copy("disk/termlock","startup")
print "Copying File disk/termlock"
sleep(2)
print " "
print "Thanks For Useing Term Lock Installer!"
print " "
print "Default Pass is 123"
print "Use (edit startup) To Change It!"
disk.eject("top")
disk.eject("back")
disk.eject("left")
disk.eject("front")
disk.eject("right")
disk.eject("bottom")
sleep(3)
os.shutdown()
end

Put this code on the same floppy disk and call the file termlock

function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
end
return event, p1, p2, p3, p4, p5
end
term.clear()
term.setCursorPos(1,1)
print "Term Lock 1.1"
print " "
write ("Password: ")
--Pass Can Be Changed Here
correctpass = "123"
pass = read("*")
if pass == (correctpass) then
term.clear()
term.setCursorPos(1,1)
write("Correct!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
print "Welcome!"
term.setCursorPos(1,3)
rs.setOutput("left", true)
rs.setOutput("right",true)
rs.setOutput("back",true)
rs.setOutput("bottom",true)
rs.setOutput("top",true)
rs.setOutput("front",true)
sleep(4)
rs.setOutput("left", false)
rs.setOutput("back",false)
rs.setOutput("top",false)
rs.setOutput("right",false)
rs.setOutput("bottom",false)
rs.setOutput("front",false)
else
print " "
write("Incorrect! Rebooting!")
sleep(2)
os.reboot()
end
—————————



—————————
Direct Way
—————————
Put this code on a computer and call the file startup


--Made By Djblocksaway
--Term Lock Version 1.1

function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
end
return event, p1, p2, p3, p4, p5
end

term.clear()
term.setCursorPos(1,1)
print "Term Lock 1.1"
print " "
write ("Password: ")
--Pass Can Be Changed Here
correctpass = "123"
pass = read("*")

if pass == (correctpass) then
term.clear()
term.setCursorPos(1,1)
write("Correct!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
print "Welcome!"
term.setCursorPos(1,3)
rs.setOutput("left", true)
rs.setOutput("right",true)
rs.setOutput("back",true)
rs.setOutput("bottom",true)
rs.setOutput("top",true)
rs.setOutput("front",true)
sleep(4)
rs.setOutput("left", false)
rs.setOutput("back",false)
rs.setOutput("top",false)
rs.setOutput("right",false)
rs.setOutput("bottom",false)
rs.setOutput("front",false)

else
print " "
write("Incorrect! Rebooting!")
sleep(2)
os.reboot()
end
Made a More Simple and Easy to understand and COMPACT

textutils.slowPrint("WelomePleaseLogIn")
User = UserNameHere
input = read()
if input == User then
print("UserFound")
term.clear()
term.setCursorPos(1,1)
else

print("UserNotFoundComputerShutingDown")
os.shutdown()
end
password = PassHere
print("Password")
input = read()
if input == password then
print welcome
else
print ("WrongShuttingDown")
sleep(3)
os.shutdown()


Still making un bypassble Mite Need to think
MajorKong #17
Posted 11 June 2012 - 01:57 AM
you should use pcall otherwise people can press CTR+T to terminate the program and bypass the lock


pass = "password123"
print " Restricted Terminal!nn"
sleep(1)
textutils.slowPrint ("Enter Password: ")
sleep(1)
status,imp = pcall(read,'*')

if pass == imp then
  print "Welcome!"
else
  print "ACCESS DENIED"
  sleep(1)
  os.shutdown()
end
djblocksaway #18
Posted 11 June 2012 - 02:57 PM
you should use pcall otherwise people can press CTR+T to terminate the program and bypass the lock


pass = "password123"
print " Restricted Terminal!nn"
sleep(1)
textutils.slowPrint ("Enter Password: ")
sleep(1)
status,imp = pcall(read,'*')

if pass == imp then
  print "Welcome!"
else
  print "ACCESS DENIED"
  sleep(1)
  os.shutdown()
end
if you look at the code its already got termination blocking :(/>/>
Hexicube #19
Posted 11 June 2012 - 03:29 PM
else
print " "
write("Incorrect! Rebooting!")
sleep(2)
os.reboot()
end
If I recall correctly, you can Ctrl+T out of it during that 2 second sleep…so it's not immune to a termination…
Custom Boot Maker #20
Posted 11 June 2012 - 09:55 PM
you should use pcall otherwise people can press CTR+T to terminate the program and bypass the lock


pass = "password123"
print " Restricted Terminal!nn"
sleep(1)
textutils.slowPrint ("Enter Password: ")
sleep(1)
status,imp = pcall(read,'*')

if pass == imp then
  print "Welcome!"
else
  print "ACCESS DENIED"
  sleep(1)
  os.shutdown()
end
if you look at the code its already got termination blocking :(/>/>
Yea Its Bypassble Just add a Extra Bit Cant rember right now
Bossman201 #21
Posted 12 June 2012 - 01:03 AM
You could use the parallel command to print messages like "Installing!" and "Copying file" while it's actually happening instead of "after". I say "after" because it happens so fast it's probably seems like it's at the same time to the human brain. I see you've added sleep() commands to make it seem like it's taking a while :(/>/>

Could increase advanced-ness of code :)/>/>
djblocksaway #22
Posted 12 June 2012 - 01:42 AM
you should use pcall otherwise people can press CTR+T to terminate the program and bypass the lock


pass = "password123"
print " Restricted Terminal!nn"
sleep(1)
textutils.slowPrint ("Enter Password: ")
sleep(1)
status,imp = pcall(read,'*')

if pass == imp then
  print "Welcome!"
else
  print "ACCESS DENIED"
  sleep(1)
  os.shutdown()
end
if you look at the code its already got termination blocking :(/>/>
Yea Its Bypassble Just add a Extra Bit Cant rember right now
hmm the only bypass i can see is to put a bypass disk in that changes the startup…
djblocksaway #23
Posted 12 June 2012 - 01:44 AM
You could use the parallel command to print messages like "Installing!" and "Copying file" while it's actually happening instead of "after". I say "after" because it happens so fast it's probably seems like it's at the same time to the human brain. I see you've added sleep() commands to make it seem like it's taking a while :(/>/>

Could increase advanced-ness of code :)/>/>
aha i made this ages ago when i was still learning lua i could make it more advanced but i really cant be bothered you can change it a bit it if you want i dont mind