GithubHelp home page GithubHelp logo

pasanlaksitha / google-santatracker-gamebot Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 68 KB

I coded a simple script from multiple ways to gain a score in the Google Christmas Easter Egg Game(Santa Tracker). This website has a collection of games to play, and this script is for a game called Wrap Battle. https://santatracker.google.com/intl/en/wrapbattle.html

Home Page: https://santatracker.google.com/intl/en/wrapbattle.html

License: MIT License

Python 100.00%
game-bot game-scripts gamebot google pyautogui-automation python santatracker

google-santatracker-gamebot's Introduction

Google Santa Tracker Bot Documentation

๐Ÿ‘‡ Game you need to beat Highscore
https://santatracker.google.com/intl/en/wrapbattle.html

Introduction

This documentation provides information on how to use and understand the Google Santa Tracker Bot. The bot is designed to play the Google Santa Tracker game by automatically navigating through the game's interface using pixel colour detection and simulated keyboard inputs.

Dependencies

  • Python 3.x
  • PyAutoGUI library
  • Keyboard Library

Install the required dependencies using the following commands:

pip install pyautogui
pip install keyboard

Getting started

1. Clone the Repository

Clone the Google Santa Tracker Bot repository to your local machine:

git clone https://github.com/your-username/google-santa-tracker-bot.git
cd google-santa-tracker-bot

2. Adjust Screen Coordinates

Open the santa_tracker_bot.py file in a text editor and update the screen coordinates to match your screen configuration. Modify the values of c1, c2, c3, and c4 based on the cells or circles in the Google Santa Tracker game on your screen.

3. Run the Bot

python color-identify.py

4. Quit the Bot

Press the q key on your keyboard to stop the bot.

Understanding the Code

Screen Coordinates

The screen coordinates (c1, c2, c3, c4) represent the positions of the cells or circles in the Google Santa Tracker game. These values need to be adjusted to match the layout on your screen.

Color Codes

  • Grey: RGB(51, 51, 51)
  • Black: RGB(0, 0, 0)

Pixel Color Detection

The line pyautogui.pixel(217, 534)[0] == 51 in the code is responsible for detecting the colour of a specific pixel on the screen. This is achieved using the pyautogui.pixel() function, which returns the RGB color values of the pixel at the specified coordinates.

217 and 534 are the X and Y coordinates, respectively, of the pixel being checked. [0] indicates that we are retrieving the red component of the RGB colour values, other arguments in this function are [1] and [2] which are Green and Blue respectively. The expression == 51 checks if the red component of the pixel colour is equal to 51.

The bot uses pixel colour detection to identify the game's current state based on the colour of specific pixels.

Main Loop

The main loop continuously checks the pixel colour at predefined locations. Depending on the colour detected, the bot sends corresponding keyboard inputs to navigate the Santa Tracker game.

Customization

Feel free to customize the bot according to your preferences or specific game variations. You can modify the pixel colours, screen coordinates, and keypress actions as needed.

Troubleshooting

If the bot is not working as expected, consider the following:

  • Ensure that the screen coordinates are correctly set for your display.
  • Check for any updates or changes in the Google Santa Tracker game that may affect pixel colour detection.

Extra

What is imagedetect.py

Well when I first started to write this program, I didn't notice that there is only one key comes in each row its not shuffling, so before I realised that, I tried a script to screenshot each arrow and identify them on the screen when they closed and pass the circle initiate the keypress i wrote only a half and give up script because its useless

Note

BUG!

When I was testing this game, I noticed that there was a problem with the game that is, when a key circle closes to the pressing zone the game doesn't concern if a wrong arrow key is pushed. If we push with the correct key, that means once we press all 4 keys at once each time a circle passes, we score a point.

so i coded a shorter program for this if you need you can configure it to initiate when color code is detected like color-identify.py below one is only a concept its works without coordination

import keyboard
while not keyboard.is_pressed('q'):
    for i in ['left','up','down','right']:
        keyboard.press_and_release(i)

google-santatracker-gamebot's People

Contributors

pasanlaksitha avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.