Posted 31 October 2012 - 01:45 PM
Hello!
I have a problem with a program:
A friend and I built an elevator with 5 storeys.
We're using "Redpower" mod for wiring.
The program is calling "elevator".
On the left side of a computer are 10 receivers and we'll like to code a program with an endless queue in it.
If the first wire (white) is activated some stuff shall happen.
If the second wire(orange) ist activated some other stuff shall happen.
… and so on.
We tried it with the following code:
When for example, the first wire is activated the stuff after the codeline
After that the big queue shall be going on until there is another redstone input.
The problem:
After starting the program there is an error:
Another time it is:
Hope you'll understand and can give me suggestions why this happens"
Greetz from Germany!
I have a problem with a program:
A friend and I built an elevator with 5 storeys.
We're using "Redpower" mod for wiring.
The program is calling "elevator".
On the left side of a computer are 10 receivers and we'll like to code a program with an endless queue in it.
If the first wire (white) is activated some stuff shall happen.
If the second wire(orange) ist activated some other stuff shall happen.
… and so on.
We tried it with the following code:
-- 1 is ID of the first (white) wire
-- 2 is ID of the second (orange) wire
-- wire IDs going on with binary structure (1, 2, 4, 8, 16, 32, 64,128, 256, 512)
shell.run("clear")
print("Welcome to the ElevatorControl!")
while true do
if rs.getBundledInput("left") == "1" then
--some stuff
elseif rs.getBundledInput("left") == "2" then
--some more stuff
elseif rs.getBundledInput("left") == "4" then
--some more stuff
elseif rs.getBundledInput("left") == "8" then
--some more stuff
elseif rs.getBundledInput("left") == "16" then
--some more stuff
elseif rs.getBundledInput("left") == "32" then
--some more stuff
elseif rs.getBundledInput("left") == "64" then
--some more stuff
elseif rs.getBundledInput("left") == "128" then
--some more stuff
elseif rs.getBundledInput("left") == "256" then
--some more stuff
elseif rs.getBundledInput("left") == "512" then
--some more stuff
end
end
When for example, the first wire is activated the stuff after the codeline
if rs.getBundledIput("left") == "1"
shall be run.After that the big queue shall be going on until there is another redstone input.
The problem:
After starting the program there is an error:
elevator:6: Too long without yielding
Another time it is:
elevator:9: Too long without yielding
Hope you'll understand and can give me suggestions why this happens"
Greetz from Germany!