Skip to content

Instantly share code, notes, and snippets.

@manoelcampos
Last active January 25, 2019 16:58
Show Gist options
  • Save manoelcampos/b4f2621b9b6d5d6337e2e15864abd2fe to your computer and use it in GitHub Desktop.
Save manoelcampos/b4f2621b9b6d5d6337e2e15864abd2fe to your computer and use it in GitHub Desktop.
Sends a key and mouse click repeatedly, at a defined time interval
#!/bin/bash
# Sends a key and mouse click repeatedly, at a defined time interval.
# Author - Manoel Campos
clear
#Checks if xdotool command is installed. If not, installs it
xdotool -v 2>/dev/null || echo 'Installing required tools...' && sudo apt-get install xdotool -y > /dev/null
echo ''
echo 'Bot started. Press CTRL+C to stop'
while true
do
# waits some seconds
sleep 2
# click 1 - left mouse button
xdotool click 1 key w
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment