Skip to content

Instantly share code, notes, and snippets.

@mungojelly
Last active June 16, 2017 07:27
Show Gist options
  • Save mungojelly/22fb0f5472b3d7ad8278dd1570ab250c to your computer and use it in GitHub Desktop.
Save mungojelly/22fb0f5472b3d7ad8278dd1570ab250c to your computer and use it in GitHub Desktop.
#!/bin/bash
# this script complains about needing a captcha, or clicks-- JUST ONCE
# so run it in a while loop or something if you'd like it to continue :)
colah=$(xwd -root -silent | convert xwd:- -depth 8 -crop "1x1+338+259" txt:- | grep -om1 '#\w\+')
# take a screenshot -->
# crop it to one pixel that (on my screen, adjust for yours) is the blue in the captcha -->
# get a hex code version of the color of that pixel
if
[ $colah == "#4A90E2" ]
# if it's the blue in the captcha
then
espeak -v en-sc "halp halp help help hipl hippo there is a captcha"
# complain in a scottish accent (i just like that espeak voice)
exit
# and get the heck outta doge, nothing us robots can do here
fi
# it wasn't a captcha, so let's try clicking a pixel
xdotool mousemove $((( RANDOM % 400 ) + 150)) $((( RANDOM % 400 ) + 150))
# go somewhere random-- adjust for where on your screen makes sense to click
eval $(xdotool getmouselocation --shell)
# put that location into $X and $Y
while [ $(xwd -root -silent | convert xwd:- -depth 8 -crop "1x1+$X+$Y" txt:- | grep -om1 '#\w\+') == "#E50000" ]
# for as long as that's the red of the red pixels
do
xdotool mousemove $((( RANDOM % 400 ) + 150)) $((( RANDOM % 400 ) + 150))
# go to another random location this is the same line i know DRY DRY sorry
eval $(xdotool getmouselocation --shell)
# put that in $X and $Y to check there
done
# we kept moving as long as the pixel was red
# so we should be on a non-red pixel
xdotool click 1
# click here
# fin
# victory to the united left in the great pixelwar <3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment