backup
Void User 2 years ago
parent 97cf6b1959
commit 36f302ef95

@ -17,8 +17,8 @@ def dump():
minutes = ttime//60 ; ttime = ttime - minutes*60 minutes = ttime//60 ; ttime = ttime - minutes*60
seconds = ttime seconds = ttime
tmes = f'{i[:i.find("[")]} >> {hours}:{minutes}:{seconds}'+'\n tmes = tmes + f'{i[:i.find("[")]} >> {hours}:{minutes}:{seconds}'+'<br>'
return tmes' return tmes

@ -1,5 +1,5 @@
from mctools import PINGClient from mctools import PINGClient
ping = PINGClient('localhost') ping = PINGClient('play.dmcraft.online')
#stats = ping.get_stats() #stats = ping.get_stats()
#Work with JSON #Work with JSON
@ -29,19 +29,19 @@ while True:
sleep(1) sleep(1)
needsleep += 1 needsleep += 1
try: try:
# if True: # if True:
stats = ping.get_stats() stats = ping.get_stats()
if stats['players']['online'] != 0: if stats['players']['online'] != 0:
for i in stats['players']['sample']: for i in stats['players']['sample']:
#Add in db if not in db #Add in db if not in db
if i[0] not in db: if i[0] not in db:
db[i[0]] = 1 db[i[0]] = 1
write() write()
else: else:
db[i[0]] = db[i[0]] + 1 db[i[0]] = db[i[0]] + 1
write() write()
except: except Exception as e:
print('Maybe server offline') print('e')

Loading…
Cancel
Save