Jump to content




Super Lock 2000 (like a door lock but opens every direction)


9 replies to this topic

#1 hamish1001

  • New Members
  • 75 posts
  • LocationAustralia

Posted 22 March 2012 - 10:45 PM

The code :)/>

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 "Super Lock 2000"
print " "
write ("Password: ")

correctpass = "password"
pass = read("*")

if pass == (correctpass) then
print " "
write("Correct! You may enter!")
redstone.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)
redstone.setOutput("left", false)
rs.setOutput("back",false)
rs.setOutput("top",false)
rs.setOutput("right",false)
rs.setOutput("bottom",false)
rs.setOutput("front",false)
os.reboot()

else
print " "
write("Incorrect! Rebooting!")
sleep(2)
os.reboot()
end




great door lock that opens doors and powers redstone in every direction (left, back, top, right, bottom, front)
:(/>
ENJOY :)/>

#2 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 24 March 2012 - 06:15 PM

You should put it into a code thing
Just press the <> symbol in the editing line and post your code in there

#3 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 24 March 2012 - 08:10 PM

Hey hamish101,

I was tweaking your code a little bit and commented some stuff.
I hope you don't mind, just trying to contribute. :)/>
local oldPullEvent = os.pullEvent  -- Backup original os.pullEvent
os.pullEvent = os.pullEventRaw  -- Overwrite os.pullEvent with os.pullEventRaw

term.clear()
term.setCursorPos(1,1)
print "Super Lock 2000n"  -- n within a string creates a line break.
write ("Password: ")

local correctpass = "password"
local pass = read("*")

if pass == (correctpass) then
  write("nCorrect! You may enter!")
  -- Iterate over all redstone sides and turn each side on.
  for _, side in pairs( rs.getSides() ) do
	rs.setOutput( side, true )
  end
  sleep(4)
  -- Turning all sides off again is not explicitly needed because we are going to reboot, which shuts off all sides anyway.
  -- If we were not rebooting, then we would simply repeat the for-code above and set the outputs to 'false' instead- :)/>/>
  os.reboot()
else
  write("nIncorrect! Rebooting!")
  sleep(2)
  os.reboot()
end

-- Restore os.pullEvent to its original code
-- Technically this is not needed because the program never ends but reboots in all cases.
-- But if we would not reboot in all cases and have the program just end in one case, then we would
-- better make sure to restore os.pullEvent, so that other programs can be terminated for this computer session if need be.
os.pullEvent = oldPullEvent

Tested the code ingame, so it should work.

EDIT: I always forget that the stupid apostrophes in the comments break the color-coding. Fixed by not using contractions. :(/>

Edited by Espen, 24 March 2012 - 08:12 PM.


#4 djblocksaway

    Epic Coderz

  • New Members
  • 397 posts
  • LocationAustralia

Posted 11 April 2012 - 09:57 AM

Hamish is a code stealer this door lock was made by me
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd :P/>
-----------------
Stealing Codes Is Wrong :D/>
----------------
The Original Post (By me)
http://www.computerc...7-easy-lock-11/


compare the codes and you will see that he has taken my code :)/>

#5 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 11 April 2012 - 05:01 PM

View Postdjblocksaway, on 11 April 2012 - 09:57 AM, said:

Hamish is a code stealer this door lock was made by me
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd :P/>
-----------------
Stealing Codes Is Wrong :D/>
----------------
The Original Post (By me)
http://www.computerc...7-easy-lock-11/


compare the codes and you will see that he has taken my code :)/>
Wow, looks like hamish can travel through time XD
Your post was made on 30 March 2012 - 10:58 AM
And hamish's was made on 22 March 2012 - 07:45 PM
So, how could he steal your code if it wasn't posted yet?

#6 cant_delete_account

  • Members
  • 484 posts

Posted 11 April 2012 - 05:41 PM

View PostMysticT, on 11 April 2012 - 05:01 PM, said:

View Postdjblocksaway, on 11 April 2012 - 09:57 AM, said:

Hamish is a code stealer this door lock was made by me
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd :P/>
-----------------
Stealing Codes Is Wrong :D/>
----------------
The Original Post (By me)
http://www.computerc...7-easy-lock-11/


compare the codes and you will see that he has taken my code :)/>
Wow, looks like hamish can travel through time XD
Your post was made on 30 March 2012 - 10:58 AM
And hamish's was made on 22 March 2012 - 07:45 PM
So, how could he steal your code if it wasn't posted yet?
So, djblocksaway, you could be stealing hamish's code.

