Run it in the main building of one of your villages. A pop up will appear for you to select which village you want to pull resources from. After that in front of the button to build, the buildings that are lacking resources for its execution will have a button for you to pull the amount of resources needed for that level of building to be built.
Hey do you mind editing your post and removing ``` surrounding the script? It's confusing people and they don't know they should remove it before adding to quick bar.