New problem! I tried to use the API by using this code:
os.loadAPI("monitor")
monitor.button("buttonOne", 3, 26, 2, 11, "button", colors.cyan, "pulse", "left", 5)
I got this error:
monitor:33: index expected, got nilHere is the code on pastebin:
http://pastebin.com/kG0hxGhGThe code is far from done, but I'll finish it.
This issue is best shown with some example code.
Let's say that I have a table named "people":
people = {}
I have decided that I want to make a new person with several attributes, so I try to do that like this:
people["Bubba"]["Name"] = "Bubba"
people["Bubba"]["Height"] = "5'11\""
This will give me an error: "index expected, got nil". Where is the problem? The problem is that I am trying to add values (Name, Height) to a table that does not yet exist.
To fix this, I would need to do the following:
people["Bubba"] = {}
people["Bubba"]["Name"] = "Bubba"
people["Bubba"]["Height"] = "5'11\""
So what I needed to do was create a new table inside of people that referred to "Bubba". Only after that can I add values to that table. Make sense?
Let's look at your code now:
function button(name, xMin, xMax, yMin, yMax, text, colorButton, action, parameterOne, parameterTwo, parameterThree)
clear()
buttonTable[name]["xMin"] = xMin
buttonTable[name]["xMax"] = xMax
buttonTable[name]["yMin"] = yMin
buttonTable[name]["yMax"] = yMax
...
You immediately jump in to declaring properties of the button without first making a table for those properties to exist in. Try creating a table for those properties first and you should be good to go :)/>