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

Minecraft Lock v4

Started by Biopsy, 27 April 2012 - 07:45 PM
Biopsy #1
Posted 27 April 2012 - 09:45 PM
I'm sure this has been done to death, but a recent YouTube video I saw posted a god-awful door lock application and I felt the need to re-write.

Supports:
  • control+t prevention
  • optional multiple passwords
  • optional case-sensitivity
  • lockout timer
  • optional lockout timer increases after unsuccessful attempts
  • optional multi-side activation
Enjoy:
Minecraft Lock V4 Download
MysticT #2
Posted 27 April 2012 - 10:04 PM
adf.ly link? really?
I won't even check if the link is actually a CC program. If it is, you said it's a rewrite from another program, so you are just making money with others work :)/>/>
libraryaddict #3
Posted 27 April 2012 - 10:13 PM
adf.ly link? really?
I won't even check if the link is actually a CC program. If it is, you said it's a rewrite from another program, so you are just making money with others work :)/>/>

This.

Ive made quite a few locks.
Even my recent game (WIP) isnt adfly'd.
EmTeaKay #4
Posted 27 April 2012 - 10:22 PM
Here is the code:

--Settings
passwords={"PepsiMax", "PepsiMin"} --password(s) for the terminal
matchcase=true					 --require capital/lowercase letters to match?
sides={"left", "right"}		    --side(s) to activate on correct password
triggerfor=5					   --how long to activate redstone after success
lockout=2						  --lockout period after incorrect password
antiguess=true					 --increase lockout for each incorrect password?
function passprompt()
  term.clear()
  term.setCursorPos(1,1)
  term.write("Enter password: ")
  entry=read("*")
  for i=1, #passwords do
    if((entry==passwords[i]) or ((matchcase == false) and (string.lower(value) == string.lower(passwords[i])))) then
	  term.write("correct.")
	  attempts=0
	  cycledoor()
	  return true
    end
  end
  term.write("incorrect.")
  attempts=attempts+1
  if(antiguess) then
    sleep(lockout*attempts)
  else
    sleep(lockout)
  end
end
function setsides(toggle)
  for i=1, #sides do redstone.setOutput(sides[i], toggle) end
end
function cycledoor()
  setsides(true) 
  sleep(triggerfor)
  setsides(false)
end
attempts=0
os.pullEvent = os.pullEventRaw
while true do passprompt() end
Biopsy #5
Posted 27 April 2012 - 11:42 PM
when I say re-write, I took something that was like:


password="blah"
entry=os.read()
if password==entry then
  redstone.setOutput("right",true)
  sleep(5)
end
os.reboot()

and turned it into something actually useful.
If you think my code even remotely resembles that, I apologize.
Problem with adf.ly? Waiting 5 seconds to click a link is too hard?
If i spend 30 minutes making something worth using, i don't think $0.004 per click is too much to ask.
EmTeaKay #6
Posted 27 April 2012 - 11:43 PM
You're creative, why not just make something new?
Biopsy #7
Posted 27 April 2012 - 11:46 PM
Ive made quite a few locks.
Even my recent game (WIP) isnt adfly'd.

…says the one with a hosting banner ad in his/her forum sig.

You're creative, why not just make something new?

http://www.computercraft.info/forums2/index.php?/topic/1476-aware-api-v10/
libraryaddict #8
Posted 29 April 2012 - 07:55 PM
Ive made quite a few locks.
Even my recent game (WIP) isnt adfly'd.

…says the one with a hosting banner ad in his/her forum sig.

Now I take offense.
You can either ignore that banner or ignore with ad-block.
Then again, I'm not making it compulsory to click it.
However.. If I adf.ly'd that banner's link >.>

But you made me realize something interesting. Link my programs in my SIG :)/>/>
Only thing is. I'd have to lose the banner..

On the other hand. I am quitting the server they run..
They are dumping CC >.>

No one dumps CC because "RP Computers are better"! No one!
Biopsy #9
Posted 30 April 2012 - 06:50 PM
Ive made quite a few locks.
Even my recent game (WIP) isnt adfly'd.

…says the one with a hosting banner ad in his/her forum sig.

Now I take offense.
You can either ignore that banner or ignore with ad-block.
Then again, I'm not making it compulsory to click it.
However.. If I adf.ly'd that banner's link >.>

But you made me realize something interesting. Link my programs in my SIG :)/>/>
Only thing is. I'd have to lose the banner..

On the other hand. I am quitting the server they run..
They are dumping CC >.>

No one dumps CC because "RP Computers are better"! No one!

eh, I don't really mean offense.
It's just a little silly that you think it's so ridiculous. I took the time to write something, I provide it for free to anyone that wants to use it - all I ask is that they click through a 5 second wait. People are so lazy these days. All these arguments are silly too. If you can write this or better, you don't need it and have no reason to complain.

Also, I run AdBlock - it doesn't happen to block that one :-)
MathManiac #10
Posted 18 May 2012 - 03:47 PM
-snip-

No one dumps CC because "RP Computers are better"! No one!

Hmm? Roleplay computers can be made in CC.
MysticT #11
Posted 18 May 2012 - 07:48 PM
-snip-

No one dumps CC because "RP Computers are better"! No one!

Hmm? Roleplay computers can be made in CC.
RP means RedPower, the eloraam's mod, wich has computers now. They are different from CC computers, harder to program but with some nice features.