Skip to content

Instantly share code, notes, and snippets.

@1rover1
Last active September 21, 2019 06:52
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 1rover1/fb00d0b5d0ec574c2d61adf682b360fe to your computer and use it in GitHub Desktop.
Save 1rover1/fb00d0b5d0ec574c2d61adf682b360fe to your computer and use it in GitHub Desktop.
Minecraft command line tools
# 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