Created
April 17, 2017 13:07
-
-
Save spaghetti-/52e4b41dc1caaa7f984804e2228fe579 to your computer and use it in GitHub Desktop.
lumberjack bot ayyy
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
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