This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
CazadoraMala's profile picture

Help with bundled wires program

Started by CazadoraMala, 17 January 2013 - 01:07 AM
CazadoraMala #1
Posted 17 January 2013 - 02:07 AM
Well, I have been trying to make a program to switch 2 bundled wires, but not simultaneously. I want the red one to switch for 5 seconds, then turn off automatically, and after, the same with tha blue one. I have tryied for hours, but allways tells me "bad argument: string expected, got nil".

Could someone help me?

My code:
Spoiler

while(true) do
	redstone.setBundledOutput("back", colors.red)
	sleep(5)
	redstone.setBundledOutput(Side, 0)
	redstone.setBundledOutput("back", colors.blue)
	sleep(5)
	redstone.setBundledOutput(Side, 0)
end

A friend told me it should be like that, but i dont know why it doesn't work.

And for curious people who want to know what it will be for:
SpoilerI'm trying to do a frames door, that opens and closes automatically when I enter the program's name, and this is my design for the door at the moment:

http://img94.imageshack.us/img94/7827/20130116034408.png
http://img834.imageshack.us/img834/9876/20130116034356.png
http://img96.imageshack.us/img96/4203/20130116034341.png
http://img809.imageshack.us/img809/8431/20130116034326.png

Can someone help me with my program pleas? I must first say that I am noob for this xD
Kingdaro #2
Posted 17 January 2013 - 02:16 AM
You haven't defined "Side" anywhere in your code, that and you don't need to set all outputs to 0 when switching to another color. This is probably what it should be:

while true do
        redstone.setBundledOutput("back", colors.red)
        sleep(5)
        redstone.setBundledOutput("back", colors.blue)
        sleep(5)
end
Brackets around true are not needed.
theoriginalbit #3
Posted 17 January 2013 - 02:24 AM
replace Side with "back" both times you use it… :)/>

Damn thing didn't show Kingdaro's until after I posted this… :/
Edited on 17 January 2013 - 01:25 AM
CazadoraMala #4
Posted 17 January 2013 - 02:30 AM
Thank You, it works