Skip to content

Instantly share code, notes, and snippets.

@spaghetti-
Created April 17, 2017 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spaghetti-/52e4b41dc1caaa7f984804e2228fe579 to your computer and use it in GitHub Desktop.
Save spaghetti-/52e4b41dc1caaa7f984804e2228fe579 to your computer and use it in GitHub Desktop.
lumberjack bot ayyy
function right() {
screencapture -R706,427,1,1 -t bmp /tmp/pixel.bmp
echo `xxd -p -l 3 -s 54 /tmp/pixel.bmp`
rm /tmp/pixel.bmp
}
function left() {
screencapture -R593,424,1,1 -t bmp /tmp/pixel.bmp
echo `xxd -p -l 3 -s 54 /tmp/pixel.bmp`
rm /tmp/pixel.bmp
}
while [ true ]
do
r=$(left)
if [[ $r == "3874a1" ]]; then
echo "left"
echo 'tell application "System Events" to tell process "Telegram" to key code 124' | osascript
echo 'tell application "System Events" to tell process "Telegram" to key code 124' | osascript
else
echo "right"
echo 'tell application "system events" to tell process "telegram" to key code 123' | osascript
echo 'tell application "system events" to tell process "telegram" to key code 123' | osascript
fi
sleep 0.15
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment