A bot for lingos.pl built with Python and Selenium.
Prerequisites:
Ensure you have python, python-pip, python-venv, and firefox packages installed on your system.
Installation:
- Clone the repository:
git clone https://github.com/Epickitrolaz/LingosBot cd LingosBot - Make the scripts executable:
chmod +x setup.sh start.sh
- Run the setup script:
./setup.sh
- Copy the environment template and configure your options:
(Open
cp .env.example .env
.envin your text editor and set your email, password, and other variables). - Start the bot:
./start.sh
Prerequisites: Ensure you have the latest version of Python, Git, and Firefox installed.
Installation Steps:
- Open Command Prompt (
cmd) and navigate to your desired directory (e.g., Desktop). - Clone the repository:
git clone https://github.com/Epickitrolaz/LingosBot cd LingosBot - Run the setup script:
setup.bat
- Copy the contents of
.env.exampleinto a new.envfile, configure your credentials and other variables. - Start the bot:
start.bat
Configure the bot's behavior by editing the .env file. Below are the available variables and their usage:
| Variable | Type | Description |
|---|---|---|
EMAIL |
Text |
Your lingos.pl login email. |
PASSWORD |
Text |
Your lingos.pl login password. |
LESSON_COUNT |
Number |
Number of lessons to complete per session. |
CHANCE_OF_PASSING |
Decimal |
Chance of the bot being correct. 1 = correct every time, 3 = correct every 3 questions, etc. |
ENABLE_CHALLENGES |
0/1 |
Should the bot automatically select challenges for more points? |
AUTOMATED_LOGIN |
0/1 |
Should the bot log in automatically using the provided credentials? |
HEADLESS |
0/1 |
Should the browser run in headless mode (hidden window, good for a headless server)? |
SCRAPE |
0/1 |
Should the code get the translation list before starting? |
APPEND_TO_DB |
0/1 |
Should new words be appended to the local database while running? |
LOCKUP_PREVENTION |
0/1 |
Enables the fix to prevent lockups on bad translations. |
CLEAR_DB_BEFORE_SESSION |
0/1 |
Removes all database entries before starting a new session. |
VERBOSE |
0/1 |
For debugging. Enables verbose logging. |
FORCE_WAIT_SEC |
Decimal |
For debugging. How long the code should wait between actions (in seconds). |
To update to the latest version:
- Navigate to the bot directory:
cd LingosBot - Pull the latest changes:
git pull
- Re-run the setup script to update dependencies:
- Linux:
./setup.sh
- Windows:
setup.bat
- Linux:
For running the bot on your personal computer:
-
Configure your
.envfile however you like -
Start the bot:
- Linux:
./start.sh
- Windows:
start.bat
- Linux:
For automated deployment on a headless server:
-
Configure your
.envfile with server-optimized settings:# User preferences EMAIL=your_email@example.com PASSWORD=your_password LESSON_COUNT=5 CHANCE_OF_PASSING=1.2 ENABLE_CHALLENGES=1 # Server automation settings AUTOMATED_LOGIN=1 HEADLESS=1 SCRAPE=1 APPEND_TO_DB=1 LOCKUP_PREVENTION=1 CLEAR_DB_BEFORE_SESSION=0 VERBOSE=0
Note:
LOCKUP_PREVENTION=1is highly recommended for unattended operation. -
Set up a cron job to run the bot daily:
crontab -e
Add the following line to run the bot every day at 9:00 AM:
0 9 * * * cd /path/to/LingosBot && ./start.sh >> /path/to/LingosBot/bot.log 2>&1
Replace
/path/to/LingosBotwith the actual LingosBot directory.You can see how cron jobs work on crontab.guru.