-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPixelTagzZ.py
More file actions
331 lines (300 loc) · 13.1 KB
/
PixelTagzZ.py
File metadata and controls
331 lines (300 loc) · 13.1 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
""" Documentation Section: """
#! Status: ONLINE
#! Version: 1.0
#! Latest Modification (Date / Month / Year): "10 / 10 / 2024"
#!</>
""" Built-In Modules Imports: """
#? SQL Connector Module:
import mysql.connector
#? Random Module:
import random
#!</>
""" Global Declaration: """
#? Project Name
projectName = "PixelTagzZ"
#? Project Utility:
projectUtility = "Valorant - Riot Games Inc."
#? Dev Name
devName = "Yashank Yadav"
#? Dev In-Game Name
devInGameName = "ChampKillzZ"
#? Dev Youtube
devGamingYoutube = "ChampKillzZ"
#? Dev Instagram:
devGamingInstagram = "champkillzz"
#!</>
""" User-Defined Functions: """
#? Connecting To Database Function:
def databaseConnectFunc():
myDB = mysql.connector.connect(
host = "localhost",
port = "3306",
username = "********",
passwd = "******",
database = "PixelTagzZ"
)
myCursor = myDB.cursor()
return myDB, myCursor
#? Greeting Message Function:
def welcomeMsg():
print(f"Welcome To {projectName}!!")
#? User In-Game Name Function:
def userInGameNameFunc():
userInGameName = input(f"Kindly, enter your in-game name: ")
return userInGameName
#? User Age Function:
def userAgeFunc():
while True:
try:
userAge = int(input("Kindly, enter your age: "))
if userAge in range(1, 101):
break
else:
print("\nAge must be between 1 and 100.\n")
except:
print("\nInvalid input.\n")
return userAge
#? User Country Function:
def userCountryFunc():
userCountry = input(f"Kindly, enter your country name: ").upper()
return userCountry
#? User Social Handles Function:
def userSocialsFunc():
userYoutubeConfirm = userTwitchConfirm = userInstagramConfirm = ""
while True:
print("Do you have a YouTube channel?")
userYoutubeConfirm = input(f"Type 'YES' (or) 'NO': ").lower()
if userYoutubeConfirm in ['yes', 'no']:
break
else:
print(f"\nInvalid input.\n")
while True:
print("Do you have a Twitch channel?")
userTwitchConfirm = input(f"Type 'YES' (or) 'NO': ").lower()
if userTwitchConfirm in ['yes', 'no']:
break
else:
print(f"\nInvalid input.\n")
while True:
print("Do you have an Instagram account?")
userInstagramConfirm = input(f"Type 'YES' (or) 'NO': ").lower()
if userInstagramConfirm in ['yes', 'no']:
break
else:
print(f"\nInvalid input.\n")
return userYoutubeConfirm, userTwitchConfirm, userInstagramConfirm
#? Project Description Function:
def projectDescriptionFunc(userInGameName):
print(f"Hello, {userInGameName}! I'm {devName}.\n"
f"I have faced a lot of difficulties in finding optimized tags for my valorant gaming content.\n"
f"Hence was motivated to build a tags generator for myself and the gaming community.\n"
f"{projectName} will provide you with utmost \"Trending\" & \"Optimized\" tags!")
#? Gratitude Message Function:
def gratitudeMsg(userInGameName):
print(f"Thank you so much for using {projectName}!\n"
f"You can utilize these tags across various media platforms.\n"
f"Do not forget to,\n"
f"MENTION: (@{devGamingYoutube}) on YouTube.\n"
f"TAG: (#{devGamingInstagram}) on Instagram.\n"
f"Have a great day, {userInGameName}!\n")
#? Disconnecting The Database Function:
def databaseDisconnectFunc(myDB, myCursor):
myCursor.close()
myDB.close()
#!</>
""" Class: """
#? Valorant Class:
class Valorant():
#? Initialization Function:
def __init__(self, myCursor):
myCursor.execute("SELECT * FROM ValorantGameData;")
valorantGameData = myCursor.fetchall()
valorantModes = []
valorantMaps = []
valorantAgents = []
valorantWeapons = []
valorantRanks = []
categoryLists = {
0: valorantModes, # Modes
1: valorantMaps, # Maps
2: valorantAgents, # Agents
3: valorantWeapons, # Weapons
4: valorantRanks # Ranks
}
for row in valorantGameData:
for index, item in enumerate(row):
if item != "":
categoryLists[index].append(item)
self.modes = valorantModes
self.maps = valorantMaps
self.agents = valorantAgents
self.weapons = valorantWeapons
self.ranks = valorantRanks
#? Representation Function:
def __str__(self):
return (f"Valorant is a 5v5 character-based tactical first-person shooter (FPS).\n"
f"Including '{len(self.modes)}' modes: {self.modes}.\n"
f"With '{len(self.maps)}' different maps: {self.maps}.\n"
f"Top level '{len(self.agents)}' agents: {self.agents}.\n"
f"Most powerful '{len(self.weapons)}' weapons: {self.weapons}.\n"
f"And '{len(self.ranks)}' ranks to compete: {self.ranks}.")
#? User Game Function:
def userGame(self):
print(f"Kindly, describe your gaming experience.")
while True:
print(f"\nWhich valorant mode were you playing?")
print(f"{self.modes}")
userValorantMode = input (f"Kindly, enter the mode name: \n").upper()
if userValorantMode in self.modes:
break
else:
print(f"\nInvalid input.\n")
while True:
print(f"\nWhich valorant map were you playing on?")
print(f"{self.maps}")
userValorantMap = input(f"Kindly, enter the map name: \n").upper()
if userValorantMap in self.maps:
break
else:
print(f"\nInvalid input.\n")
while True:
print("\nWhich valorant agent were you playing with?")
print(f"{self.agents}")
userValorantAgent = input(f"Kindly, enter the agent name: \n").upper()
if userValorantAgent in self.agents:
break
else:
print(f"\nInvalid input.\n")
while True:
print("\nWhich valorant weapon were you playing with?")
print(f"{self.weapons}")
userValorantWeapon = input(f"Kindly, enter the weapon name: \n").upper()
if userValorantWeapon in self.weapons:
break
else:
print(f"\nInvalid input.\n")
while True:
print("\nWhat's your rank in valorant?")
print(f"{self.ranks}")
userValorantRank = input(f"Kindly, enter the rank name: \n").upper()
if userValorantRank in self.ranks:
break
else:
print(f"\nInvalid input.\n")
return userValorantMode, userValorantMap, userValorantAgent, userValorantWeapon, userValorantRank
#? User Gamer Tags Algorithm:
def userGamerTagsAlgo(myCursor):
myCursor.execute("SELECT * FROM ValorantTagsData;")
valorantTagsData = myCursor.fetchall()
valorantGamerTags = []
valorantGamingTags = []
valorantGameTags = []
categoryLists = {
0: valorantGamerTags, # Gamer
1: valorantGamingTags, # Gaming
2: valorantGameTags, # Game
}
for row in valorantTagsData:
for index, item in enumerate(row):
if item != "":
categoryLists[index].append(item)
userValorantGamerTags = random.sample(valorantGamerTags, k = 5)
userValorantGamingTags = random.sample(valorantGamingTags, k = 5)
userValorantGameTags = random.sample(valorantGameTags, k = 10)
return userValorantGamerTags, userValorantGamingTags, userValorantGameTags
#? User Valorant Tags Algorithm:
def userValorantTagsAlgo(myCursor, userValorantMode, userValorantMap, userValorantAgent, userValorantWeapon, userValorantRank):
userValorantTags = []
valorantModeTags = []
if userValorantMode in ["COMPETITIVE", "UNRATED", "SPIKERUSH", "DEATHMATCH", "TEAMDEATHMATCH"]:
valorantModeTags = [f"VALORANT{userValorantMode}", f"{userValorantMode}"]
else:
valorantModeTags = [f"VALORANT{userValorantMode}"]
valorantMapTags = [f"VALORANT{userValorantMap}", f"VALORANT{userValorantMap}MAPGAMEPLAY"]
valorantAgentTags = [f"VALORANT{userValorantAgent}", f"{userValorantAgent}", f"VALORANT{userValorantAgent}GAMEPLAY"]
valorantWeaponTags = [f"VALORANT{userValorantWeapon}", f"VALORANT{userValorantWeapon}GAMEPLAY"]
valorantRankTags = [f"VALORANT{userValorantRank}", f"{userValorantRank}VALORANT", f"VALORANT{userValorantRank}LOBBY"]
userValorantModeTag = random.choice(valorantModeTags)
userValorantMapTag = random.choice(valorantMapTags)
userValorantAgentTag = random.choice(valorantAgentTags)
userValorantWeaponTag = random.choice(valorantWeaponTags)
userValorantRankTag = random.choice(valorantRankTags)
userValorantTags.extend([userValorantModeTag, userValorantMapTag, userValorantAgentTag, userValorantWeaponTag, userValorantRankTag])
return userValorantTags
#? User Social Tags Algorithm:
def userSocialTagsAlgo(userYoutubeConfirm, userTwitchConfirm, userInstagramConfirm):
userSocialTags = []
if userYoutubeConfirm == 'yes' and userTwitchConfirm == 'yes' and userInstagramConfirm == 'yes':
userSocialTags = ["YOUTUBEGAMING", "TWITCHGAMING", "INSTAGRAMGAMING"]
if userYoutubeConfirm == 'yes' and userTwitchConfirm == 'no' and userInstagramConfirm == 'yes':
userSocialTags = ["YOUTUBEGAMING", "INSTAGRAMGAMING", "CONTENTCREATOR"]
if userYoutubeConfirm == 'yes' and userTwitchConfirm == 'yes' and userInstagramConfirm == 'no':
userSocialTags = ["YOUTUBEGAMING", "TWITCHGAMING", "STREAMER"]
if userYoutubeConfirm == 'no' and userTwitchConfirm == 'yes' and userInstagramConfirm == 'yes':
userSocialTags = ["INSTAGRAMGAMING", "TWITCHGAMING", "CONTENTCREATOR"]
if userYoutubeConfirm == 'no' and userTwitchConfirm == 'no' and userInstagramConfirm == 'no':
userSocialTags = ["ESPORTSPLAYER", "PROFESSIONALGAMER", "NERD"]
return userSocialTags
#? User Tags Algorithm:
def userTagsAlgo(userValorantGamerTags, userValorantGamingTags, userValorantGameTags, userValorantTags, userSocialTags, userCountry, userInGameName):
userTagsList = []
for tag in userValorantGamerTags:
userTagsList.append(f"#{tag}")
for tag in userValorantGamingTags:
userTagsList.append(f"#{tag}")
for tag in userValorantGameTags:
userTagsList.append(f"#{tag}")
for tag in userValorantTags:
userTagsList.append(f"#{tag}")
for tag in userSocialTags:
userTagsList.append(f"#{tag}")
random.shuffle(userTagsList)
userTagsString = ""
for tag in userTagsList:
if tag == userTagsList[-1]:
userTagsString += (tag)
else:
userTagsString += (tag+" ")
userTags = (userTagsString + f" #VALORANT{userCountry}" + f" #{userInGameName}").lower()
print(f"\nVALORANT TAGS :-\n")
print(userTags)
#!</>
""" Logic: """
if __name__ == '__main__':
#? Connecting To Database:
myDB, myCursor = databaseConnectFunc()
#? Initialization:
valorantGame = Valorant(myCursor)
#? Greeting Message:
welcomeMsg()
print()
#? User In-Game Name:
userInGameName = userInGameNameFunc()
print()
#? User Age:
userAge = userAgeFunc()
print()
#? User Country:
userCountry = userCountryFunc()
print()
#? User Social Handles:
userYoutubeConfirm, userTwitchConfirm, userInstagramConfirm = userSocialsFunc()
print()
#? Project Description:
projectDescriptionFunc(userInGameName)
print()
#? User Game:
userValorantMode, userValorantMap, userValorantAgent, userValorantWeapon, userValorantRank = Valorant.userGame(valorantGame)
#? User Gamer Tags Algorithm:
userValorantGamerTags, userValorantGamingTags, userValorantGameTags = Valorant.userGamerTagsAlgo(myCursor)
#? User Valorant Tags Algorithm:
userValorantTags = Valorant.userValorantTagsAlgo(myCursor, userValorantMode, userValorantMap, userValorantAgent, userValorantWeapon, userValorantRank)
#? User Social Tags Algorithm:
userSocialTags = Valorant.userSocialTagsAlgo(userYoutubeConfirm, userTwitchConfirm, userInstagramConfirm)
#? User Tags Algorithm:
Valorant.userTagsAlgo(userValorantGamerTags, userValorantGamingTags, userValorantGameTags, userValorantTags, userSocialTags, userCountry, userInGameName)
#? Gratitude Message:
print()
gratitudeMsg(userInGameName)
#? Disconnecting The Database:
databaseDisconnectFunc(myDB, myCursor)