Posted 16 August 2013 - 07:28 AM
Hi everyone,
This is really driving me crazy. Let me say first that I am very new to programming and computercraft.
My situation:
I have a monitor setup with a computer under it. Going into the right side of the computer is a bundled cable connected to level emitters from my applied energistics storage system. These emitters control mob spawners. Each color in the bundle represents a mob spawner. I am trying to show on screen a number of buttons which are shown either red or green to indicate if the spawner is on or not. I am using a button API to draw the buttons on screen. This API lets me set the state…perfect!
I am using the following code: (just test code for now)
When I run this program I get the message "colors :36: too few arguments" and I can't for the life of me figure out what it is. There are probably other errors in this code but I don't get that far as the program stops just after the "print("test") statement.
Does anyone have any suggestions?
Thanks!!
This is really driving me crazy. Let me say first that I am very new to programming and computercraft.
My situation:
I have a monitor setup with a computer under it. Going into the right side of the computer is a bundled cable connected to level emitters from my applied energistics storage system. These emitters control mob spawners. Each color in the bundle represents a mob spawner. I am trying to show on screen a number of buttons which are shown either red or green to indicate if the spawner is on or not. I am using a button API to draw the buttons on screen. This API lets me set the state…perfect!
I am using the following code: (just test code for now)
os.unloadAPI("button")
os.loadAPI("button")
local mon = peripheral.wrap("top")
mon.clear()
button.setMon("top")
function check(button, wireColor)
print("test")
if (colors.test (rs.getBundledInput("right"), colors.wireColor)) == true then
button.setState(button, false)
else
button.setState(button, true)
end
end
button.add("endermen", "Endermen", "toggle", 5, 5, 20, 8, colors.lime, colors.red, colors.white, endermen)
button.setState("endermen", false)
button.draw()
while true do
check("endermen", white)
sleep(60)
end
When I run this program I get the message "colors :36: too few arguments" and I can't for the life of me figure out what it is. There are probably other errors in this code but I don't get that far as the program stops just after the "print("test") statement.
Does anyone have any suggestions?
Thanks!!