If you're looking to create a tool or script to automate these steps or provide more feedback during the flashing process, here are some ideas:
Using the Smart Phone Flash Tool (SP Flash Tool) is one of the most reliable ways to flash stock ROMs, unbrick devices, or install custom firmware on MediaTek (MTK) Android smartphones. However, the process is rarely without hiccups. One of the most frustrating errors users encounter is when the progress bar reaches the end of the first phase and the SP Flash Tool gets stuck on "Download DA 100%" with a red or yellow bar.
Avoid USB 3.0 (blue) ports; SP Flash Tool often prefers USB 2.0 ports .
If your SP Flash Tool is stuck on "Download DA 100%", you are not alone. This is one of the most common errors when flashing MediaTek (MTK) devices.