BMiner Autostart (Windows) (works right edited for other miners on Win, too)

Little tool to keep your BMiner working (re-edited from a BTC-Talk-Topic to match BMiner and its console output)…
“Fehler” is a german word (not sure if it will be printed to log-file, too… did it in case of!), which requires to be edited to the standard failure message I your log file (but i believe it doesn’t show it in the miner.log)

This code will look via REM CHECK every 30 secs for the specified words (you can edit them in the REM Check-Tasks) in the log-file and, ends the miner on hits and restarts it!

You can start this .bat directly instead of your regular bat-file!

This “watchdog” doesn’t prevent your graphics card from crashing and can’t start them, if your card entirely crashed (fatal error, fatal cuda error)! BMiner tries to start the cards on its own, if it’s able to!
Also, if the cards restart, it can happen, it uses stock settings and not the tweaked settings of your GPU-Tool, but this has something to do with the tweaking programm!

Fee is off… you can turn fee back on, by deleting the -nofee command on every cmd-line!

Dont change the value for “set urlprotocol”, unless you know how to set it… the current value worked yet on the pools, I mined on! (http://bminer.me)

Feel free to edit or optimize it on your computer/worker!
It works also with other miners by editing the path, exe and the command line-architecture matching your miners architecture! (mind, that some miners don’t require “urlprotocol”, in this case delete the line “set urlprotocol=stratum://”)

!!! I will give no further support… either you understand how it works and edit it yourself or just dont use it! !!!

Original script found here: https://bitcointalk.org/index.php?topic=1707546.msg19637460#msg19637460

@echo off
SETLOCAL EnableExtensions

set MINERPATH=C:\Users\carst\Desktop\Mining\Equihash BMiner
set EXE=bminer.exe
set varSeconds=30

set user=BTCZAddressOrUserName
set wrknm=Workername
set wrkpw=WorkerPassword
set urlprotocol=stratum://
set pooladdress=Pooladdress
set port=Port
set api=APIBindingToBrowser
set logfile=LogfileName


set varLops=0
set varSkip=0
set varRuns=-1
set varForc=0


:aIsProcessRunning
@echo Miner Auto Start/Restart
@echo Loop-No   - %varLops%
@echo Skipped   - %varSkip%
@echo Re-Runs   - %varRuns%
@echo Restart   - %varForc%


TIMEOUT /T %varSeconds%
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto aProcessFound

goto aProcessNotFound

:aProcessFound
@echo %EXE% is Running...
@echo %EXE% skipping Start...
set /a varSkip=%varSkip%+1

REM Check for : Fehler
findstr /c:"Fehler" "%MINERPATH%\%logfile%"
if errorlevel 1 (
    echo 0 Sol/s state String NOT found...
) else (
    echo 0 Sol/s state String found
REM KILL Task %EXE%
set /a varForc=%varForc%+1
taskkill /f /im %EXE%
TIMEOUT /T 10
del "%MINERPATH%\%logfile%"
TIMEOUT /T 3
start /i /d "%MINERPATH%\" %EXE% -uri %urlprotocol%%user%.%wrknm%:%wrkpw%@%pooladdress%:%port%  -api %api%  -nofee -logfile=%logfile% 
)
REM Check for : error
findstr /c:"error" "%MINERPATH%\%logfile%"
if errorlevel 1 (
    echo Miner currently not working! Starting new...
) else (
    echo 0 Sol/s state String found
REM KILL Task %EXE%
set /a varForc=%varForc%+1
taskkill /f /im %EXE%
TIMEOUT /T 10
del "%MINERPATH%\%logfile%"
TIMEOUT /T 3
start /i /d "%MINERPATH%\" %EXE% -uri %urlprotocol%%user%.%wrknm%:%wrkpw%@%pooladdress%:%port%  -api %api%  -nofee  -logfile=%logfile% 
)
REM Check for : Error
findstr /c:"Error" "%MINERPATH%\%logfile%"
if errorlevel 1 (
    echo Miner currently not working! Starting new...
) else (
    echo 0 Sol/s state String found
REM KILL Task %EXE%
set /a varForc=%varForc%+1
taskkill /f /im %EXE%
TIMEOUT /T 10
del "%MINERPATH%\%logfile%"
TIMEOUT /T 3
start /i /d "%MINERPATH%\" %EXE% -uri %urlprotocol%%user%.%wrknm%:%wrkpw%@%pooladdress%:%port%  -api %api%  -nofee  -logfile=%logfile% 
)
REM Check for : Failure
findstr /c:"Failure" "%MINERPATH%\%logfile%"
if errorlevel 1 (
    echo Miner currently not working! Starting new...
) else (
    echo 0 Sol/s state String found
REM KILL Task %EXE%
set /a varForc=%varForc%+1
taskkill /f /im %EXE%
TIMEOUT /T 10
del "%MINERPATH%\%logfile%"
TIMEOUT /T 3
start /i /d "%MINERPATH%\" %EXE% -uri %urlprotocol%%user%.%wrknm%:%wrkpw%@%pooladdress%:%port%  -api %api%  -nofee  -logfile=%logfile% 
)
REM Check for : failure
findstr /c:"failure" "%MINERPATH%\%logfile%"
if errorlevel 1 (
    echo Miner currently not working! Starting new...
) else (
    echo 0 Sol/s state String found
REM KILL Task %EXE%
set /a varForc=%varForc%+1
taskkill /f /im %EXE%
TIMEOUT /T 10
del "%MINERPATH%\%logfile%"
TIMEOUT /T 3
start /i /d "%MINERPATH%\" %EXE% -uri %urlprotocol%%user%.%wrknm%:%wrkpw%@%pooladdress%:%port%  -api %api%  -nofee  -logfile=%logfile% 
)
REM Check for : failed
findstr /c:"failed" "%MINERPATH%\%logfile%"
if errorlevel 1 (
    echo Miner currently not working! Starting new...
) else (
    echo 0 Sol/s state String found
REM KILL Task %EXE%
set /a varForc=%varForc%+1
taskkill /f /im %EXE%
TIMEOUT /T 10
del "%MINERPATH%\%logfile%"
TIMEOUT /T 3
start /i /d "%MINERPATH%\" %EXE% -uri %urlcode%%user%.%wrknm%:%wrkpw%@%pooladdress%:%port%  -api %api% -nofee  -logfile=%logfile% 
)
REM Check for : Failed
findstr /c:"Failed" "%MINERPATH%\%logfile%"
if errorlevel 1 (
    echo Miner currently not working! Starting new...
) else (
    echo 0 Sol/s state String found
REM KILL Task %EXE%
set /a varForc=%varForc%+1
taskkill /f /im %EXE%
TIMEOUT /T 10
del "%MINERPATH%\%logfile%"
TIMEOUT /T 3
start /i /d "%MINERPATH%\" %EXE% -uri %urlcode%%user%.%wrknm%:%wrkpw%@%pooladdress%:%port%  -api %api% -nofee  -logfile=%logfile% 
)
@goto aLoopEND

:aProcessNotFound
@echo %EXE% is NOT Running...
@echo %EXE% attempt Start...
set /a varRuns=%varRuns%+1

REM Command Line
start /i /d "%MINERPATH%\" %EXE% -uri %urlprotocol%%user%.%wrknm%:%wrkpw%@%pooladdress%:%port%  -api %api%  -nofee -logfile=%logfile% 
@goto aLoopEND

:aLoopEND
@echo Finished Loop...
@cls
set /a varLops=%varLops%+1

@goto aIsProcessRunning

:aExit
@pause
1 Like

thanks
for the way on btcz :DDDDDDDDDDDDD