First, the orientation will be a different TYPE. This TYPE refers to the graphic in one of the files. Each graphic gets a different number, so the South and East facings are just a different picture.
We should pick 1 of the scripts to see how to change it. Then if you want to apply similar logic to other scripts, we can go from there. I would prefer starting from someone's original post for their script, then we can show the required changes in that thread and other people can find it, too. If the original author is around, either they might be willing to change it or to apply the changes and repost it. I do not want to repost their whole work - out of respect.