This script only works for one village per world. I haven't implemented multiple villages yet. It doesn't work as you'd like with multiple villages. This script is still in development and not everything might work as intended.
Queue length is the maximal length of the queue. Without a premium account, that is limited to 2, with a premium account there is no limit but a queue longer than 5 will increase the building cost.