i'm trying to decipher the controls in project diva mega mix (steam)
coydtkdgksutffkfgdcjfhvkbjr- kuroneko wrote:
kid named random:
from ossapi import Ossapi from Secret import cid from Secret import key client_id = cid client_secret = key api = Ossapi(client_id, client_secret) while True: top_plays = [] username = input('\nUsername: ') new = float(input('New play: ')) user = api.user(username) user_pp = user.statistics.pp get_scores = api.user_scores(user.id, type='best', mode='osu', limit=999) for i in range(len(get_scores)): top_plays.append(get_scores[i].pp) def calc_total_pp(top_plays): total_pp = 0 exponent = 0 for i in top_plays: total_pp += i * 0.95 ** exponent exponent += 1 return total_pp before_total_pp = calc_total_pp(top_plays) top_plays.append(new) top_plays.sort(reverse=True) top_plays.pop() after_total_pp = calc_total_pp(top_plays) diff = after_total_pp - before_total_pp print(f'\nIf {username} gets a {new}pp play, \n{round(user_pp,2)} (+{round(diff,2)}) {round(user_pp + diff,2)}')