https://github.com/aky91/lumberjack-game-bot
Bot to play Lumberjack
https://github.com/aky91/lumberjack-game-bot
gamebot python3 telegram
Last synced: 10 months ago
JSON representation
Bot to play Lumberjack
- Host: GitHub
- URL: https://github.com/aky91/lumberjack-game-bot
- Owner: aky91
- License: mit
- Created: 2020-06-22T04:19:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-22T05:30:04.000Z (over 5 years ago)
- Last Synced: 2025-01-22T11:43:14.524Z (12 months ago)
- Topics: gamebot, python3, telegram
- Language: Python
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LumberJack-Game-Bot
Bot to play LumberJack
LumberJack is an online game played via telegram bot(for more details see https://telegram.games/telegram-games/lumberjack/)
This bot plays the game by analysing the screenshots.
## Prerequisites
### 1. Finding Coordinates of the Region of Interest
* Open the Lumberjack Game and take a screenshot.
* Find the Region of Interest and get the coordinates of upper left point and bottom right point.
* Update the values in the game variable "gameDimension"
### 2. Finding Coordinates of Game Character's Head on the left and right side of the tree
* Using "img.show()" see the image captured and get the coordinates of head position on the left and right side of the tree
* Update the values in the game variables "leftPoint" and "rightPoint"
## Steps to run
1. Run the python script(make sure that all the imported libraries are available)
2. Open the lumberjack game and click play
3. Keep pressing the ↑ key to play
4. Press ↓ to terminate the bot
## Major Challenge
After cutting the tree, how long should the bot wait
### Approach#1: Static wait time
Experimentally found to be around 0.15 second with a max score of 246
Note: This value may differ based on factors like framerate, CPU load, etc.
### Approach#2: Dynamic wait time
Figuring out the amount of decay is challenging
Difficult to find manually
### Approach#3: Monitor change in height of the lowest branch
Assumption: when the tree is cut, the height of the lowest branch is reduced
Problem: there is a whole animation of tree height reducing