diff --git a/the_prestige.py b/the_prestige.py index 512f20d..9bd3302 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -579,129 +579,6 @@ async def watch_game(channel, newgame, user = None): main_controller.master_games_dic[str(time.time() * 1000.0)] = (newgame, state_init) - #while not newgame.over or newgame.top_of_inning != top_of_inning: - # state = newgame.gamestate_display_full() - - # new_embed = discord.Embed(color=discord.Color.purple(), title=f"{newgame.teams['away'].name} at {newgame.teams['home'].name}") - - # new_embed.add_field(name=newgame.teams['away'].name, value=newgame.teams['away'].score, inline=True) - # new_embed.add_field(name=newgame.teams['home'].name, value=newgame.teams['home'].score, inline=True) - - # if top_of_inning: - # new_embed.add_field(name="Inning:", value=f"🔼 {newgame.inning} / {newgame.max_innings}", inline=True) - # new_embed.set_footer(text=f"{newgame.teams['away'].name} batting.") - # else: - # new_embed.add_field(name="Inning:", value=f"🔽 {newgame.inning} / {newgame.max_innings}", inline=True) - # new_embed.set_footer(text=f"{newgame.teams['home'].name} batting.") - - # new_embed.add_field(name="Outs:", value=f"{str(out_emoji)*newgame.outs+str(in_emoji)*(2-newgame.outs)}", inline=False) - # new_embed.add_field(name="Pitcher:", value=newgame.get_pitcher(), inline=False) - # new_embed.add_field(name="Batter:", value=newgame.get_batter(), inline=False) - - # if state == "Game not started.": - # new_embed.add_field(name="🍿", value="Play blall!", inline=False) - - # elif newgame.top_of_inning != top_of_inning: - # pause = 2 - # new_embed.set_field_at(4, name="Pitcher:", value="-", inline=False) - # new_embed.set_field_at(5, name="Batter:", value="-", inline=False) - # if newgame.top_of_inning: - # new_embed.set_field_at(2,name="Inning:",value=f"🔽 {newgame.inning-1} / {newgame.max_innings}") - - # if pause == 1: - # if newgame.top_of_inning: - # new_embed.add_field(name="🍿", value=f"Top of {newgame.inning}. {newgame.teams['away'].name} batting!", inline=False) - # else: - # if newgame.inning >= newgame.max_innings: - # if newgame.teams["home"].score > newgame.teams["away"].score: #if home team is winning at the bottom of the last inning - # victory_lap = True - # new_embed.add_field(name="🍿", value=f"Bottom of {newgame.inning}. {newgame.teams['home'].name} batting!", inline=False) - - # if pause != 1 and state != "Game not started.": - # if "steals" in newgame.last_update[0].keys(): - # updatestring = "" - # for attempt in newgame.last_update[0]["steals"]: - # updatestring += attempt + "\n" - - # new_embed.add_field(name="💎", value=updatestring, inline=False) - - # else: - # updatestring = "" - # punc = "" - # if newgame.last_update[0]["defender"] != "": - # punc = ". " - - # if "fc_out" in newgame.last_update[0].keys(): - # name, base_string = newgame.last_update[0]['fc_out'] - # updatestring = f"{newgame.last_update[0]['batter']} {newgame.last_update[0]['text'].value.format(name, base_string)} {newgame.last_update[0]['defender']}{punc}" - # else: - # updatestring = f"{newgame.last_update[0]['batter']} {newgame.last_update[0]['text'].value} {newgame.last_update[0]['defender']}{punc}" - # if newgame.last_update[1] > 0: - # updatestring += f"{newgame.last_update[1]} runs scored!" - - # new_embed.add_field(name="🏏", value=updatestring, inline=False) - - # basemessage = str(blank_emoji) - # if newgame.bases[2] is not None: - # basemessage += str(occupied_base) + "\n" - # else: - # basemessage += str(empty_base) + "\n" - - # basemessage_b = "" - # if newgame.bases[3] is not None: - # basemessage += str(occupied_base) - # else: - # basemessage += str(empty_base) - # basemessage += str(blank_emoji) - - # if newgame.bases[1] is not None: - # basemessage += str(occupied_base) - # else: - # basemessage += str(empty_base) - - # new_embed.add_field(name="Bases:", value=basemessage, inline = False) - # new_embed.add_field(name="Weather:", value=str(newgame.weather), inline = False) - - # await embed.edit(content=None, embed=new_embed) - # top_of_inning = newgame.top_of_inning - # if pause <= 1: - # newgame.gamestate_update_full() - - # pause -= 1 - # await asyncio.sleep(6) - - #title_string = f"{newgame.teams['away'].name} at {newgame.teams['home'].name} ended after {newgame.inning-1} innings" - #if (newgame.inning - 1) > newgame.max_innings: #if extra innings - # title_string += f" with {newgame.inning - (newgame.max_innings+1)} extra innings." - #else: - # title_string += "." - - #final_embed = discord.Embed(color=discord.Color.dark_purple(), title=title_string) - - #scorestring = f"{newgame.teams['away'].score} to {newgame.teams['home'].score}\n" - #if newgame.teams['away'].score > newgame.teams['home'].score: - # scorestring += f"{newgame.teams['away'].name} wins!" - #else: - # scorestring += f"{newgame.teams['home'].name} wins" - # if victory_lap: - # scorestring += " with a victory lap!" - # else: - # scorestring += f", shaming {newgame.teams['away'].name}!" - - - - #final_embed.add_field(name="Final score:", value=scorestring) - #await embed.edit(content=None, embed=final_embed) - - #await embed.unpin() - #gamesarray.pop(gamesarray.index(newgame)) #cleanup is important! - #newgame.add_stats() - #del newgame - #if len(gamesqueue) > 0: - # channel, game, user_mention = gamesqueue.pop(0) - # queue_task = asyncio.create_task(play_from_queue(channel, game, user_mention)) - # await queue_task - async def play_from_queue(channel, game, user_mention): await channel.send(f"{user_mention}, your game's ready.") game_task = asyncio.create_task(watch_game(channel, game)) @@ -907,4 +784,4 @@ async def game_watcher(): -client.run(config()["token"]) \ No newline at end of file +client.run(config()["token"])