Spam Bot using PyAutoGUI (original) (raw)

Last Updated : 17 Jan, 2026

A spam bot is a program that automatically sends repeated messages to a target platform, chat or application. Spamming is the act of sending the same message repeatedly. Using Python’s PyAutoGUI library, we can automate mouse movements, keyboard inputs and clicks to simulate human actions.

Prerequisites

If PyAutoGUI is not installed, install it using below command in command prompt:

pip install pyautogui

Python Implementation

Below is the Python code for a spam bot using PyAutoGUI.

Python `

import pyautogui import time import datetime

time.sleep(2)

while True: print(datetime.datetime.now()) pyautogui.typewrite("Reminder: Drink water!") pyautogui.press("enter") time.sleep(31)

print(datetime.datetime.now())
pyautogui.typewrite("Reminder: Take medicine!")
pyautogui.press("enter")
time.sleep(31)

print(datetime.datetime.now())
pyautogui.typewrite("Reminder: Take the dog for a walk!")
pyautogui.press("enter")
time.sleep(31)

`

**Output

au

Snapshot of the Terminal

**Explanation:

Applications of a Spam Bot