Beispiel #1
0
def maps(summ):
    count = 0
    os.system(clear_fn)
    quit = ''
    for x in full:
        if summ == x['summoner']:
            count += 1
            print 'Champion: %s' % (x['champion'])
            print 'Date: %s - Won: %s - Length: %s' % (x['datetime'], x['won'], x['length'])
            try:
                print 'Kills: %s - Deaths: %s - Assists: %s - KDR: %.2f' % (x['kills'], x['deaths'], x['assists'], x['kills'] / x['deaths'])
            except ZeroDivisionError:
                print 'Kills: %s - Deaths: %s - Assists: %s - KDR: 0' % (x['kills'], x['deaths'], x['assists'])

            print 'Dealt: Phyiscal: %s - Magical: %s - Total: %s' % (com(x['physicalDamageDealt']), com(x['magicDamageDealt']), com(x['physicalDamageDealt'] + x['magicDamageDealt']))
            print 'Received: Phyiscal: %s - Magical: %s - Total: %s' % (com(x['physicalDamageTaken']), com(x['magicDamageTaken']), com(x['physicalDamageTaken'] + x['magicDamageTaken']))
            print 'Gold: %s - Healing: %s - CreepScore: %s ' % (com(x['gold']), com(x['healed']), com(x['neutralMinionsKilled'] + x['minions']))
            length = getsec(x['length'])
            print 'Gold/Min: %s - CS/Min: %.2f\n' % (com((x['gold'] / length) * 60), ((x['neutralMinionsKilled'] + x['minions']) / length) * 60)

            if quit == 'q' or quit == 'Q':
                break

            if count >= 2:
                print 'Press a key to view more or Q to quit\n'
                quit = msvcrt.getch()
                count = 0
                os.system(clear_fn)
    print '\nPress a Key to continue'
    msvcrt.getch()
Beispiel #2
0
  def __init__(self,basePath,mouse,s,dataSet='OnACID',SNR_thr=2,rval_thr=0):
    pxtomu = 530.68/512

    pathMouse = pathcat([basePath,mouse])
    pathSession = pathcat([pathMouse,'Session%02d'%s])
    pathData = pathcat([pathSession,'results_OnACID.mat'])
    ld = loadmat(pathData,variable_names=['Cn'])

    pathData = pathcat([pathSession,'results_%s.mat'%dataSet])
    self.data = loadmat(pathData,variable_names=['A','C','SNR','r_values'])
    self.data['Cn'] = ld['Cn'].T

    self.idx_good = (self.data['SNR']>2).T & (self.data['r_values']>0).T
    self.cm = com(self.data['A'],512,512) * pxtomu
    self.cm[np.squeeze(~self.idx_good),:] = np.NaN
    self.D_ROIs = sp.spatial.distance.pdist(self.cm)
    self.D_ROIs_mat = sp.spatial.distance.squareform(self.D_ROIs)


    nCells = self.data['C'].shape[0]
    self.corrcoef = np.zeros((nCells,nCells))
    for n in tqdm(np.where(self.idx_good)[0]):
      for nn in range(n+1,nCells):
          if self.idx_good[nn]:
              self.corrcoef[n,nn] = np.corrcoef(self.data['C'][n,:],self.data['C'][nn,:])[0,1]

    self.Acorr = np.zeros((nCells,nCells))
    for n in tqdm(np.where(self.idx_good)[0]):#range(nCells)):
      idx_close=np.where(self.D_ROIs_mat[n,:]<20)[0]
      for nn in idx_close:
        self.Acorr[n,nn],_ = calculate_img_correlation(self.data['A'][:,n],self.data['A'][:,nn],shift=False)

    self.Asz = (self.data['A']>0).sum(0)
Beispiel #3
0
def maps(summ):
    count = 0
    os.system(clear_fn)
    quit = ''
    for x in full:
        if summ == x['summoner']:
            count += 1
            print 'Champion: %s' % (x['champion'])
            print 'Date: %s - Won: %s - Length: %s' % (x['datetime'], x['won'],
                                                       x['length'])
            try:
                print 'Kills: %s - Deaths: %s - Assists: %s - KDR: %.2f' % (
                    x['kills'], x['deaths'], x['assists'],
                    x['kills'] / x['deaths'])
            except ZeroDivisionError:
                print 'Kills: %s - Deaths: %s - Assists: %s - KDR: 0' % (
                    x['kills'], x['deaths'], x['assists'])

            print 'Dealt: Phyiscal: %s - Magical: %s - Total: %s' % (
                com(x['physicalDamageDealt']), com(x['magicDamageDealt']),
                com(x['physicalDamageDealt'] + x['magicDamageDealt']))
            print 'Received: Phyiscal: %s - Magical: %s - Total: %s' % (
                com(x['physicalDamageTaken']), com(x['magicDamageTaken']),
                com(x['physicalDamageTaken'] + x['magicDamageTaken']))
            print 'Gold: %s - Healing: %s - CreepScore: %s ' % (
                com(x['gold']), com(x['healed']),
                com(x['neutralMinionsKilled'] + x['minions']))
            length = getsec(x['length'])
            print 'Gold/Min: %s - CS/Min: %.2f\n' % (com(
                (x['gold'] / length) * 60), (
                    (x['neutralMinionsKilled'] + x['minions']) / length) * 60)

            if quit == 'q' or quit == 'Q':
                break

            if count >= 2:
                print 'Press a key to view more or Q to quit\n'
                quit = msvcrt.getch()
                count = 0
                os.system(clear_fn)
    print '\nPress a Key to continue'
    msvcrt.getch()
Beispiel #4
0
def overall(usrinput):
    os.system(clear_fn)
    length = 0
    #vars
    usr_stats = overallstats.get(usrinput)
    if not usr_stats:
        usr_stats = defaultdict(int)

    for x in full:
        if usrinput == x['summoner']:
            for k in aggregate_stats:
                usr_stats[k] += x.get(k, 0)

            if x['won']:
                usr_stats['won'] += 1
            if not x['won']:
                usr_stats['lost'] += 1
            length += getsec(x['length'])
    #total game length
    tlength = gethour(length)
    #avg game length = alength
    alength = length / (usr_stats['won'] + usr_stats['lost'])
    alength = gethour(alength)
    #print it!
    print '~Total Stats Across All Games for %s~ \n' % (usrinput)
    print 'Games: %s - Wins: %s - Losses %s - Win: %.2f%% - Time Played: %s' % (usr_stats['won'] + usr_stats['lost'], usr_stats['won'], usr_stats['lost'], usr_stats['won'] / (usr_stats['won'] + usr_stats['lost']) * 100, tlength)
    try:
        print 'Kills: %s - Deaths: %s - Assists: %s - KDR: %.2f \n' % (com(usr_stats['kills']), com(usr_stats['deaths']), com(usr_stats['assists']), usr_stats['kills'] / usr_stats['deaths'])
    except ZeroDivisionError:
        print 'Kills: %s - Deaths: %s - Assists: %s - KDR: 0 \n' % (com(usr_stats['kills']), com(usr_stats['deaths']), com(usr_stats['assists']))
    print 'Damage Dealt'
    print 'Phyiscal: %s - Magical: %s - Total: %s \n' % (com(usr_stats['physicalDamageDealt']), com(usr_stats['magicDamageDealt']), com(usr_stats['physicalDamageDealt'] + usr_stats['magicDamageDealt']))
    print 'Damage Received'
    print 'Phyiscal: %s - Magical: %s - Total: %s \n' % (com(usr_stats['physicalDamageTaken']), com(usr_stats['magicDamageTaken']), com(usr_stats['physicalDamageTaken'] + usr_stats['magicDamageTaken']))
    print 'Gold: %s - Healing: %s - CreepScore: %s \n' % (com(usr_stats['gold']), com(usr_stats['healed']), com(usr_stats['neutralMinionsKilled'] + usr_stats['minions']))
    print 'Time Averages/Min'
    print 'Game Length: %s - Gold: %s - CS: %.2f ' % (alength, com((usr_stats['gold'] / length) * 60), ((usr_stats['neutralMinionsKilled'] + usr_stats['minions']) / length) * 60)
    print 'Kills: %.2f - Deaths: %.2f - Assists: %.2f \n' % ((usr_stats['kills'] / length) * 60, (usr_stats['deaths'] / length) * 60, (usr_stats['assists'] / length) * 60)

    print 'Press a Key to continue'
    msvcrt.getch()
