Posted 14 April 2013 - 11:25 AM
Okay so me and my friend have been trying to make a program to determine which floor the frame elevator is at and how long it needs to go up to arrive at the players floor
using bundled wire i assigned colors to the floor and the buttons to make it work and converted redstone pipe into signals using wireless redstone to pick up the floor number
However we get random errors on line 35 about a nill value or something tho its all the same and shouldnt be happening please help im not sure how to get this working correctly
using bundled wire i assigned colors to the floor and the buttons to make it work and converted redstone pipe into signals using wireless redstone to pick up the floor number
while true do
os.pullEvent()
redstone.setBundledOutput("bottom", 0)
term.clear()
term.setCursorPos(1,1)
print("------------------------------------------------------")
term.setCursorPos(14,2)
print("Elevator Receiver")
term.setCursorPos(1,3)
print("--------------------------------------------------------")
print("")
sleep(3)
if rs.testBundledInput("right", colors.lime) and rs.testBundledInput("left", colors.white) then
sleep(4)
redstone.setBundledOutput("back", colors.white)
sleep(23)
redstone.setBundledOutput("back", 0)
sleep(3)
elseif rs.testBundledInput("right", colors.pink) and rs.testBundledInput("left", color.white) then
sleep(4)
redstone.setBundledOutput("back", colors.white)
sleep(18)
redstone.setBundledOutput("back", 0)
sleep(3)
elseif rs.testBundledInput("right", 128) and rs.testBundledInput("left", color.white) then
sleep(4)
redstone.setBundledOutput("back", colors.white)
sleep(14)
redstone.setBundledOutput("back", 0)
sleep(3)
elseif rs.testBundledInput("right", colors.cyan) and rs.testBundledInput("left", color.white) then
sleep(4)
redstone.setBundledOutput("back", colors.white)
sleep(10)
redstone.setBundledOutput("back", 0)
sleep(3)
//2nd floor up
elseif rs.testBundledInput("right", colors.lime) and rs.testBundledInput("left", colors.orange) then
sleep(4)
redstone.setBundledOutput("back", colors.white)
sleep(14)
redstone.setBundledOutput("back", 0)
sleep(3)
elseif rs.testBundledInput("right", colors.pink) and rs.testBundledInput("left", color.orange) then
sleep(4)
redstone.setBundledOutput("back", colors.white)
sleep(9)
redstone.setBundledOutput("back", 0)
sleep(3)
elseif rs.testBundledInput("right", 128) and rs.testBundledInput("left", color.orange) then
sleep(4)
redstone.setBundledOutput("back", colors.white)
sleep(14)
redstone.setBundledOutput("back", 0)
//3rd floor up
elseif rs.testBundledInput("right", colors.pink) and rs.testBundledInput("left", color.orange) then
sleep(4)
redstone.setBundledOutput("back", colors.white)
sleep(9)
redstone.setBundledOutput("back", 0)
sleep(3)
elseif rs.testBundledInput("right", 128) and rs.testBundledInput("left", color.orange) then
sleep(4)
redstone.setBundledOutput("back", colors.white)
sleep(14)
redstone.setBundledOutput("back", 0)
//1st floor down
elseif rs.testBundledInput("right", colors.lime) and rs.testBundledInput("left", color.white) then
sleep(4)
redstone.setBundledOutput("back", colors.orange)
sleep(9)
redstone.setBundledOutput("back", 0)
elseif rs.testBundledInput("right", colors.cyan) and rs.testBundledInput("left", color.white) then
sleep(4)
redstone.setBundledOutput("back", colors.orange)
sleep(9)
redstone.setBundledOutput("back", 0)
elseif rs.testBundledInput("right", 128) and rs.testBundledInput("left", color.white) then
sleep(4)
redstone.setBundledOutput("back", colors.orange)
sleep(9)
redstone.setBundledOutput("back", 0)
elseif rs.testBundledInput("right", colors.pink) and rs.testBundledInput("left", color.white) then
sleep(4)
redstone.setBundledOutput("back", colors.orange)
sleep(9)
redstone.setBundledOutput("back", 0)
//2nd floor down
elseif rs.testBundledInput("right", colors.pink) and rs.testBundledInput("left", color.orange) then
sleep(4)
redstone.setBundledOutput("back", colors.orange)
sleep(9)
redstone.setBundledOutput("back", 0)
elseif rs.testBundledInput("right", 128) and rs.testBundledInput("left", color.orange) then
sleep(4)
redstone.setBundledOutput("back", colors.orange)
sleep(9)
redstone.setBundledOutput("back", 0)
elseif rs.testBundledInput("right", colors.lime) and rs.testBundledInput("left", color.orange) then
sleep(4)
redstone.setBundledOutput("back", colors.orange)
sleep(9)
redstone.setBundledOutput("back", 0)
//3nd floor down
elseif rs.testBundledInput("right", colors.lime) and rs.testBundledInput("left", color.magenta) then
sleep(4)
redstone.setBundledOutput("back", colors.orange)
sleep(9)
redstone.setBundledOutput("back", 0)
sleep(3)
end
end
However we get random errors on line 35 about a nill value or something tho its all the same and shouldnt be happening please help im not sure how to get this working correctly