Posted in

The Automation Kitchen – A Collection of Digital Recipes

Alright, let’s get cooking! We have a series of scripts here, each a different little culinary experiment. I’ll describe them individually as recipes.


Recipe 1: The Mouse Whisperer

  • Main Dish (Idea): A simple appetizer: to observe the current mouse position on the screen after a delay.
  • Ingredients (Concepts & Components):
    • pyautogui: Our primary ingredient, the “Mouse and Keyboard Orchestrator”. It lets us see the current mouse position on the screen.
    • time: The “Patience Spice”. Allows us to pause the cooking process for a bit.
  • Cooking Process (How It Works):
    1. First, we wait for a moment using the “Patience Spice.”
    2. Next, the “Mouse and Keyboard Orchestrator” is used to display the current mouse position.
  • Serving Suggestion (Outcome): A display on the console, showing the x and y coordinates of the mouse cursor at the time the script is run.

Recipe 2: The Color Hunter (Auto Space)

  • Main Dish (Idea): A dish to trigger the space key when specific colors are detected on the screen, like a simple game bot that tries to react to specific UI element.
  • Ingredients (Concepts & Components):
    • pyautogui: Again, the “Mouse and Keyboard Orchestrator,” but this time, it’s also our “Pixel Inspector”.
    • time: The “Patience Spice”. Not used in the final version, this is just to introduce delay.
  • Cooking Process (How It Works):
    1. First, we wait for a moment using the “Patience Spice.”
    2. We enter an indefinite loop.
    3. Within the loop, the “Pixel Inspector” (pyautogui) checks if the color matches the target color at multiple pre-defined locations.
    4. If any of the color checks match, then the “Keyboard” functionality (pyautogui) presses the “space” key.
  • Serving Suggestion (Outcome): A script that, when run, will endlessly check for a specific color pattern on the screen and simulate pressing the space bar in reaction.

Recipe 3: The Color Hunter (Simplified)

  • Main Dish (Idea): A dish to trigger the space key when specific colors are detected on the screen, like a simple game bot that tries to react to specific UI element.
  • Ingredients (Concepts & Components):
    • pyautogui: Again, the “Mouse and Keyboard Orchestrator,” but this time, it’s also our “Pixel Inspector”.
    • time: The “Patience Spice”. Not used in the final version, this is just to introduce delay.
  • Cooking Process (How It Works):
    1. First, we wait for a moment using the “Patience Spice.”
    2. We enter an indefinite loop.
    3. Within the loop, the “Pixel Inspector” (pyautogui) checks if the color matches the target color at a pre-defined locations.
    4. If any of the color checks match, then the “Keyboard” functionality (pyautogui) presses the “space” key.
  • Serving Suggestion (Outcome): A script that, when run, will endlessly check for a specific color pattern on the screen and simulate pressing the space bar in reaction.

Recipe 4: The Color Hunter (Alternative)

  • Main Dish (Idea): A dish to trigger the space key when specific colors are detected on the screen, like a simple game bot that tries to react to specific UI element.
  • Ingredients (Concepts & Components):
    • pyautogui: Again, the “Mouse and Keyboard Orchestrator,” but this time, it’s also our “Pixel Inspector”.
    • time: The “Patience Spice”. Not used in the final version, this is just to introduce delay.
  • Cooking Process (How It Works):
    1. First, we wait for a moment using the “Patience Spice.”
    2. We enter an indefinite loop.
    3. Within the loop, the “Pixel Inspector” (pyautogui) checks if the color matches the target color at a pre-defined locations.
    4. If the color checks match, then the “Keyboard” functionality (pyautogui) presses the “space” key.
  • Serving Suggestion (Outcome): A script that, when run, will endlessly check for a specific color pattern on the screen and simulate pressing the space bar in reaction.

Recipe 5: The Color Hunter (Simplified – Comparing Colors)

  • Main Dish (Idea): A dish to trigger the space key when certain pixels have the same color.
  • Ingredients (Concepts & Components):
    • pyautogui: Our “Mouse and Keyboard Orchestrator,” and also the “Pixel Inspector”.
    • time: The “Patience Spice”. Introduces a small delay.
    • keyboard: The key press ingredient. Allows pressing keyboard keys.
  • Cooking Process (How It Works):
    1. First, we wait for a moment using the “Patience Spice.”
    2. We enter an indefinite loop.
    3. Within the loop, the “Pixel Inspector” (pyautogui) checks if the color matches the target color at a pre-defined locations.
    4. If the condition is True, then the “Keyboard” functionality (keyboard) presses and releases the “space” key.
  • Serving Suggestion (Outcome): A script that continuously checks for a pixel color condition and simulates a space bar press upon fulfillment.

Recipe 6: The Automated Search Assistant

  • Main Dish (Idea): To automate a search query within a program and take a screenshot of the results.
  • Ingredients (Concepts & Components):
    • pyautogui: The “Mouse and Keyboard Orchestrator” — used to move the mouse, click, and type. Also used to take a screenshot.
    • time: The “Patience Spice”. To give time for actions and results to appear.
  • Cooking Process (How It Works):
    1. First, we wait for a moment using the “Patience Spice.”
    2. The “Orchestrator” moves the mouse to a pre-defined location and clicks.
    3. The “Orchestrator” types a search query.
    4. The “Orchestrator” presses the “Enter” key to submit the search.
    5. A delay is introduced with the “Patience Spice”.
    6. The “Orchestrator” then takes a screenshot of the screen.
  • Serving Suggestion (Outcome): A screenshot saved to the same directory as the script.

Recipe 7: The Text Spammer

  • Main Dish (Idea): A very simple appetizer: write “Hello world!” in a loop.
  • Ingredients (Concepts & Components):
    • pyautogui: The “Keyboard” part of the “Mouse and Keyboard Orchestrator”.
    • time: The “Patience Spice”. Adds small pauses between actions.
  • Cooking Process (How It Works):
    1. First, we wait for a moment using the “Patience Spice.”
    2. We enter an indefinite loop.
    3. Within the loop, the “Keyboard” functionality (pyautogui) types “Hello world!”, with a small pause between characters.
  • Serving Suggestion (Outcome): “Hello world!” continuously typed on the active window.

Leave a Reply

Your email address will not be published. Required fields are marked *