(info) Other great resources: Official JS API docs, Scripting Forum

isStructureAvailable()

isStructureAvailable(structure type[, player])

 

checks to see if a structure (specified by name, not constant) is available

checks that the player can build another structure of this type (takes in to account research and structure limits)

player param defaults to 'me' from 3.2 onwards