-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresetmoney.py
executable file
·52 lines (42 loc) · 1.36 KB
/
resetmoney.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import json as j
datapath = "userdata.txt"
class user:
def write(userid,stat,content):
try:
temp = open(datapath,"r")
data = j.loads(str(temp.read()))
data[str(userid)][stat] = content
temp.close()
except:
temp = open(datapath,"r")
data = j.loads(str(temp.read()))
data[str(userid)] = default_template
data[str(userid)][stat] = content
temp.close()
temp = open(datapath,"w")
temp.write(str(j.dumps(data)))
temp.close()
def read(userid,stat):
try:
temp = open(datapath,"r")
data = j.loads(str(temp.read()))
temp.close()
return data[str(userid)][stat]
except:
temp = open(datapath,"r")
data = j.loads(str(temp.read()))
temp.close()
data[str(userid)] = default_template
temp = open(datapath,"w")
temp.write(str(j.dumps(data)))
temp.close()
return data[str(userid)][stat]
def add(userid,stat,value):
user.write(userid,stat,user.read(userid,stat) + value)
temp = open(datapath,"r")
data = j.loads(str(temp.read()))
temp.close()
for i in data:
user.write(str(i),"money",100000)
user.write(str(i),"moneygained",0)
user.write(str(i),"moneylost",0)