Created
November 4, 2018 23:55
-
-
Save RayBB/3b713a4be9d8cd4a9e8fc0c0f9147c05 to your computer and use it in GitHub Desktop.
Automatically clicks stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: ./onePlusClicker.sh 15 | |
# a simple tool to automate clicking. Script takes # of clicks (which will be multiplied by ClicksPerLoop) as an argument | |
# You must set the following 5 variables for your computer before running | |
# The first four numbers are to set the bounds of where the program should click | |
# ClicksPerLoop is how many times it will click on each random spot generated | |
XMIN=550 | |
XMAX=810 | |
YMIN=260 | |
YMAX=600 | |
ClicksPerLoop=10 | |
echo $1 | |
echo $(date) | |
for (( i = 1; i <= $1; i++ )) | |
do | |
X=$(( ( RANDOM % ($XMAX-$XMIN) ) + $XMIN )) | |
Y=$(( ( RANDOM % ($YMAX-$YMIN) ) + $YMIN )) | |
# By default the delay is for up to 1000 miliseconds | |
DELAY=$(printf "0.%04d\n" $(( RANDOM % 1000 ))) | |
xdotool mousemove $X $Y \ | |
click --repeat $ClicksPerLoop 1 | |
echo -en "\r$i"; | |
sleep $DELAY | |
# Refreshes the webpage every 100 loops | |
if [ $(($i%100)) = 0 ]; then | |
xdotool key F5 | |
sleep 2 | |
fi | |
done | |
echo " loops completed with $ClicksPerLoop clicks per loop" | |
echo $(date) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment