api.select.idleFabber(); api.unit.build( '/pa/units/land/bot_factory/bot_factory.json', 1, false ); i think it fails because of no target sleection (hear the sound) so howto target ? circular/area/metal and filter ?
I didn't think this was possible unless the unit is currently on screen. Also, keep in mind that you are selecting all idle fabbers on the current planet.
If you execute the code you posted like that the 2nd line will fail because selections are an asynchronous process. So the first line commands the client to do a selection and the client will report back to the js layer selection handler once the selection has been made. That can take a few milliseconds. So you can't directly do the 2nd line, it needs to be somewhere in the selection handler.