Posted 15 December 2012 - 10:56 AM
i have a code for my door but the redpulse doesnt work and how would i add a debug key to my code
local function getUserInput()
term.clear()
term.setCursorPos(1,1)
term.write("Password: ")
local input = read("*")
if input == "welcome" then
shell.run("redpulse","left","2",".75")
print("Enter the gates")
sleep(3)
shell.run("redpulse","right","2",".75")
elseif input == "edit" then
print ("editing")
sleep(2)
else
print("Wrong password")
sleep(5)
end
return true
end
local function getRedstoneInput()
os.pullEvent("redstone")
if rs.getInput("top") == true then
print("Opening door from redstone")
shell.run("redpulse","left","2",".75")
print ("Enter the gates")
sleep(3)
shell.run("redpulse","right","2",".75")
end
return true
end
while true do
parallel.waitForAny(getUserInput, getRedstoneInput)
end