74 posts
Location
Australia
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 :)/>/>
378 posts
Location
In 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
715 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 on 24 March 2012 - 07:12 PM
259 posts
Location
Australia
Posted 11 April 2012 - 10: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.computercraft.info/forums2/index.php?/topic/987-easy-lock-11/compare the codes and you will see that he has taken my code :)/>/>
1604 posts
Posted 11 April 2012 - 06:01 PM
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?
474 posts
Posted 11 April 2012 - 06:41 PM
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.
31 posts
Posted 11 April 2012 - 08:03 PM
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…
1604 posts
Posted 11 April 2012 - 08:06 PM
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.
474 posts
Posted 11 April 2012 - 08:26 PM
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.
259 posts
Location
Australia
Posted 12 April 2012 - 12:47 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 :)/>/>
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.proboards.com/index.cgi?board=programsboard&action=display&thread=178This was posted on the 18th of march