Posted 03 June 2013 - 10:08 PM
First of all, Im really new to computer craft so Iknow my code is going to look messy, I have some basic understand in coding but this has stumpted me.
Ive been attempting to write a code that when it detects a signal input to a Computer (So i can do it VIA wireless remotes) it will do X code, I know thhe code works for opening and closing the door on it own using the computer terminal, but when I try to do it like this, it will work 2 or 3 times, then no longer work, or not work at all, I was wondering fi anyone could help me figure it out please? :)/>/>
Thanks, MV
Code:
Ive been attempting to write a code that when it detects a signal input to a Computer (So i can do it VIA wireless remotes) it will do X code, I know thhe code works for opening and closing the door on it own using the computer terminal, but when I try to do it like this, it will work 2 or 3 times, then no longer work, or not work at all, I was wondering fi anyone could help me figure it out please? :)/>/>
Thanks, MV
Code:
print("Secret Door Console")
while true do
os.pullEvent("redstone")
if rs.getInput("left") then
break
end
end
rs.setBundledOutput("back",colours.purple)
sleep(0.5)
rs.setBundledOutput("back",0)
sleep(0.5)
rs.setBundledOutput("back",colours.purple)
sleep(0.5)
rs.setBundledOutput("back",0)
sleep(0.5)
rs.setBundledOutput("back",colours.purple)
sleep(0.5)
rs.setBundledOutput("back",0)
sleep(0.5)
rs.setBundledOutput("back",colours.red)
sleep(0.5)
rs.setBundledOutput("back",0)
while true do
os.pullEvent("redstone")
if rs.getInput("right") then
break
end
end
rs.setBundledOutput("back",colours.pink)
sleep(0.5)
rs.setBundledOutput("back",0)
sleep(0.5)
rs.setBundledOutput("back",colours.white)
sleep(0.5)
rs.setBundledOutput("back",0)
sleep(0.5)
rs.setBundledOutput("back",colours.white)
sleep(0.5)
rs.setBundledOutput("back",0)
sleep(0.5)
rs.setBundledOutput("back",colours.white)
sleep(0.5)
rs.setBundledOutput("back",0)