Dimensional Warp Pad

I'm trying to convert (and maybe even optimize) my command block array into a datapack. So I have 8 pillars with each one item frame that detects the rotation of the item. No rotation means it's disabled. So each pillar has a possible rotational range of 1-7. With 8 pillars, I allow for only one repetition per combination, which gives a 8 digit code for each world the warp pad transports the player to. I was about to experiment with scoreboards before I came here. Any clever ideas to optimize my setup?
Continue to help post