Skip to content

Instantly share code, notes, and snippets.

@inertia186
Last active December 15, 2015 05:29
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 inertia186/5208884 to your computer and use it in GitHub Desktop.
Save inertia186/5208884 to your computer and use it in GitHub Desktop.
[Minecraft, SMP] Here's how the staff can invoke the mc-slap.rb script I posted previously. As always, this assumes you run the Minecraft server in a screen session named "minecraft".
#!/bin/bash
MC="/Users/steve/Minecraft"
RUBY="/Users/steve/.rvm/rubies/ruby-1.9.3-p374/bin/ruby"
if [ -z "$1" ]; then
echo $0 \[target\]
fi
target=$1
slap=`$RUBY $MC/scripts/mc-slap.rb $target`
cmd="me $slap"
bash -c "screen -p 0 -S minecraft -X eval 'stuff \"$cmd\"\015'"
@inertia186
Copy link
Author

This shell script requires the mc-slap.rb script installed (or symbolically linked) in scripts:

https://gist.github.com/inertia186/5002463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment