Cross-referencing "variables" between different tables and arrays


I need to be able to create a slot in a table, with a group name and channel values. The channel values will refer to the specific channels in a 512ch DMX universe where the group is applies. I then need to be able to create slots in a table which hold the levels for various scenes for each of the previously created groups. Something like this:

`group1 <- [1,2,3,4]
group2 <- [5,6,7,8]

// Scene level table //
arrivetable <- {group1 = 255; group2 = 255}
daytimetable <- {group1 = 127; group2 = 127}

function createFinalblob() {
foreach(key,level in arriveTable) {
foreach(index, value in key) {
targetblob[value] = level;
return true

I need to be able to “cross-reference” the group names in the scene tables to the group arrays in order to set the channels defined in the group array to the values in the scene table. For now this is pre-programmed, but in the future these scene levels and groups will be created from an app or webpage. My issue is, this has many errors and I am not sure if this is the correct approach for this. Again, eventually the groups and scene levels (and names) will be created and added to the tables. The groups will be in tables (I think…). My goal, again, is upon a trigger (button press, etc.) that for whatever “scene” is selected, that each “key” in the scene table (corresponding group) will “identify” the group name and call the “group array”, see each channel in that group, and change the level for each channel in the group to the value stored in the scene level table. I hope this makes sense. Any help is appreciated…

A couple of superficial points to make:
slots in a table should be delimited by commas or whitespace, but not semi-colons.

`arrivetable <- { group1=255, group2=255}  // is ok
arrivetable <- { group1=255 group2=255}   //is also ok
arrivetable <- { group1=255; group2=255}  // is not ok

key will be a string that corresponds to the name of the object, not the object itself. You can reference the object with:
foreach (index,value in this[key]) ...

Hey this worked btw. Thanks a bunch!! Reading deeper into how objects are referenced, interesting.