Hi Tim,
And the error i get is:
aspects:7: Invalid aspect name'
I am doing a similar project as yours, except I am writing my own code. It is still in progress, but I think I can assist you.
The function
peripheral.getAspects(), when the peripheral is an aspect jar, will return a table that looks like this:
{1.0={name=aspectName, quantity=aspectAmount}}
The curly brackets { } indicate a table within its bounds, so anything between an opening curly bracket and a closing curly bracket are part of a table.
So if I were reading a jar with, say, 16 Ignis in it, getAspects() would return:
{1.0={name=Ignis, quantity=16}}
In a table, {key=value} is the format entries are presented in. (key) can be a number or a string and (value) can be a number or a string or a table. To read a table's value spot, I just need to limit what part of the table I want to be shown to me. So, if I had something like this:
Table1 = {toast=bread, cat=animal}
Where I have a table with two entries, separated by a comma. And I wanted to first print the (key) value "toast" and then print what the entry with a (key) value of toast was, I would do:
Table1 = {toast=bread, cat=animal}
print("toast")
print(Table1["toast"])
For printing "toast", I am just printing a string with the word toast. For printing "bread", I am using square brackets, which specify that I only want to print what the (key) value "toast" of Table1 is equal to, instead of printing the whole table (i.e. even though I am not doing anything with the second table entry {cat=animal}, it will still exist in that table if I wanted to read it). So using this, I can, if needed, access only a certain part of a table without disrupting other parts.
So back to our aspect jar's table. If we look closely, we can see that within this table, there is another table. Well how do we access that inner table? All we have to do to access the inner table is limit what we see to only what the first entry is equal to by using
peripheral.getAspects()[1] which will instead output:
{name=Ignis, quantity=16}
Alright, now we have access directly to the inner table, now what? Well, now we can access the individual entries of that inner table by using what we learned earlier:
AspectName = peripheral.getAspects()[1]["name"]
AspectAmount = peripheral.getAspects()[1]["quantity"]
With peripheral being the aspect jar. I have parentheses around "name" and "table" because they are strings. Using this, we now have the variable AspectName = "Ignis" and the variable AspectAmount = 16 to work with.
So with this knowledge hopefully you can figure out how to modify the code to make it function again. If you are having trouble modifying the code to do what I wrote above, or you don't understand something I wrote, feel free to respond. Also, if you have any more problems with this setup in general, again, feel free to respond about it, I am happy to help ^_^/> .
Whitecatblack