@echo off
REM Start ONE Flyff bot instance (its own window + login + control panel).
REM
REM   flyffbot.bat              -> instance "main" (or "main2","main3"... if one's
REM                                already running — auto-unique so it won't collide)
REM   flyffbot.bat farmer2      -> a named instance (own login window), runs in parallel
REM
REM Double-click for the "main" instance, or run from a terminal with a name.
REM Each instance keeps its login in profiles\<name>, so you log in once per instance.
REM NOTE: Chromium can't share one profile across two windows. Double-clicking again
REM while "main" is open auto-picks main2/main3 (a fresh profile -> log in again).
REM Closing "main" frees the slot, so the next no-name launch reuses "main" + its login.

cd /d "%~dp0"
REM Prefer the isolated environment created by install.bat; fall back to system Python.
if exist ".venv\Scripts\python.exe" (
  ".venv\Scripts\python.exe" flyffbot.py %1
) else (
  python flyffbot.py %1
)
pause
