The best way to do this is to store what you're making into general storage. Then you can have the bot check if that storage is full and only make something if there's space left.