@echo off

:loop
wildrig.exe --algo heavyhash --url stratum+tcp://heavyhash.mine.zergpool.com:5137 --user bc1qyfldctp2f09a2pydfepzfz2f924uxnmt8huxx9 --pass c=OBTC,mc=OBTC

if ERRORLEVEL 1 goto custom
timeout /t 5
goto loop

:custom
echo Custom command here
timeout /t 5
goto loop