In the craft bot when doing writs you need to tell it the number of items to make as Blazer stated you can't determine the amount of items from the quest. How about a advanced mode where you would put a maximum quantity to make of each item, generally setting it higher than what you expect so when the program parses the recipie it can get enough fuel and broker pieces to make more than enough.
Then have a while loop that check to see if the quest reward window has popped before accepting it to determine when it should move onto the next recipie. Setting a maximum would keep you from crafting forever if it couldn't determine if the quest reward window has popped.
The reward window pops after each recipie part to re-imburse you for the fuel used to make that part so it should show after each and every part making a good definative marker.
Then have a while loop that check to see if the quest reward window has popped before accepting it to determine when it should move onto the next recipie. Setting a maximum would keep you from crafting forever if it couldn't determine if the quest reward window has popped.
The reward window pops after each recipie part to re-imburse you for the fuel used to make that part so it should show after each and every part making a good definative marker.