Beispiel #5
0
def gameid(summ, matchid):
    count = 0
    page = 1
    quit = ''
    for x in full:
        if matchid == x['match']:
            if summ == x['summoner']:
                myteam = x['team']
                originalteam = x['team']
                os.system(clear_fn)
                print 'Your Info \n'
                print 'Champion: %s - Team: %s' % (x['champion'], x['team'])
                print 'Date: %s - Won: %s - Length: %s' % (x['datetime'], x['won'], x['length'])
                try:
                    print 'Kills: %s - Deaths: %s - Assists: %s - KDR: %.2f' % (x['kills'], x['deaths'], x['assists'], x['kills'] / x['deaths'])
                except ZeroDivisionError:
                    print 'Kills: %s - Deaths: %s - Assists: %s - KDR: 0' % (x['kills'], x['deaths'], x['assists'])

                print 'Dealt: Phyiscal: %s - Magical: %s - Total: %s' % (com(x['physicalDamageDealt']), com(x['magicDamageDealt']), com(x['physicalDamageDealt'] + x['magicDamageDealt']))
                print 'Received: Phyiscal: %s - Magical: %s - Total: %s' % (com(x['physicalDamageTaken']), com(x['magicDamageTaken']), com(x['physicalDamageTaken'] + x['magicDamageTaken']))
                print 'Gold: %s - Healing: %s - CreepScore: %s' % (com(x['gold']), com(x['healed']), com(x['neutralMinionsKilled'] + x['minions']))
                length = getsec(x['length'])
                print 'Gold/Min: %s - CS/Min: %.2f\n' % (com((x['gold'] / length) * 60), ((x['neutralMinionsKilled'] + x['minions']) / length) * 60)

    print 'Press a Key to view your teams info.\n'
    msvcrt.getch()

    #Teammate and enemy INFO
    for t in range(2):
        for x in full:
            if matchid == x['match']:
                if summ == x['summoner']:
                    continue
                elif myteam == x['team']:
                    if count == 0:
                        os.system(clear_fn)
                        print '~Player: %s~' % (page)

                    count += 1
                    try:
                        x['minions'] + 1
                    except KeyError:
                        print 'Summoner: %s - Champion: %s - ~LEAVER~\n' % (x['summoner'], x['champion'])
                        continue
                    print 'Summoner: %s - Champion: %s - Team: %s' % (x['summoner'], x['champion'], x['team'])
                    if setting[2] == '0':
                        print 'Kills: %s - Deaths: %s - Assists: %s - CreepScore: %s \n' % (x['kills'], x['deaths'], x['assists'], com(x['neutralMinionsKilled'] + x['minions']))

                    if setting[2] == '1':
                        try:
                            print 'Kills: %s - Deaths: %s - Assists: %s - KDR: %.2f' % (x['kills'], x['deaths'], x['assists'], x['kills'] / x['deaths'])
                        except ZeroDivisionError:
                            print 'Kills: %s - Deaths: %s - Assists: %s - KDR: 0' % (x['kills'], x['deaths'], x['assists'])
                        print 'Dealt: Phyiscal: %s - Magical: %s - Total: %s' % (com(x['physicalDamageDealt']), com(x['magicDamageDealt']), com(x['physicalDamageDealt'] + x['magicDamageDealt']))
                        print 'Received: Phyiscal: %s - Magical: %s - Total: %s' % (com(x['physicalDamageTaken']), com(x['magicDamageTaken']), com(x['physicalDamageTaken'] + x['magicDamageTaken']))
                        print 'Gold: %s - Healing: %s - CreepScore: %s ' % (com(x['gold']), com(x['healed']), com(x['neutralMinionsKilled'] + x['minions']))
                        length = getsec(x['length'])
                        print 'Gold/Min: %s - CS/Min: %.2f\n' % (com((x['gold'] / length) * 60), ((x['neutralMinionsKilled'] + x['minions']) / length) * 60)

                    if count >= 1:
                        print '\nPress a key to view more or Q to quit\n'
                        quit = msvcrt.getch()
                        count = 0
                        page += 1
                    if quit == 'q' or quit == 'Q':
                        break
        if myteam == originalteam:
            print 'Press a Key to view enemy teams info.\n'
        else:
            print 'Finished: Press a key to quit.'
        msvcrt.getch()

        page = 1
        count = 0
        if myteam == 1:
            myteam = 2
        if myteam == 2:
            myteam = 1
Beispiel #6
0
def champinfo(champ, summ):
    length = 0
    overall_length = 0
    usr_stats = overallstats.get(champ)
    overall_stats = overallstats.get(summ)
    if not overall_stats:
        overall_stats = defaultdict(int)
    if not usr_stats:
        usr_stats = defaultdict(int)
    #Gather stats for the champion selected.
    for x in full:
        if summ == x['summoner']:
            if champ == x['champion']:
                for k in aggregate_stats:
                    usr_stats[k] += x.get(k, 0)
                if x['won']:
                    usr_stats['won'] += 1
                if not x['won']:
                    usr_stats['lost'] += 1
                length += getsec(x['length'])
    #Gather stats from all of the summoners champ if setting is enabled.
    if setting[4] == '1':
        for x in full:
            if summ == x['summoner']:
                for k in aggregate_stats:
                    overall_stats[k] += x.get(k, 0)
                if x['won']:
                    overall_stats['won'] += 1
                if not x['won']:
                    overall_stats['lost'] += 1
                overall_length += getsec(x['length'])
        #total Game length = tlength
        #overall_tlength = gethour(overall_length)
        #avg game length = alength
        overall_alength = overall_length / (overall_stats['won'] + overall_stats['lost'])
        overall_alength = gethour(overall_alength)

    #total game length
    tlength = gethour(length)
    #avg game length = alength
    alength = length / (usr_stats['won'] + usr_stats['lost'])
    alength = gethour(alength)
    os.system(clear_fn)

    print '~Total Stats Across All Games for %s with %s~ \n' % (summ, champ)
    print 'Games: %s - Wins: %s - Losses %s - Win: %.2f%% - Time Played: %s' % (usr_stats['won'] + usr_stats['lost'], usr_stats['won'], usr_stats['lost'], usr_stats['won'] / (usr_stats['won'] + usr_stats['lost']) * 100, tlength)
    try:
        print 'Kills: %s - Deaths: %s - Assists: %s - KDR: %.2f \n' % (com(usr_stats['kills']), com(usr_stats['deaths']), com(usr_stats['assists']), usr_stats['kills'] / usr_stats['deaths'])
    except ZeroDivisionError:
        print 'Kills: %s - Deaths: %s - Assists: %s - KDR: 0 \n' % (com(usr_stats['kills']), com(usr_stats['deaths']), com(usr_stats['assists']))
    print 'Damage Dealt'
    print 'Phyiscal: %s - Magical: %s - Total: %s \n' % (com(usr_stats['physicalDamageDealt']), com(usr_stats['magicDamageDealt']), com(usr_stats['physicalDamageDealt'] + usr_stats['magicDamageDealt']))
    print 'Damage Received'
    print 'Phyiscal: %s - Magical: %s - Total: %s \n' % (com(usr_stats['physicalDamageTaken']), com(usr_stats['magicDamageTaken']), com(usr_stats['physicalDamageTaken'] + usr_stats['magicDamageTaken']))
    print 'Gold: %s - Healing: %s - CreepScore: %s \n' % (com(usr_stats['gold']), com(usr_stats['healed']), com(usr_stats['neutralMinionsKilled'] + usr_stats['minions']))
    print 'Time Averages/Min'
    print 'Game Length: %s - Gold: %s - CS: %.2f ' % (alength, com((usr_stats['gold'] / length) * 60), ((usr_stats['neutralMinionsKilled'] + usr_stats['minions']) / length) * 60)
    print 'Kills: %.2f - Deaths: %.2f - Assists: %.2f' % ((usr_stats['kills'] / length) * 60, (usr_stats['deaths'] / length) * 60, (usr_stats['assists'] / length) * 60)

    if setting[4] == '1':
        print '\nTime Averages/Min over all champions'
        print 'Game Length: %s - Gold: %s - CS: %.2f ' % (overall_alength, com((overall_stats['gold'] / overall_length) * 60), ((overall_stats['neutralMinionsKilled'] + overall_stats['minions']) / overall_length) * 60)
        print 'Kills: %.2f - Deaths: %.2f - Assists: %.2f' % ((overall_stats['kills'] / overall_length) * 60, (overall_stats['deaths'] / overall_length) * 60, (overall_stats['assists'] / overall_length) * 60)
    print '\nPress a Key to continue'
    msvcrt.getch()
Beispiel #7
0
def gameid(summ, matchid):
    count = 0
    page = 1
    quit = ''
    for x in full:
        if matchid == x['match']:
            if summ == x['summoner']:
                myteam = x['team']
                originalteam = x['team']
                os.system(clear_fn)
                print 'Your Info \n'
                print 'Champion: %s - Team: %s' % (x['champion'], x['team'])
                print 'Date: %s - Won: %s - Length: %s' % (
                    x['datetime'], x['won'], x['length'])
                try:
                    print 'Kills: %s - Deaths: %s - Assists: %s - KDR: %.2f' % (
                        x['kills'], x['deaths'], x['assists'],
                        x['kills'] / x['deaths'])
                except ZeroDivisionError:
                    print 'Kills: %s - Deaths: %s - Assists: %s - KDR: 0' % (
                        x['kills'], x['deaths'], x['assists'])

                print 'Dealt: Phyiscal: %s - Magical: %s - Total: %s' % (
                    com(x['physicalDamageDealt']), com(x['magicDamageDealt']),
                    com(x['physicalDamageDealt'] + x['magicDamageDealt']))
                print 'Received: Phyiscal: %s - Magical: %s - Total: %s' % (
                    com(x['physicalDamageTaken']), com(x['magicDamageTaken']),
                    com(x['physicalDamageTaken'] + x['magicDamageTaken']))
                print 'Gold: %s - Healing: %s - CreepScore: %s' % (
                    com(x['gold']), com(x['healed']),
                    com(x['neutralMinionsKilled'] + x['minions']))
                length = getsec(x['length'])
                print 'Gold/Min: %s - CS/Min: %.2f\n' % (
                    com((x['gold'] / length) * 60),
                    ((x['neutralMinionsKilled'] + x['minions']) / length) * 60)

    print 'Press a Key to view your teams info.\n'
    msvcrt.getch()

    #Teammate and enemy INFO
    for t in range(2):
        for x in full:
            if matchid == x['match']:
                if summ == x['summoner']:
                    continue
                elif myteam == x['team']:
                    if count == 0:
                        os.system(clear_fn)
                        print '~Player: %s~' % (page)

                    count += 1
                    try:
                        x['minions'] + 1
                    except KeyError:
                        print 'Summoner: %s - Champion: %s - ~LEAVER~\n' % (
                            x['summoner'], x['champion'])
                        continue
                    print 'Summoner: %s - Champion: %s - Team: %s' % (
                        x['summoner'], x['champion'], x['team'])
                    if setting[2] == '0':
                        print 'Kills: %s - Deaths: %s - Assists: %s - CreepScore: %s \n' % (
                            x['kills'], x['deaths'], x['assists'],
                            com(x['neutralMinionsKilled'] + x['minions']))

                    if setting[2] == '1':
                        try:
                            print 'Kills: %s - Deaths: %s - Assists: %s - KDR: %.2f' % (
                                x['kills'], x['deaths'], x['assists'],
                                x['kills'] / x['deaths'])
                        except ZeroDivisionError:
                            print 'Kills: %s - Deaths: %s - Assists: %s - KDR: 0' % (
                                x['kills'], x['deaths'], x['assists'])
                        print 'Dealt: Phyiscal: %s - Magical: %s - Total: %s' % (
                            com(x['physicalDamageDealt']),
                            com(x['magicDamageDealt']),
                            com(x['physicalDamageDealt'] +
                                x['magicDamageDealt']))
                        print 'Received: Phyiscal: %s - Magical: %s - Total: %s' % (
                            com(x['physicalDamageTaken']),
                            com(x['magicDamageTaken']),
                            com(x['physicalDamageTaken'] +
                                x['magicDamageTaken']))
                        print 'Gold: %s - Healing: %s - CreepScore: %s ' % (
                            com(x['gold']), com(x['healed']),
                            com(x['neutralMinionsKilled'] + x['minions']))
                        length = getsec(x['length'])
                        print 'Gold/Min: %s - CS/Min: %.2f\n' % (com(
                            (x['gold'] / length) * 60), (
                                (x['neutralMinionsKilled'] + x['minions']) /
                                length) * 60)

                    if count >= 1:
                        print '\nPress a key to view more or Q to quit\n'
                        quit = msvcrt.getch()
                        count = 0
                        page += 1
                    if quit == 'q' or quit == 'Q':
                        break
        if myteam == originalteam:
            print 'Press a Key to view enemy teams info.\n'
        else:
            print 'Finished: Press a key to quit.'
        msvcrt.getch()

        page = 1
        count = 0
        if myteam == 1:
            myteam = 2
        if myteam == 2:
            myteam = 1
Beispiel #8
0
def champinfo(champ, summ):
    length = 0
    overall_length = 0
    usr_stats = overallstats.get(champ)
    overall_stats = overallstats.get(summ)
    if not overall_stats:
        overall_stats = defaultdict(int)
    if not usr_stats:
        usr_stats = defaultdict(int)
    #Gather stats for the champion selected.
    for x in full:
        if summ == x['summoner']:
            if champ == x['champion']:
                for k in aggregate_stats:
                    usr_stats[k] += x.get(k, 0)
                if x['won']:
                    usr_stats['won'] += 1
                if not x['won']:
                    usr_stats['lost'] += 1
                length += getsec(x['length'])
    #Gather stats from all of the summoners champ if setting is enabled.
    if setting[4] == '1':
        for x in full:
            if summ == x['summoner']:
                for k in aggregate_stats:
                    overall_stats[k] += x.get(k, 0)
                if x['won']:
                    overall_stats['won'] += 1
                if not x['won']:
                    overall_stats['lost'] += 1
                overall_length += getsec(x['length'])
        #total Game length = tlength
        #overall_tlength = gethour(overall_length)
        #avg game length = alength
        overall_alength = overall_length / (overall_stats['won'] +
                                            overall_stats['lost'])
        overall_alength = gethour(overall_alength)

    #total game length
    tlength = gethour(length)
    #avg game length = alength
    alength = length / (usr_stats['won'] + usr_stats['lost'])
    alength = gethour(alength)
    os.system(clear_fn)

    print '~Total Stats Across All Games for %s with %s~ \n' % (summ, champ)
    print 'Games: %s - Wins: %s - Losses %s - Win: %.2f%% - Time Played: %s' % (
        usr_stats['won'] + usr_stats['lost'], usr_stats['won'],
        usr_stats['lost'], usr_stats['won'] /
        (usr_stats['won'] + usr_stats['lost']) * 100, tlength)
    try:
        print 'Kills: %s - Deaths: %s - Assists: %s - KDR: %.2f \n' % (
            com(usr_stats['kills']), com(
                usr_stats['deaths']), com(usr_stats['assists']),
            usr_stats['kills'] / usr_stats['deaths'])
    except ZeroDivisionError:
        print 'Kills: %s - Deaths: %s - Assists: %s - KDR: 0 \n' % (com(
            usr_stats['kills']), com(
                usr_stats['deaths']), com(usr_stats['assists']))
    print 'Damage Dealt'
    print 'Phyiscal: %s - Magical: %s - Total: %s \n' % (
        com(usr_stats['physicalDamageDealt']),
        com(usr_stats['magicDamageDealt']),
        com(usr_stats['physicalDamageDealt'] + usr_stats['magicDamageDealt']))
    print 'Damage Received'
    print 'Phyiscal: %s - Magical: %s - Total: %s \n' % (
        com(usr_stats['physicalDamageTaken']),
        com(usr_stats['magicDamageTaken']),
        com(usr_stats['physicalDamageTaken'] + usr_stats['magicDamageTaken']))
    print 'Gold: %s - Healing: %s - CreepScore: %s \n' % (
        com(usr_stats['gold']), com(usr_stats['healed']),
        com(usr_stats['neutralMinionsKilled'] + usr_stats['minions']))
    print 'Time Averages/Min'
    print 'Game Length: %s - Gold: %s - CS: %.2f ' % (
        alength, com((usr_stats['gold'] / length) * 60),
        ((usr_stats['neutralMinionsKilled'] + usr_stats['minions']) / length) *
        60)
    print 'Kills: %.2f - Deaths: %.2f - Assists: %.2f' % (
        (usr_stats['kills'] / length) * 60,
        (usr_stats['deaths'] / length) * 60,
        (usr_stats['assists'] / length) * 60)

    if setting[4] == '1':
        print '\nTime Averages/Min over all champions'
        print 'Game Length: %s - Gold: %s - CS: %.2f ' % (
            overall_alength, com(
                (overall_stats['gold'] / overall_length) * 60),
            ((overall_stats['neutralMinionsKilled'] + overall_stats['minions'])
             / overall_length) * 60)
        print 'Kills: %.2f - Deaths: %.2f - Assists: %.2f' % (
            (overall_stats['kills'] / overall_length) * 60,
            (overall_stats['deaths'] / overall_length) * 60,
            (overall_stats['assists'] / overall_length) * 60)
    print '\nPress a Key to continue'
    msvcrt.getch()
Beispiel #9
0
def overall(usrinput):
    os.system(clear_fn)
    length = 0
    #vars
    usr_stats = overallstats.get(usrinput)
    if not usr_stats:
        usr_stats = defaultdict(int)

    for x in full:
        if usrinput == x['summoner']:
            for k in aggregate_stats:
                usr_stats[k] += x.get(k, 0)

            if x['won']:
                usr_stats['won'] += 1
            if not x['won']:
                usr_stats['lost'] += 1
            length += getsec(x['length'])
    #total game length
    tlength = gethour(length)
    #avg game length = alength
    alength = length / (usr_stats['won'] + usr_stats['lost'])
    alength = gethour(alength)
    #print it!
    print '~Total Stats Across All Games for %s~ \n' % (usrinput)
    print 'Games: %s - Wins: %s - Losses %s - Win: %.2f%% - Time Played: %s' % (
        usr_stats['won'] + usr_stats['lost'], usr_stats['won'],
        usr_stats['lost'], usr_stats['won'] /
        (usr_stats['won'] + usr_stats['lost']) * 100, tlength)
    try:
        print 'Kills: %s - Deaths: %s - Assists: %s - KDR: %.2f \n' % (
            com(usr_stats['kills']), com(
                usr_stats['deaths']), com(usr_stats['assists']),
            usr_stats['kills'] / usr_stats['deaths'])
    except ZeroDivisionError:
        print 'Kills: %s - Deaths: %s - Assists: %s - KDR: 0 \n' % (com(
            usr_stats['kills']), com(
                usr_stats['deaths']), com(usr_stats['assists']))
    print 'Damage Dealt'
    print 'Phyiscal: %s - Magical: %s - Total: %s \n' % (
        com(usr_stats['physicalDamageDealt']),
        com(usr_stats['magicDamageDealt']),
        com(usr_stats['physicalDamageDealt'] + usr_stats['magicDamageDealt']))
    print 'Damage Received'
    print 'Phyiscal: %s - Magical: %s - Total: %s \n' % (
        com(usr_stats['physicalDamageTaken']),
        com(usr_stats['magicDamageTaken']),
        com(usr_stats['physicalDamageTaken'] + usr_stats['magicDamageTaken']))
    print 'Gold: %s - Healing: %s - CreepScore: %s \n' % (
        com(usr_stats['gold']), com(usr_stats['healed']),
        com(usr_stats['neutralMinionsKilled'] + usr_stats['minions']))
    print 'Time Averages/Min'
    print 'Game Length: %s - Gold: %s - CS: %.2f ' % (
        alength, com((usr_stats['gold'] / length) * 60),
        ((usr_stats['neutralMinionsKilled'] + usr_stats['minions']) / length) *
        60)
    print 'Kills: %.2f - Deaths: %.2f - Assists: %.2f \n' % (
        (usr_stats['kills'] / length) * 60,
        (usr_stats['deaths'] / length) * 60,
        (usr_stats['assists'] / length) * 60)

    print 'Press a Key to continue'
    msvcrt.getch()