Spoiler
Protection for your computer (login)user = "INSERT USERNAME HERE"
pass = "INSERT PASSWORD HERE"
write "Username: "
input = read()
if user == input then
else
print "Error: User not found"
sleep(1,5)
os.reboot()
end
write "Password: "
input = read("*")
if pass == input then
print "Logging on"
sleep(1)
print "Starting CraftOS"
sleep(3,5)
print "Ready"
else
print "Wrong password"
sleep(1,5)
os.shutdown()
end
A door lock for your doors
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 = "123"
pass = read("*")
if pass == (correctpass) then
print " "
write("Correct! You may enter!")user
redstone.setOutput("left", true)
sleep(4)
redstone.setOutput("left", false)
os.reboot()
else
print " "
write("Incorrect! Rebooting!")
sleep(2)
os.reboot()
end
AN ADVANCED DOOR LOCK WHERE YOU HAVE TO LOG IN AND THEN ENTER YOUR DOORS PASSWORD
Save as "startup" to one of your computers (type id to find out the computer number) eg. save/computer/1 (sorry for the bad example)
–Define Program Information
–Text Symbols
usersymbol = "X"
passsymbol = "*"
–Passwords
pass1 = "ENTER PASSWORD HERE"
– Usernames
user1 = "ENTER USERNAME HERE"
–TERMINATE
TerminalMode = 0 – Allows you to edit what terminate does
function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
if TerminalMode == 0 then
end
if TerminalMode == 1 then
os.reboot()
end
if TerminalMode == 2 then
error( "Terminated" )
end
end
return event, p1, p2, p3, p4, p5
end
–Program
shell.run("clear")
textutils.slowPrint"Please input Username"
xuser = read(usersymbol)
if xuser == user1 then
textutils.slowPrint"Username Valid"
sleep(1)
shell.run("clear")
else
textutils.slowPrint"Access Denied"
sleep(2)
shell.run("startup")
end
textutils.slowPrint"Please enter Password"
xpassword = read(passsymbol)
if xpassword == pass1 then
textutils.slowPrint"Password Accepted"
sleep(1)
shell.run("clear")
shell.run("doorlock")
else
textutils.slowPrint"Access Denied"
sleep(2)
shell.run("startup")
end
Save as "doorlock" and put in C:Users"name"AppDataRoaming.minecraftmodsComputerCraftluaromprograms
–Define Program Information
–Redstone Output
side = "left"
–Text Symbols
passsymbol = "*"
–Passwords
doorpw = "ENTER PASSWORD HERE"
–TERMINATE
TerminalMode = 0 – Allows you to edit what terminate does
function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
if TerminalMode == 0 then
end
if TerminalMode == 1 then
os.reboot()
end
if TerminalMode == 2 then
error( "Terminated" )
end
end
return event, p1, p2, p3, p4, p5
end
textutils.slowPrint"Please Enter Door Password"
xpassword = read(passsymbol)
if xpassword == doorpw then
textutils.slowPrint"Password Accepted, Opening Door"
rs.setOutput(side, true)
sleep(5)
rs.setOutput(side, false)
sleep(1)
else
textutils.slowPrint"Access Denied"
sleep(2)
shell.run("clear")
shell.run("doorlock")
end
shell.run("startup.lua")
Enjoy ;)/>/>
im a ninja :(/>/>
edit: forgot the door lock that opens doors in heaps more directions all at once :o/>/>
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 3000"
print " "
write ("Password: ")
correctpass = "ENTER PASSWORD HERE"
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
Bombing Run (turtle program)
thanks to Dirkus7 for telling me the program :)/>/>
Rs.setOutput("front", true) –activates redstone
While true do – start infinite loop, you can change it to a finite loop
Turtle.place() –places a block, in your case tnt, tnt automaticly activated by redstone :D/>/>
Turtle.forward() – go forward
End – end infinite loop