Posted 08 May 2012 - 12:52 AM
I've been trying to get a redstone door to operate. I've got a set of code to tell the RedPower bundle to send power to the door, and that part works. However, when I try to utalize a timer, it doesn't cut the redstone supply. I'm not entirely sure how to use Timers, even though I've done some searching around.. HERE and a bit of HERE (The problem with that last one, is that it doesn't entirely apply to my situation, and I've got no idea how to fix it..)
So here's what I've come up with…
And to zoom into the point of interest,
To clarify, I'm trying to get the door open, wait 5 seconds, then close the door/cut off the redstone circuit. I'm not getting any errors, so I'm not sure where to go from here… any help would be GREATLY appreciated! Thanks! :)/>/>
So here's what I've come up with…
term.clear()
term.getCursorPos(1,1)
print ("Welcome to the Redstone Program!\n")
print ("How may I help you?")
print ("O-----oOo-----O")
print ("~1 Open Door")
print ("~2 Feed Me!")
print ("~3 Gimme some water!")
print ("~4 Some Iron please?")
print ("~5 Turn on lights")
print ("~6 Turn off lights")
print ("O-----oOo-----O")
write ("-")
choice = io.read()
if choice == "1" then
print ("You have choosen for me to open the door!")
print ("Remeber, you only have 5 seconds!")
print ("")
rs.setBundledOutput("front", colors.white)
event, param1 = os.pullEvent()
if event == "timer" and param1 == 5 then
rs.setBundledOutput("front",
rs.getBundledOutput("front") - colors.white)
end
end
And to zoom into the point of interest,
if choice == "1" then
print ("You have choosen for me to open the door!")
print ("Remeber, you only have 5 seconds!")
print ("")
rs.setBundledOutput("front", colors.white)
event, param1 = os.pullEvent()
if event == "timer" and param1 == 5 then
rs.setBundledOutput("front",
rs.getBundledOutput("front") - colors.white)
end
end
To clarify, I'm trying to get the door open, wait 5 seconds, then close the door/cut off the redstone circuit. I'm not getting any errors, so I'm not sure where to go from here… any help would be GREATLY appreciated! Thanks! :)/>/>