First, the idea and functionality is great,... BUT
What is for i=1,1 do .... for i=2,2 do... ???
It's a no-loop/loop
such unusual code often leads to errors, whatever the purpose?
here my lines and works identical to the no-loop/loops
table.insert(MapScreenButtons, {id = ("b1"), enabled=true, td="<td>", top=2/100, bottom=13/100, left=1/100, right=28/100})
table.insert(MapScreenButtons, {id = ("b2"), enabled=true, td="<td>", top=15/100, bottom=26/100, left=1/100, right=30/100})
table.insert(MapScreenButtons, {id = ("b3"), enabled=true, td="<td>", top=27/100, bottom=38/100, left=1/100, right=28/100})
table.insert(MapScreenButtons, {id = ("b4"), enabled=true, td="<td>", top=39/100, bottom=50/100, left=1/100, right=28/100})
table.insert(MapScreenButtons, {id = ("b5"), enabled=true, td="<td>", top=51/100, bottom=62/100, left=1/100, right=28/100})
table.insert(MapScreenButtons, {id = ("b6"), enabled=true, td="<td>", top=64/100, bottom=75/100, left=1/100, right=28/100})
table.insert(MapScreenButtons, {id = ("b7"), enabled=true, td="<td>", top=2/100, bottom=13/100, left=75/100, right=100/100})
table.insert(MapScreenButtons, {id = ("b8"), enabled=true, td="<td>", top=15/100, bottom=26/100, left=75/100, right=100/100})
table.insert(MapScreenButtons, {id = ("b9"), enabled=true, td="<td>", top=27/100, bottom=38/100, left=75/100, right=100/100})
table.insert(MapScreenButtons, {id = ("b10"), enabled=true, td="<td>", top=39/100, bottom=50/100, left=75/100, right=100/100})
table.insert(MapScreenButtons, {id = ("b11"), enabled=true, td="<td>", top=51/100, bottom=62/100, left=75/100, right=100/100})
table.insert(MapScreenButtons, {id = ("b12"), enabled=true, td="<td>", top=64/100, bottom=75/100, left=75/100, right=100/100})
table.insert(MapScreenButtons, {id = ("b13"), enabled=true, td="<td>", top=90/100, bottom=100/100, left=1/100, right=18/100})
thanks for your greate work