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

eventStructureBuilt()

triggered when you get a new structure

eventStructureBuilt(structure[, droid])

An event that is run every time a structure is produced. The droid parameter is set if the structure was built by a droid. It is not triggered for building theft (check eventObjectTransfer for that).

structure = Structure object

droid = Droid object (only if the building was built by a droid)

if a DROID_CONSTRUCT was building it, then this event gets triggered after the transition from BEING_BUILT to BUILT.

the event also gets called if you use addStructure() (I think?)