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

ctrl+t protection in my code

Started by PawniX, 07 September 2012 - 08:13 PM
PawniX #1
Posted 07 September 2012 - 10:13 PM
hi hello,

i have a little question in currently playing on a big tekkit server
and have made a massive house
with a nice password protected forcefield door
but some guys ctrl+t'ed my computer edited the startup code and raped my house :D/>/>
is there a way 2 make it like u cant use CTRL+T ??
here is the startup code

sPass = "randompasswordorsomething:P"
DebugPass = "hahgay"
print(" ")
textutils.slowPrint("			   Welcome to THE HUNTERS				   ")
print("					Faction Base						")
print(" ")
sleep(1)
io.write("Password For Locked Door: ")
sInput = read("*")
  if sPass == sInput then
		print("Password Accepted!")
		redstone.setOutput("back", true)
		sleep(10)
		redstone.setOutput("back", false)
os.shutdown()
  elseif sInput == DebugPass then
print ("Debug mode activate!")
else	redstone.setOutput("left", true)
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
	 print("WRONG PASSWORD! ALARM ACTIVATED!")
sleep(15)
redstone.setOutput("left", false)
os.shutdown()
end
can some1 tell me how 2 make it CTRL+T protected
Cranium #2
Posted 07 September 2012 - 10:19 PM
This has been posted in the tutorials section SO many times, and has been posted here in the Ask a Pro section even more. For future reference, there is a search function in the upper-right of the site.
You can CTRL+T protect your computer by adding os.pullEvent = os.pullEventRaw at the top of your code. Keep in mind that this will not prevent someone from attaching a disk drive next to your computer with a startup file in it. For that, you are kinda on your own.