#7 virtualayu

  • New Members
  • 31 posts

Posted 11 April 2012 - 07:03 PM

View Postthesbros, on 11 April 2012 - 05:41 PM, said:

View PostMysticT, on 11 April 2012 - 05:01 PM, said:

View Postdjblocksaway, on 11 April 2012 - 09:57 AM, said:

Hamish is a code stealer this door lock was made by me
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd :P/>
-----------------
Stealing Codes Is Wrong :D/>
----------------
The Original Post (By me)
http://www.computerc...7-easy-lock-11/


compare the codes and you will see that he has taken my code :)/>
Wow, looks like hamish can travel through time XD
Your post was made on 30 March 2012 - 10:58 AM
And hamish's was made on 22 March 2012 - 07:45 PM
So, how could he steal your code if it wasn't posted yet?
So, djblocksaway, you could be stealing hamish's code.

if you take a closer look at the pastebin of the 1.1 of djblocksaway's code, he posted it on pastebin on 21 march .... and the 1.0 on 18 march ...
so we can say that djblocksaway posted it first...
i don't know how hamish had this code but it is an exact copy of djblocksaway's code...

#8 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 11 April 2012 - 07:06 PM

View Postvirtualayu, on 11 April 2012 - 07:03 PM, said:

if you take a closer look at the pastebin of the 1.1 of djblocksaway's code, he posted it on pastebin on 21 march .... and the 1.0 on 18 march ...
so we can say that djblocksaway posted it first...
i don't know how hamish had this code but it is an exact copy of djblocksaway's code...
Yup, that's right. Maybe he shared it, or someone found it on pastebin and copied.

#9 cant_delete_account

  • Members
  • 484 posts

Posted 11 April 2012 - 07:26 PM

View Postvirtualayu, on 11 April 2012 - 07:03 PM, said:

View Postthesbros, on 11 April 2012 - 05:41 PM, said:

View PostMysticT, on 11 April 2012 - 05:01 PM, said:

View Postdjblocksaway, on 11 April 2012 - 09:57 AM, said:

Hamish is a code stealer this door lock was made by me
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd :P/>
-----------------
Stealing Codes Is Wrong :D/>
----------------
The Original Post (By me)
http://www.computerc...7-easy-lock-11/


compare the codes and you will see that he has taken my code :)/>
Wow, looks like hamish can travel through time XD
Your post was made on 30 March 2012 - 10:58 AM
And hamish's was made on 22 March 2012 - 07:45 PM
So, how could he steal your code if it wasn't posted yet?
So, djblocksaway, you could be stealing hamish's code.

if you take a closer look at the pastebin of the 1.1 of djblocksaway's code, he posted it on pastebin on 21 march .... and the 1.0 on 18 march ...
so we can say that djblocksaway posted it first...
i don't know how hamish had this code but it is an exact copy of djblocksaway's code...
Ok, I think we're on the case, djblocksaway did probably make this, but he just posted the thread on these forums later.

#10 djblocksaway

    Epic Coderz

  • New Members
  • 397 posts
  • LocationAustralia

Posted 11 April 2012 - 11:47 PM

View Postthesbros, on 11 April 2012 - 07:26 PM, said:

View Postvirtualayu, on 11 April 2012 - 07:03 PM, said:

View Postthesbros, on 11 April 2012 - 05:41 PM, said:

View PostMysticT, on 11 April 2012 - 05:01 PM, said:

View Postdjblocksaway, on 11 April 2012 - 09:57 AM, said:

Hamish is a code stealer this door lock was made by me
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd :P/>
-----------------
Stealing Codes Is Wrong :D/>
----------------
The Original Post (By me)
http://www.computerc...7-easy-lock-11/


compare the codes and you will see that he has taken my code :)/>
Wow, looks like hamish can travel through time XD
Your post was made on 30 March 2012 - 10:58 AM
And hamish's was made on 22 March 2012 - 07:45 PM
So, how could he steal your code if it wasn't posted yet?
So, djblocksaway, you could be stealing hamish's code.

if you take a closer look at the pastebin of the 1.1 of djblocksaway's code, he posted it on pastebin on 21 march .... and the 1.0 on 18 march ...
so we can say that djblocksaway posted it first...
i don't know how hamish had this code but it is an exact copy of djblocksaway's code...
Ok, I think we're on the case, djblocksaway did probably make this, but he just posted the thread on these forums later.
i also posted the code on another fourm
heres the link

http://mccraftcpl.pr...play&thread=178

This was posted on the 18th of march





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users