Skip to content

Instantly share code, notes, and snippets.

@BigBang1112
Last active December 24, 2019 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BigBang1112/7fc72f3913600e4283a1ba2e50953cb3 to your computer and use it in GitHub Desktop.
Save BigBang1112/7fc72f3913600e4283a1ba2e50953cb3 to your computer and use it in GitHub Desktop.
The first step for the first automated world record tracking
@echo off
SET login=[your_maniaplanet_login]
SET password=[your_maniaplanet_password]
SET maniaplanet_exe_location=C:\Program Files\ManiaPlanet
SET title=TMStadium@nadeo
SET loop=true
SET /A loop_interval=60
SET /A close_interval=60
echo LeaderboardRefresher v.0.0.1
echo by BigBang1112
echo ""
:LOOP
SET maniaplanet_exe=%maniaplanet_exe_location%\ManiaPlanet
echo Starting %maniaplanet_exe%...
set start_with_pid=wmic process call create "%maniaplanet_exe% /login=%login% /password=%password% /title=%title% /url=maniaplanet:///:leaderboards"
for /f "tokens=3 delims=; " %%a in ('%start_with_pid% ^| find "ProcessId"') do set PID=%%a
echo Started ManiaPlanet on PID %PID%
SET /A interval=%loop_interval%*60-%close_interval%
TIMEOUT %close_interval% /NOBREAK
TASKKILL /PID %PID% /F
TIMEOUT %interval% /NOBREAK
GOTO LOOP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment