Super Lock 2000 (like a door lock but opens every direction)
#1
Posted 22 March 2012 - 10:45 PM
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
Posted 24 March 2012 - 06:15 PM
Just press the <> symbol in the editing line and post your code in there
#3
Posted 24 March 2012 - 08:10 PM
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 = oldPullEventTested 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
Posted 11 April 2012 - 09:57 AM
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd />
-----------------
Stealing Codes Is Wrong />
----------------
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
Posted 11 April 2012 - 05:01 PM
djblocksaway, on 11 April 2012 - 09:57 AM, said:
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd />
-----------------
Stealing Codes Is Wrong />
----------------
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 />
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
Posted 11 April 2012 - 05:41 PM
MysticT, on 11 April 2012 - 05:01 PM, said:
djblocksaway, on 11 April 2012 - 09:57 AM, said:
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd />
-----------------
Stealing Codes Is Wrong />
----------------
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 />
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?
#7
Posted 11 April 2012 - 07:03 PM
thesbros, on 11 April 2012 - 05:41 PM, said:
MysticT, on 11 April 2012 - 05:01 PM, said:
djblocksaway, on 11 April 2012 - 09:57 AM, said:
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd />
-----------------
Stealing Codes Is Wrong />
----------------
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 />
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?
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
Posted 11 April 2012 - 07:06 PM
virtualayu, on 11 April 2012 - 07:03 PM, said:
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...
#9
Posted 11 April 2012 - 07:26 PM
virtualayu, on 11 April 2012 - 07:03 PM, said:
thesbros, on 11 April 2012 - 05:41 PM, said:
MysticT, on 11 April 2012 - 05:01 PM, said:
djblocksaway, on 11 April 2012 - 09:57 AM, said:
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd />
-----------------
Stealing Codes Is Wrong />
----------------
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 />
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?
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...
#10
Posted 11 April 2012 - 11:47 PM
thesbros, on 11 April 2012 - 07:26 PM, said:
virtualayu, on 11 April 2012 - 07:03 PM, said:
thesbros, on 11 April 2012 - 05:41 PM, said:
MysticT, on 11 April 2012 - 05:01 PM, said:
djblocksaway, on 11 April 2012 - 09:57 AM, said:
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd />
-----------------
Stealing Codes Is Wrong />
----------------
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 />
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?
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...
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