-
Notifications
You must be signed in to change notification settings - Fork 0
/
antispam.py
91 lines (90 loc) · 2.71 KB
/
antispam.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import sqlite3
import json
print(f"Select method\n1. Clear account for name\n2. Clear account for trophies\n3. Clear Club\n4. Clear FriendList\n5. Clear Bot-Club\n6. Clear account for Name++\n7. Clear ClubList")
who=input()
if who == '1':
print("ok")
config = open('config.json', 'r')
content = config.read()
settings = json.loads(content)
conn = sqlite3.connect('database/Player/plr.db')
cursor = conn.cursor()
cursor.execute("SELECT * FROM plrs")
rows = cursor.fetchall()
for row in rows:
if row[2] in settings['DelName']:
cursor.execute("DELETE FROM plrs WHERE lowID=?", (row[1],))
print(row[2])
conn.commit()
conn.close()
elif who == '2':
print("ok")
config = open('config.json', 'r')
content = config.read()
settings = json.loads(content)
conn = sqlite3.connect('database/Player/plr.db')
cursor = conn.cursor()
cursor.execute("SELECT * FROM plrs")
rows = cursor.fetchall()
for row in rows:
if row[3] == 0:
cursor.execute("DELETE FROM plrs WHERE lowID=?", (row[1],))
print(f"{row[3]}")
conn.commit()
conn.close()
elif who == '3':
conn = sqlite3.connect("database/Player/plr.db")
c = conn.cursor()
c.execute("UPDATE plrs SET clubID=0")
c.execute("UPDATE plrs SET clubRole=0")
c.execute("SELECT * FROM plrs")
conn.commit()
conn.close()
elif who == '4':
conn = sqlite3.connect("database/Player/plr.db")
cursor = conn.cursor()
cursor.execute('SELECT * FROM plrs')
rows = cursor.fetchall()
for row in rows:
friends_json = []
cursor.execute('UPDATE plrs SET friends=? WHERE lowID=?', (json.dumps(friends_json), row[1]))
conn.commit()
conn.close()
elif who == '5':
config = open('config.json', 'r')
content = config.read()
settings = json.loads(content)
conn = sqlite3.connect("database/Club/clubs.db")
cursor = conn.cursor()
cursor.execute("SELECT * FROM clubs")
rows = cursor.fetchall()
for row in rows:
if row[1] in settings['ClubBlock']:
print(row[1])
cursor.execute("DELETE FROM clubs WHERE clubID=?", (row[0],))
conn.commit()
conn.close()
elif who == '6':
config = open('config.json', 'r')
content = config.read()
settings = json.loads(content)
conn = sqlite3.connect('database/Player/plr.db')
cursor = conn.cursor()
cursor.execute("SELECT * FROM plrs WHERE name LIKE 'player%'")
rows = cursor.fetchall()
for row in rows:
cursor.execute("DELETE FROM plrs WHERE lowID=?", (row[1],))
print(row[2])
conn.commit()
conn.close()
elif who == '7':
config = open('config.json', 'r')
content = config.read()
settings = json.loads(content)
conn = sqlite3.connect("database/Club/clubs.db")
cursor = conn.cursor()
cursor.execute("SELECT * FROM clubs")
rows = cursor.fetchall()
cursor.execute("DELETE FROM clubs")
conn.commit()
conn.close()