I need to fix my existing code.
put this to .bat file
Code:
set host=hidemyass.com
"C:\Program Files\HMA! Pro VPN\bin\HMA! Pro VPN.exe" -changeip
:wait
ping -n 1 %host% | find "Reply from" >nul
if errorlevel 1 goto wait
Ofc doublecheck path
use exec command to call bat file from php script
Now that is working right

We have another problem now.HMA VPN is changing ip in roughly 2 steps
1.It disconnects from existing connection and now you have your ip like VPN is not active at all
2.It connects again and give you new ip
Problem with solution i have is that bat file ping host while my original ip is active and i pick signal that ip is changed sooner than i want (i want signal when i get new ip)
I could ofc put random (long) sleep to make sure ip is changed but that is not how i do stuff

If anyone want to jump in with good solution ty in advance.If not i ll be back soon with my best solution.
Also keep in mind that many ip you get from HMA are blocked on google and other places. If you are doing automation maybe it is smart to check new ip with some code (curl google.com,pregmatch error code and if found get new ip ......)