This Laravel 11 project automates the Hamster Kombat and Musk Empire Games by handling taps and purchasing upgrades (improvements) based on the configured strategies.
Clone the Repository:
git clone https://github.com/NimaN2D/telegram-mini-app-games-automation.git
cd telegram-mini-app-games-automation
Install Dependencies:
composer install
Environment Configuration:
Copy the .env.example
to .env
and update the environment variables.
cp .env.example .env
Set Environment Variables:
# Hamster configuration
HAMSTER_INIT_DATA_RAW='INIT_DATA_RAW'
HAMSTER_FINGERPRINT='FINGERPRINT'
HAMSTER_SPEND_PERCENTAGE=100
HAMSTER_MIN_BALANCE=0
# Musk Empire configuration
MUSK_EMPIRE_INIT_DATA='INIT_DATA'
MUSK_EMPIRE_SPEND_PERCENTAGE=100
MUSK_EMPIRE_MIN_BALANCE=0
To obtain the HAMSTER_INIT_DATA_RAW
and HAMSTER_FINGERPRINT
variables, follow these steps:
F12
on your keyboard to open the Chrome Developer Tools. Clear the Console by clicking on the icon that looks like a no-entry sign.const iframe = document.getElementsByTagName('iframe')[0];
iframe.src = iframe.src.replace(/(tgWebAppPlatform=)[^&]+/, "$1android");
console.log("🐹 Hamster:", iframe.src);
F12
) again. Go to the Network tab and look for a request named auth-by-telegram-webapp
.initDataRaw
and fingerprint
variables and set them in your .env
file.To obtain the MUSK_EMPIRE_INIT_DATA
variable, follow these steps:
F12
on your keyboard to open the Chrome Developer Tools. Clear the Console by clicking on the icon that looks like a no-entry sign.const iframe = document.getElementsByTagName('iframe')[0];
iframe.src = iframe.src.replace(/(tgWebAppPlatform=)[^&]+/, "$1android");
F12
) again. Go to the Network tab and look for a request named auth
.initData
variable and set it in your .env
file.Docker Setup:
docker-compose up -d --build
Install Dependencies:
docker-compose exec game-automation composer install
The service will start automatically when the Docker containers are up. If you need to manually run the command to play the game, use:
docker-compose exec game-automation php artisan play:hamster
docker-compose exec game-automation php artisan play:musk-empire
Contributions are welcome! Please follow these steps to contribute:
git checkout -b feature-branch
).git commit -m 'Add some feature'
).git push origin feature-branch
).Please make sure to update tests as appropriate.
This project is licensed under the MIT License.
This project is intended for educational and personal use only. Using this automation tool in the Hamster Kombat Game might violate the game's terms of service. Use at your own risk. The developers of this project are not responsible for any consequences, including but not limited to being banned from the game.