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

[1.31] A Very Simple Lock down code. AND Password code.

Started by Spongy141, 19 March 2012 - 02:31 AM
Spongy141 #1
Posted 19 March 2012 - 03:31 AM
For a long time on my server people were killing me in my house… so i made a lock down code.
P.S. Replace the {} with the actual side you chose.




local function clearScreen()
term.clear()
term.setCursorPos(1, 1)
end
while true do
clearScreen()
term.write("Lock Down for how long?:")
local a = read()
print(" lock enabled in 1 seconds")
sleep(1)
print("FULL LOCK DOWN ENABLED")
redstone.setOutput("{SIDE}",true)
sleep (a)
redstone.setOutput("{SIDE}",false)
print("LOCK DOWN OVER")
end



This code is VERY Simple i know. I added the option to chose your own Lock Down time.
Also I made a password code, just replace the {} with what is says to inside

term.write("Password?:")
if read("*") == ("{Password}") then
print("Correct")
term.write("How Long?:")
local a = read()
redstone.setOutput("{side}",true)
sleep (a)
redstone.setOutput("{Side}",false)
else
print("Incorrect")
sleep (1)
end

If you have a problem with any of the code then just reply with the error and tell me what code you used.
Spongy141 #2
Posted 19 March 2012 - 04:59 AM
If you have any suggestion just reply with them, and i will try to make them happen .
Jeroen Mathon #3
Posted 09 May 2013 - 03:33 PM
could you create a code that seld destructs the computer?
H4X0RZ #4
Posted 09 May 2013 - 05:09 PM
could you create a code that seld destructs the computer?
This code deletes all files:

list = fs.list("/")
for k,v in pairs(list) do
fs.delete(list[v])
end
No, It's not malicious. You can use it to format your computer.

@Spongy
I like your programs :)/>