Initial commit

This commit is contained in:
2019-07-04 21:30:17 +00:00
commit c67ce889a1
4 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import time
from mcrcon import MCRcon
IP = '127.0.0.1'
PASS = 'jean-qot'
empty_count = 0
def check_empty():
with MCRcon(IP, PASS) as mcr:
resp = mcr.command('/list')
return 'There are 0 of a max' in resp
while True:
if check_empty():
empty_count += 1
else:
empty_count = 0
if empty_count >= 15:
print('shutdown server!')
break
time.sleep(60)

View File

@@ -0,0 +1,2 @@
mcrcon==0.5.2
pkg-resources==0.0.0