Minecraft Big Dig Pack Wiki
Advertisement


Just a slight warning before showing this tutorial: Unless you have at least somewhat of an understanding of Lua or Computer Craft do not try to edit this program. :)

Lets get started.

Program Code[]

The first thing you will need to know is how to make the program non-terminable(non-exitable).

os.pullEvent = os.pullEventRaw



Now you will need the coding for the actual locking and redstone mechanism. This version of the program is for use with a Computer.

--Password
pass = "EnterPasswordHere"

--Making the screen empty
term.clear()
term.setCursorPos(1,1)
--These commands clear the screen.

-- Censored Password Lock
-- Written by R33ngin33red
-- Posted to The TekkitLite Wiki on 5/11/2013


--Lock and Redstone Mechanism

print("Arming Security Systems...")
print("Booting Lock Mechanism...")
sleep(2)
print("Systems Armed.")
print("Please enter assigned password.")

input = read("*")
if input == pass then
  print("Validating password.")
  sleep(1)
  print("Password sucessfully validated.")
  print("Disengaging Lock mechanism...")
  redstone.setOutput("SIDE", true)
  sleep(2)
  redstone.setOutput("SIDE", false)
else
  print("Validating Password...")
  sleep(1)
  print("LEVEL 1 SECURITY BREACH ATTEMPT!)
  print("Activating Emergency Shutdown Procedures.")
  sleep(2)
end
os.reboot()



















Program Code w/ Colors[]

This version of the program is for use with an Advanced Computer.

os.pullEvent = os.pullEventRaw




--Password
pass = "EnterPasswordHere"

--Making the screen empty
term.clear()
term.setCursorPos(1,1)
--These commands clear the screen.

-- Censored Password Lock
-- Written by R33ngin33red
-- Posted to The TekkitLite Wiki on 5/11/2013


--Lock and Redstone Mechanism

term.setTextColor(colors.COLOR)
term.setBackgroundColor(colors.COLOR)
--Replace the COLOR with the color of you choice. For the available colors see the colors section below.
print("Arming Security Systems...")
print("Booting Lock Mechanism...")
sleep(2)
print("Systems Armed.")
print("Please enter assigned password.")

input = read("*")
if input == pass then
  print("Validating password.")
  sleep(1)
  print("Password sucessfully validated.")
  print("Disengaging Lock mechanism...")
  redstone.setOutput("SIDE", true)
  sleep(2)
  redstone.setOutput("SIDE", false)
else
  print("Validating Password...")
  sleep(1)
  print("LEVEL 1 SECURITY BREACH ATTEMPT!)
  print("Activating Emergency Shutdown Procedures.")
  sleep(2)
end
os.reboot()

Automation[]

If you wish to automate this program to run on startup then follow the tutorial below.

I

I

I

i

V

Colors[]

For a list of available text and background colors please see the Lamp page.

Advertisement