Skip to content

Instantly share code, notes, and snippets.

@robertnicjoo
Created August 15, 2024 14:48
Show Gist options
  • Save robertnicjoo/33b359742420125b2f18fcb3b16bf8a1 to your computer and use it in GitHub Desktop.
Save robertnicjoo/33b359742420125b2f18fcb3b16bf8a1 to your computer and use it in GitHub Desktop.
Send random text in batch with python
import random
import pyautogui as pg
import time
# List of affectionate words
words = ('Love', 'Dear', 'Kiss Kiss')
# Delay to switch to the correct window
time.sleep(8)
# Loop to send messages
for i in range(1, 6):
# Pick a random word
a = random.choice(words)
# Type the message
pg.write("You are my " + a)
# Send the message
pg.press('enter')
# Optional: Add a short delay between messages
time.sleep(1) # Adjust delay as needed
import random
import pyautogui as pg
import time
# List of affectionate words
words = ('Disturb',)
# Delay to switch to the correct window
time.sleep(8)
# Loop to send messages
for i in range(1, 6):
# Pick a random word
a = random.choice(words)
# Type the message
pg.write(f"{a} {i}")
# Send the message
pg.press('enter')
# Optional: Add a short delay between messages
time.sleep(1) # Adjust delay as needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment