Update
This commit is contained in:
parent
97cf6b1959
commit
36f302ef95
4
dump.py
4
dump.py
@ -17,8 +17,8 @@ def dump():
|
||||
minutes = ttime//60 ; ttime = ttime - minutes*60
|
||||
seconds = ttime
|
||||
|
||||
tmes = f'{i[:i.find("[")]} >> {hours}:{minutes}:{seconds}'+'\n
|
||||
return tmes'
|
||||
tmes = tmes + f'{i[:i.find("[")]} >> {hours}:{minutes}:{seconds}'+'<br>'
|
||||
return tmes
|
||||
|
||||
|
||||
|
||||
|
30
ping.py
30
ping.py
@ -1,5 +1,5 @@
|
||||
from mctools import PINGClient
|
||||
ping = PINGClient('localhost')
|
||||
ping = PINGClient('play.dmcraft.online')
|
||||
#stats = ping.get_stats()
|
||||
|
||||
#Work with JSON
|
||||
@ -29,19 +29,19 @@ while True:
|
||||
sleep(1)
|
||||
needsleep += 1
|
||||
|
||||
try:
|
||||
# if True:
|
||||
stats = ping.get_stats()
|
||||
if stats['players']['online'] != 0:
|
||||
for i in stats['players']['sample']:
|
||||
#Add in db if not in db
|
||||
if i[0] not in db:
|
||||
db[i[0]] = 1
|
||||
write()
|
||||
else:
|
||||
db[i[0]] = db[i[0]] + 1
|
||||
write()
|
||||
try:
|
||||
# if True:
|
||||
stats = ping.get_stats()
|
||||
if stats['players']['online'] != 0:
|
||||
for i in stats['players']['sample']:
|
||||
#Add in db if not in db
|
||||
if i[0] not in db:
|
||||
db[i[0]] = 1
|
||||
write()
|
||||
else:
|
||||
db[i[0]] = db[i[0]] + 1
|
||||
write()
|
||||
|
||||
except:
|
||||
print('Maybe server offline')
|
||||
except Exception as e:
|
||||
print('e')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user