Posted 07 March 2012 - 02:20 PM
Hey guys!
Just want to say im so in the air over this mod hitting the tekkit package, and now starting to get the basics down, but here i get a wierd one(atleast for me ):
Code:
Code ends
Question: Why doesnt my "elseif event == "redstone" section work ? my "Key" event works flawlessly.
This code doesn't give me any errors what so ever. but it doesnt do anything either. Its like it doesnt "find" my event for the incoming redstone signal 1
Its going like this for the "input":
torch->redwire->red insulated wire->bundledcable->COMPUTER
This is a easy little program for a door code on the outside. and a button on the inside, hence the "redstone" event(button)
Edit: I've seen there was a bug with bundled before, and i renamed the redpower file with a a1-added to the name
now that i did that, i can get a other one to work, with
edit: Learning to follow rules, and making it all a bit nicer
Just want to say im so in the air over this mod hitting the tekkit package, and now starting to get the basics down, but here i get a wierd one(atleast for me ):
Code:
while true do
event = os.pullEvent()
if event == "key" then
input = read()
if input == "sesam" then
rs.setOutput("back", true)
sleep(5)
rs.setOutput("back", false)
elseif input == "stop" then
print("Stopping the computer...")
sleep(1)
os.shutdown()
end
elseif event == "redstone" then
if rs.testBundledInput("left", colours.red) then
rs.setOutput("back", true)
sleep(5)
rs.setOutput("back", false)
else
print("no input")
end
end
sleep(1)
end
Code ends
Question: Why doesnt my "elseif event == "redstone" section work ? my "Key" event works flawlessly.
This code doesn't give me any errors what so ever. but it doesnt do anything either. Its like it doesnt "find" my event for the incoming redstone signal 1
Its going like this for the "input":
torch->redwire->red insulated wire->bundledcable->COMPUTER
This is a easy little program for a door code on the outside. and a button on the inside, hence the "redstone" event(button)
Edit: I've seen there was a bug with bundled before, and i renamed the redpower file with a a1-added to the name
now that i did that, i can get a other one to work, with
if rs.testBundledInput("left", colours.blue) then
print("works")
end
edit: Learning to follow rules, and making it all a bit nicer