Skip to content

Instantly share code, notes, and snippets.

@vladkorotnev
Last active December 14, 2015 03:58
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 vladkorotnev/5024458 to your computer and use it in GitHub Desktop.
Save vladkorotnev/5024458 to your computer and use it in GitHub Desktop.
Auto stop minecraft server
global minut
on tweet()
tell first window of application "Terminal"
if get custom title of selected tab is "Server Start.sh" then
do script ("me * Shutdown in " & minut & "minutes *") in selected tab
end if
end tell
set minut to minut - 1
end tweet
set minut to 5 --edit me
set origmin to minut
repeat origmin times
tweet()
delay 60
end repeat
tell first window of application "Terminal"
do script ("me Stopping!") in selected tab
delay 5
if get custom title of selected tab is "Server Start.sh" then
do script ("stop") in selected tab
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment