Ridiculously over-designed whack-a-potato bot for FAPI with intelligent detection, performance tracking, and visual coordinate setup.
๐ Love this tool? Go support the amazing game that inspired it!
๐ฎ Farmer Against Potatoes Idle on Steam - Free to play!
- Python 3.7+ (required to run the bot)
- Windows/Linux/macOS compatible (Only tested on Windows)
- ๐ฏ Smart Detection: Precise brown/golden potato targeting with dual game state monitoring
- ๐ฑ๏ธ Visual Setup: Drag-and-drop coordinate configuration with only 3 key positions needed
- โก Performance Tracking: Real-time statistics and session reports
- ๐ Emergency Stop: Press ESC anytime to stop the bot
- ๐ Visual Verification: See exactly where the bot will click and monitor
- ๐ Auto Game Cycling: Intelligent game state detection with failsafe backup
pip install -r requirements.txt
Required packages:
pyautogui
- Screenshots and mouse automationpynput
- Keyboard monitoring for emergency stopPillow
- Image processing for visualizations
All other dependencies (tkinter, json, subprocess, etc.) are included with Python.
python setup_coordinates.py
This shows a menu with all options:
- โ Visual coordinate setup (drag & drop)
- โ Run the bot
- โ Test coordinates
- โ All utilities
-
Set up coordinates:
python visual_coord_grabber.py
- Drag shapes over your game elements
- Press SPACEBAR to save coordinates
- Auto-launches visualizer for confirmation
-
Run the bot:
python whack.py
- Press ESC anytime to emergency stop
File | Purpose |
---|---|
requirements.txt |
๐ฆ Dependencies to install |
setup_coordinates.py |
๐ฎ Easy launcher menu |
visual_coord_grabber.py |
๐ฑ๏ธ Drag-and-drop coordinate setup |
whack.py |
๐ค Main automation bot |
coordinate_visualizer.py |
๐ Visual coordinate verification |
coordinates.json |
๐พ Your saved coordinates |
exampleSetup.jpg |
๐ธ Example coordinate setup |
โ ๏ธ IMPORTANT: Play the game to an endgame screen once first! You need to see the endgame to position the red crosshair correctly.- Run
python visual_coord_grabber.py
- If coordinates exist: Shapes load at current positions for fine-tuning
- If no coordinates: Shapes appear at default positions
- Drag the cyan rectangle over your game area
- Position only 3 key toilets:
- TOP LEFT toilet (reference point)
- RIGHT OF TOP LEFT toilet (horizontal spacing)
- BELOW TOP LEFT toilet (vertical spacing)
- Drag the blue crosshair to monitor when game is available
- Drag the red crosshair to monitor when game ends (requires endgame screen visible)
- ๐ก Recommended: Position over the white 'C' in the Combo meter - it turns red when game ends
- Drag the yellow button over the START button
- Press SPACEBAR to save and verify
Example of proper coordinate setup with all elements positioned correctly
โจ Smart Loading: Automatically loads your existing coordinates for easy adjustments!
- ๐ต Cyan Rectangle: Game area boundary
- ๐ข Green Circles: Key toilet positions (only 3 needed for full grid calculation)
- ๐ต Blue Crosshair: Pixel monitored to detect when game is available to start
- ๐ด Red Crosshair: Pixel monitored to detect when game ends
- ๐ก Yellow Rectangle: START button location
python whack.py
- ๐ Bot monitors game available detection pixel (blue crosshair)
- ๐ฎ Clicks START button when game becomes available
- ๐ฏ Scans for brown/golden potatoes at 60 FPS across entire 3x5 grid
- ๐ฅ Clicks immediately when potato detected
- ๐ Dual End Detection:
- Primary: Monitors game over pixel (red crosshair)
- Failsafe: 15 seconds of no activity (backup detection)
- โณ Waits 4 minutes for cooldown
- ๐ Repeats automatically
The bot tracks and reports:
- โ Games played
- ๐ฅ Total clicks
- โฑ๏ธ Average clicks per game
- โก Clicks per second
- ๐ Games per hour
- Press ESC anytime to immediately stop the bot
- Works even during cooldown periods
- Run the visualizer:
python coordinate_visualizer.py
- If positions look wrong, re-run:
python visual_coord_grabber.py
- Check if potatoes are brown/golden colored
- Verify toilet positions with visualizer
- Check game available detection position with visualizer (blue crosshair)
- Verify the detection pixel changes color when game is ready
- Re-position blue crosshair over the correct detection area
- Play to an endgame screen first to see what pixel changes when game ends
- ๐ก Recommended: Position red crosshair over the white 'C' in the Combo meter (turns red when game ends)
- Check game over detection position with visualizer (red crosshair)
- Verify the pixel changes from white to red when game ends
- Re-position red crosshair over the correct area
- Failsafe will still trigger after 15 seconds if pixel detection fails
- The bot will use default coordinates if
coordinates.json
is missing - Run coordinate setup to create your custom configuration
- Python not found: Ensure Python 3.7+ is installed
- pip not found: Try
python -m pip install -r requirements.txt
- Permission errors: Try
pip install --user -r requirements.txt
- pyautogui issues on Linux: May need
sudo apt-get install python3-tk python3-dev
python coordinate_visualizer.py
See exactly where the bot will click with visual overlay.
Coordinates are stored in coordinates.json
:
{
"sceneScreenshotCornerX": 1735,
"sceneScreenshotCornerY": 279,
"sceneScreenshotWidth": 872,
"sceneScreenshotHeight": 855,
"leftBorderToToilet": 84,
"topBorderToToilet": 180,
"toiletToToiletX": 178,
"toiletToToiletY": 290,
"gameAvailableDetectionX": 2455,
"gameAvailableDetectionY": 122,
"gameOverDetectionX": 2555,
"gameOverDetectionY": 222,
"startButtonX": 2146,
"startButtonY": 1325,
"gameFPS": 60,
"gameplaySeconds": 60
}
- Emergency Stop: ESC key always works
- Failsafe Timeouts: Prevents infinite loops
- Error Handling: Graceful recovery from issues
- Visual Verification: See exactly what the bot will do
IMPORTANT DISCLAIMER:
- This bot automates gameplay which may violate the game's Terms of Service
- Use at your own risk - I'm not responsible for any account actions
- Check the game's ToS before using automation tools
- Consider this tool for educational/personal use only
- The developer of this bot is not affiliated with the game developers
Ready to dominate some potatoes? ๐ฅ๐ช