well, I was kinda trying to make a control computer for doors and such, but it seems to be giving me trouble at line 36, or so it says. I keep getting the error "colors:36 To few Arguments"
What does this mean and how can I fix it?
You will probably find even more bugs, so if you do, let me know.
EDIT:
Seems to me like the function of colors isnt working? Because, If im correct, it should "Nameofyourprogramhere:96 Stupid error".
Wrong colors?
Code:
function clear()
term.clear()
term.setCursorPos(1, 1)
end
function password()
clear()
while true do
term.write("Password: ")
local pass = read("*")
if pass == "1598" then
doors()
else
clear()
print("Password Incorrect.")
sleep(1)
end
end
end
function doorcheck()
local one = colors.test(rs.getBundledInput("bottom", colors.purple))
print("Is Door 1 Open? "..one)
end
function doors()
while true do
clear()
doorcheck()
print("Which door to manipulate? (1, 2, or 3)")
local door = read()
if door == '1' then
rs.setBundledOutput("bottom", colors.brown)
sleep(0.2)
rs.setBundledOutput("bottom", 0)
local one = rs.getBundledInput("bottom", colors.purple)
if one == true then
print("Door 1 is Open.")
sleep(0.8)
else
print("Door 1 is Closed.")
sleep(0.8)
end
elseif door == '2' then
rs.setBundledOutput("bottom", colors.black)
sleep(0.2)
rs.setBundledOutput("bottom", 0)
local two = rs.getBundledInput("bottom", colors.blue)
if two == true then
print("Door 2 is Open.")
sleep(0.8)
else
print("Door 2 is Closed.")
sleep(0.8)
end
elseif door == '3' then
rs.setBundledOutput("bottom", colors.white)
sleep(0.2)
rs.setBundledOutput("bottom", 0)
local three = rs.getBundledInput("bottom", colors.red)
if three == true then
print("Door 3 is Open.")
sleep(0.8)
else
print("Door 3 is Closed.")
sleep(0.8)
end
else
print("Unrecignized Command.")
sleep(1)
end
end
end
password()