Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Simple Anti-AFK script for World of Warcraft
- #
- # Author: Michael Koch
- # Version: 2013-09-23
- # License: GPL v3
- if [ -t 0 ]; then
- if [[ ! "$(which xte)" ]]; then
- echo "xautomation needs to be installed."
- sudo apt-get install xautomation
- fi
- if [[ ! "$(which xdotool)" ]]; then
- echo "xdotool needs to be installed."
- sudo apt-get install xdotool
- fi
- while true; do
- window_title="$(xdotool getwindowname $(xdotool getwindowfocus))"
- if [[ ! "$window_title" == "World of Warcraft" ]]; then
- echo "WoW is NOT focused!"
- sleep 2
- else
- echo "WoW is focused. Doing anti-afk stuffery."
- xte "keydown w"
- xte "keyup w"
- xte "keydown s"
- xte "keyup s"
- sleep 600
- fi
- done
- else
- x-terminal-emulator -e "$0"
- fi
Advertisement
Add Comment
Please, Sign In to add comment