-
Notifications
You must be signed in to change notification settings - Fork 1
/
stats.py
executable file
·34 lines (24 loc) · 949 Bytes
/
stats.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
import os
users = os.listdir('/home')
for u in users:
worldPath = '/home/' + u + '/.world'
if os.path.exists(worldPath):
print('')
print('[*] ' + u)
locFile = open(worldPath + '/loc','r')
for line in [x.strip('\n') for x in locFile]:
print(' [LC] ' + line)
locFile.close()
configFile = open(worldPath + '/config','r')
for line in [x.strip('\n') for x in configFile]:
print(' [CF] ' + line.replace('=',': '))
configFile.close()
inventoryFile = open(worldPath + '/inventory','r')
for line in [x.strip('\n') for x in inventoryFile]:
print(' [IN] ' + line.split(' : ')[0])
inventoryFile.close()
rooms = os.listdir(worldPath + '/rooms')
for room in rooms:
if "." not in room:
print(' [RM] ' + room.replace('n','-').replace('_',','))