This script automates the game Cookie Clicker using Selenium WebDriver. It performs various actions in the game to maximize cookie production even when while away.
- Python 3.x
- Selenium
- ChromeDriver
- numpy
-
Install Selenium & numpy:
pip install selenium, numpy
-
Download the appropriate version of ChromeDriver (or any other driver with a small adjustment in the cookiebot.py file) from here and place it in your PATH.
- To clone this repository, use the following command:
git clone <repository_url>
- Navigate to the directory:
cd <directory_name>
- Run the bot using
cookieBot.py
:python cookieBot.py
I created this bot a while back and thought to publicize it since it turned out quite useful to be able to afk the game and still get golden cookies or even be able to make use of Force of hand when a good golden cookie multiplier occurs.
The bot will automatically make use of a file in the same folder called: CookieAISaveData.txt, you can export your old save data to a file and rename it as such to import it or you can change the contents of the file and restart the bot to change the file. It is always recommended to restart the bot when a save file is used or when you prestige so the bot is properly initialized.
The Cookie Clicker Bot automates various aspects of the Cookie Clicker game to enhance the player's experience and optimize cookie production. Below are the key features of the bot:
- Continuous Cookie Clicking: The bot automatically clicks the main cookie at a fast rate so you don't really have to yourself.
-
Golden Cookie Clicking: The bot detects and clicks Golden Cookies as soon as they appear to take advantage of their bonuses.
-
Golden Cookie Combo: This bot can also use force of hand or take loans when a good golden cookie bonus occurs.
- Building Purchase: The bot evaluates and purchases buildings based on their cost-effectiveness to increase cookies per second (CPS).
- Upgrade Purchase: The bot evaluates and purchases upgrades, considering both general and specific upgrades, to optimize CPS and click efficiency.
- Heuristic Calculations: The bot uses heuristics to determine the best buildings and upgrades to purchase based on their impact on CPS relative to their cost.
- Automatic Game Save: The bot periodically saves the game's progress to a local file.
- Automatic Game Load: The bot can load game data from a local file to resume from the last saved state.
- Sugar Lump Harvesting: The bot periodically checks and harvests sugar lumps to utilize their benefits.
- Garden Management: The bot manages the garden by planting clovers to optimize golden cookies.
- Stock Market Check: The bot interacts with the stock market, evaluating and performing actions to maximize profit from stock trades.
- Scheduled Tasks: The bot performs specific actions, such as upgrading and managing resources, at regular intervals to ensure optimal gameplay.
This is obviously not the way the game was meant to be played, but the game was intentionally designed so users can make use of commands in the command line, even allowing you to set your cookies to any number you want. This bot was intended to only do things so you don't have, not to do things you couldn't do yourself. Using this bot will not get you the cheated cookies shadow achievement.