Last active
September 21, 2019 06:52
-
-
Save 1rover1/fb00d0b5d0ec574c2d61adf682b360fe to your computer and use it in GitHub Desktop.
Minecraft command line tools
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
# Tail server logs for people joining the game | |
# Send to SNS, SMS, Hue, etc | |
tail -n 0 -F MineCraft_server/logs/latest.log | grep --line-buffered "joined the game" | while read line; do echo "joined $line"; done | |
# Caps lock | |
# Use at a mob spawner when AFK to attack every x seconds. Obvs update the sleep time and window name as required | |
while sleep 3; do if [[ `xdotool getactivewindow getwindowname` == "Minecraft 1.13.2" && $( xset q | grep Caps | awk '{print $4}' ) == "on" ]]; then xdotool click 1; fi; done | |
# AFK fishing | |
#/usr/bin/env bash | |
LAST_CAPS_STATUS="" | |
while sleep 0.1; do | |
# Only do trickery if we're in the Minecraft window | |
if [[ `xdotool getactivewindow getwindowname` == "Minecraft 1.14.4" ]]; then | |
# Get the current CAPSLOCK status | |
CAPS_STATUS=$( xset q | grep Caps | awk '{print $4}' ) | |
if [[ "$CAPS_STATUS" != "$LAST_CAPS_STATUS" ]]; then | |
if [[ "$CAPS_STATUS" == "on" ]]; then | |
# If CAPS status has changed and it's now ON then mousedown | |
xdotool mousedown 3 | |
else | |
# If CAPS status has changed and it's now OFF then mouseup | |
xdotool mouseup 3 | |
fi | |
fi | |
LAST_CAPS_STATUS=$CAPS_STATUS | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment