Advertisement
aikikode

Minercaft Set Hotkeys

Mar 1st, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.92 KB | None | 0 0
  1. #!/bin/bash -
  2. #===============================================================================
  3. #
  4. #          FILE:  minecraft_send_msg.sh
  5. #
  6. #         USAGE:  ./minecraft_send_msg.sh [message]
  7. #
  8. #   DESCRIPTION:  Send specified message to minecraft game chat
  9. #                 Bind commands ".../minecraft_send_msg.sh [msg1|msg2|msg3]" to
  10. #                 necessary system hotkeys
  11. #
  12. #       OPTIONS:  ---
  13. #  REQUIREMENTS:  xdotool
  14. #       CREATED:  03/02/2012 01:15:06 AM MSK
  15. #      REVISION:  ---
  16. #===============================================================================
  17.  
  18. #set -o nounset                              # Treat unset variables as an error
  19.  
  20. window="minecraft"
  21.  
  22. # Open chat window
  23. xdotool search --name $window key  --delay 1 --window %@ t
  24. # Type message
  25. xdotool search --name $window type --delay 1 --window %@ "$1"
  26. # Send message
  27. xdotool search --name $window key  --delay 1 --window %@ "Return"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement