Skip to content

Commit

Permalink
v1.0.2
Browse files Browse the repository at this point in the history
Fortnite stat tracker, QoL & Graphical user interface update
  • Loading branch information
Burndowntheworld authored Feb 21, 2022
1 parent 8394d4a commit 5a025f3
Showing 1 changed file with 188 additions and 29 deletions.
217 changes: 188 additions & 29 deletions fortnite_stat_tracker.pyw
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
from tkinter import *
import webbrowser
import os
from tkinter import messagebox
import requests
from bs4 import BeautifulSoup
from tkinter import ttk
from PIL import Image, ImageTk

currentlocation = os.path.dirname(os.path.abspath(__file__))

root = Tk()
root.title("Fortnite Stat Checker")
root.title("Valorant Stat Checker")
root.resizable(False, False)
root.iconphoto(False, PhotoImage(file=f'{currentlocation}/valorant.png'))
root.overrideredirect(True)
root.geometry("500x325")
root.attributes("-topmost",1)

def rgb_hack(rgb):
return "#%02x%02x%02x" % rgb

root.config(bg=rgb_hack((41, 41, 41)))

currentlocation = os.path.dirname(os.path.abspath(__file__))

navbar = Menu(root)
root.config(menu=navbar)

other_stats_menu = Menu(navbar)
navbar.add_cascade(label="Other Stat Trackers", menu=other_stats_menu)
other_stats_menu.add_command(label="Valorant", command=lambda: valorant())
other_stats_menu.add_command(label="Hypixel", command=lambda: hypixel())
other_stats_menu.add_command(label="Hypixel SB", command=lambda: hypixelsb())

fortniteextras = Menu(navbar)
navbar.add_cascade(label="Fortnite Extras", menu=fortniteextras)
fortniteextras.add_command(label="Item Shop", command=lambda: shop())

def valorant():
os.system(f'C:/Python38/python.exe "{currentlocation}/val_stat_tracker.pyw"')
Expand All @@ -34,35 +39,189 @@ def hypixelsb():
def shop():
webbrowser.open_new("https://fortnitetracker.com/shop")

def searchbtn():

def searchandopen():
global namebox
name = namebox.get(1.0, "end-1c")
link = f"https://fortnitetracker.com/profile/all/{name}"
linkbtn = Button(root, text="View Stats", height=1,width=20,command=lambda: openStats(link))
linkbtn.place(y=290,x=190)
if len(name) >= 4:
link = f"https://fortnitetracker.com/profile/all/{name}"
webbrowser.open_new(link)
#showstats(link)
else:
messagebox.showinfo("ERROR", "Not Enough Info Provided")



def showcredits():
creditwindow = Tk()
creditwindow.title("Credits")

window_height = 400
window_width = 425

screen_width = creditwindow.winfo_screenwidth()
screen_height = creditwindow.winfo_screenheight()

x_cordinate = int((screen_width/2) - (window_width/2))
y_cordinate = int((screen_height/2) - (window_height/2))

creditwindow.geometry("{}x{}+{}+{}".format(window_width, window_height, x_cordinate, y_cordinate))

burndowntheworld = Label(creditwindow, text="Made By Burndowntheworld", fg="white", bg="black")
discord = Label(creditwindow, text="burndowntheworld#6969", fg="white", bg="black")
email = Label(creditwindow, text="burndowntheworld1@gmail.com", fg="white", bg="black")


copyrightwarning = Label(creditwindow, text="Current form of our 'fortnite stat tracker' app is subject to change due to copyright strikes.", font=("helvetica",7), fg="white", bg="black")
trackerggcredit = Label(creditwindow, text="All Statistics' data pulled from tracker.gg.", font=("helvetica",7), fg="white", bg="black")
notpartneredwithtrackergg = Label(creditwindow, text="We are not affiliated, or partnered with 'Tracker Network'. We do not work for/with 'Tracker Network'.", font=("helvetica",7), fg="white", bg="black")


burndowntheworld.pack(pady=(100,0))
discord.pack()
email.pack()

def openStats(link):
trackerggcredit.pack(anchor="sw", pady=(155,0))
notpartneredwithtrackergg.pack(anchor="sw")
copyrightwarning.pack(anchor="sw")


creditwindow.resizable(False, False)
creditwindow.overrideredirect(1)
creditwindow.attributes("-topmost", "1")
creditwindow.configure(bg='black')

creditsclosebutton = Button(creditwindow, text="X", height=1, width=1, bg="black", fg="white", command=lambda: creditwindow.destroy())
creditsclosebutton.place(y=5, x=400)


def openinbrowser(link):
webbrowser.open_new(link)


window_height = 325
window_width = 500
def duosplit(string):
words = string.split()
grouped_words = [' '.join(words[i: i + 2]) for i in range(0, len(words), 2)]
return grouped_words



def nothing():
pass



def move(e):
root.geometry(f"+{e.x_root}+{e.y_root}")



def openotherappsmenu():
otherapps.pack_forget()
othermenu.pack_forget()

global valorantl, hypixell, hypixelsbl, otherappsbackl

valorantl = Label(menubar, text="Valorant", bg="MediumOrchid4", fg="white")
valorantl.pack(side=LEFT, padx=20)
valorantl.bind('<Button-1>',lambda f: valorant())

screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
hypixell = Label(menubar, text="Hypixel", bg="MediumOrchid4", fg="white")
hypixell.pack(side=LEFT, padx=(0,20))
hypixell.bind('<Button-1>', lambda h: hypixel())

x_cordinate = int((screen_width/2) - (window_width/2))
y_cordinate = int((screen_height/2) - (window_height/2))
hypixelsbl = Label(menubar, text="Hypixel SB", bg="MediumOrchid4", fg="white")
hypixelsbl.pack(side=LEFT, padx=(0,20))
hypixelsbl.bind('<Button-1>', lambda hsb: hypixelsb())

root.geometry("{}x{}+{}+{}".format(window_width, window_height, x_cordinate, y_cordinate))
otherappsbackl = Label(menubar, text="Back", bg="MediumOrchid4", fg="white")
otherappsbackl.pack(side=LEFT, padx=(0,20))
otherappsbackl.bind('<Button-1>', lambda b: otherappsmenuback())

namebox = Text(root, height=2, width=25)

def otherappsmenuback():
valorantl.pack_forget()
hypixell.pack_forget()
hypixelsbl.pack_forget()
otherappsbackl.pack_forget()
defaultmenu()



def openothermenumenu():
otherapps.pack_forget()
othermenu.pack_forget()

global creditsl, othermenubackl

creditsl = Label(menubar, text="Credits", bg="MediumOrchid4", fg="white")
creditsl.pack(side=LEFT, padx=20)
creditsl.bind('<Button-1>',lambda c: showcredits())

othermenubackl = Label(menubar, text="Back", bg="MediumOrchid4", fg="white")
othermenubackl.pack(side=LEFT, padx=(0,20))
othermenubackl.bind('<Button-1>',lambda b: othermenuback())



def othermenuback():
creditsl.pack_forget()
othermenubackl.pack_forget()
defaultmenu()



def defaultmenu():
global otherapps, valorantextras, othermenu
otherapps = Label(menubar, text="Other Stat Trackers", bg="MediumOrchid4", fg="white")
otherapps.pack(side=LEFT, padx=20)
otherapps.bind('<Button-1>',lambda s: openotherappsmenu())

othermenu = Label(menubar, text="Other", bg="MediumOrchid4", fg="white")
othermenu.pack(side=LEFT, padx=(0,20))
othermenu.bind('<Button-1>', lambda o: openothermenumenu())



namebox = Text(root, height=2, width=25, bg=rgb_hack((100, 100, 100)), fg="white")
namebox.place(y=100,x=150)
nameboxtitle = Label(root, text="Name", font=("helvetica",10))
nameboxtitle = Label(root, text="Name", font=("helvetica",10), bg=rgb_hack((41, 41, 41)), fg="white")
nameboxtitle.place(y=70,x=225)

searchforplayerbutton = Button(root, text="Search For Player Stats", height=1, width=25, bg="SystemButtonFace", command=lambda: searchbtn())
searchforplayerbutton.place(y=250,x=175)
searchforplayerbutton = Button(root, text="Search For Player Stats", height=1, width=25, bg=rgb_hack((100, 100, 100)), fg="white", command=lambda: searchandopen())
searchforplayerbutton.place(y=185,x=162)



title_bar = Frame(root, bg=rgb_hack((80, 80, 80)), relief="raised", bd=0)
title_bar.pack(expand=1, fill=X, anchor="nw")
title_bar.bind('<B1-Motion>', move)


title_bar_title = Label(title_bar, text="Fortnite Stat Tracker", bg=rgb_hack((80,80,80)),bd=0,fg='white',font=("helvetica", 10),highlightthickness=0)
title_bar_title.pack(side=LEFT, pady=6, padx=(10,0))


close_button = Button(title_bar, text=' × ', command=root.destroy,bg=rgb_hack((80, 80, 80)),padx=2,pady=2,font=("calibri", 13),bd=0,fg='white',highlightthickness=0)
close_button.pack(side=RIGHT)


menubar = Frame(root, bg="Orchid4", borderwidth=2, relief="ridge", highlightcolor="purple2")
menubar.pack(expand=1, fill=X, anchor="s")

menubartitle = Label(menubar, text=" MENU ", bg="Orchid4", fg="white")
menubartitle.pack(side=LEFT, pady=(15,15))


otherapps = Label(menubar, text="Other Stat Trackers", bg="MediumOrchid4", fg="white")
otherapps.pack(side=LEFT, padx=20)
otherapps.bind('<Button-1>',lambda s: openotherappsmenu())

othermenu = Label(menubar, text="Other", bg="MediumOrchid4", fg="white")
othermenu.pack(side=LEFT, padx=(0,20))
othermenu.bind('<Button-1>', lambda o: openothermenumenu())

root.bind('<Return>', lambda r: searchandopen())
root.bind('<Escape>', lambda q: root.destroy())

root.mainloop()
root.mainloop()

0 comments on commit 5a025f3

Please sign in to comment.