Add release roulette function

This commit is contained in:
mez 2025-07-27 22:51:17 +01:00
parent 07e850e612
commit 26ce704b79

View file

@ -2131,12 +2131,29 @@ def newriku():
rikuurl = input("Comment URL: ") rikuurl = input("Comment URL: ")
print("\n{\"event\":\"riku’s favors " + rikuround + "\",\"date\":datetime.datetime(" + datetime.datetime.now().strftime("%Y,%-m,%-d") + "),\"url\":\"" + rikuurl + "\",\"lost\":[\"" + "\",\"".join(allout) + "\"],\"received\":[\"" + "\",\"".join(allin) + "\"]}") print("\n{\"event\":\"riku’s favors " + rikuround + "\",\"date\":datetime.datetime(" + datetime.datetime.now().strftime("%Y,%-m,%-d") + "),\"url\":\"" + rikuurl + "\",\"lost\":[\"" + "\",\"".join(allout) + "\"],\"received\":[\"" + "\",\"".join(allin) + "\"]}")
def roulette():
x = "temp"
inside = random.randint(50,(12 * (datetime.datetime.today().year - datetime.datetime(2010,5,1).year) + datetime.datetime.today().month - datetime.datetime(2010,5,1).month - 50))
evenodd = random.choice(["even","odd"])
warmcool = random.choice(["warm","cool"])
print("\n<b>Inside Bet:</b> " + str(inside) + "\n\n<b>Outside Bets:</b>\n<b>Odd/Even:</b> " + evenodd + "\n<b>Warm/Cool:</b> " + warmcool)
pool = []
for card in colors.cardlist:
if card["priority"] == 4 and card["dupe"] == False and card["colour"] != "sig" and card["colour"] != "limited" and len(card["mass"]) == 0 and card["colour"] != "special":
pool.append(card["name"])
if len(pool) > 9:
chosen = sorted(random.sample(pool,10))
print("\n<b>Double Down:</b>\n<img src=\"https://colors-tcg.eu/cards/" + ".gif\"><img src=\"https://colors-tcg.eu/cards/".join(chosen) + ".gif\">\n<b>Card names:</b> " + ", ".join(chosen))
theround = input("\nRound number: ")
letteurl = input("Comment URL: ")
print("\n{\"event\":\"release roulette " + theround + "\",\"date\":datetime.datetime(" + datetime.datetime.now().strftime("%Y,%-m,%-d") + "),\"url\":\"" + letteurl + "\",\"lost\":[\"" + "\",\"".join(chosen) + "\"]}")
if __name__ == "__main__": if __name__ == "__main__":
while True: while True:
index = 0 # adapted from https://stackoverflow.com/a/64536882 index = 0 # adapted from https://stackoverflow.com/a/64536882
indexValidList = [] indexValidList = []
print("Choose from the list:") print("Choose from the list:")
options = ["Get a list of potential cards to trade in for Riku’s Favors","Generate next palette portfolio","Generate next monochrome portfolio","Generate Switch It Up request","Generate Swap Station request","Generate Go Fish comment","Generate art shop request","Generate art studio request","Check a trade offer","Propose a trade","Get a list of random cards from tradepile (excluding specials)","Get a list of random cards from tradepile (including specials)","Check a card in the collection","Check details of a deck","See decks mastered today","See some statistics about the collection"] options = ["Get a list of potential cards to trade in for Riku’s Favors","Generate next palette portfolio","Generate next monochrome portfolio","Generate Switch It Up request","Generate Swap Station request","Generate Go Fish comment","Generate Release Roulette comment","Generate art shop request","Generate art studio request","Check a trade offer","Propose a trade","Get a list of random cards from tradepile (excluding specials)","Get a list of random cards from tradepile (including specials)","Check a card in the collection","Check details of a deck","See decks mastered today","See some statistics about the collection"]
for optionName in options: for optionName in options:
index = index + 1 index = index + 1
indexValidList.extend([options.index(optionName)]) indexValidList.extend([options.index(optionName)])
@ -2184,5 +2201,7 @@ if __name__ == "__main__":
maketrade() maketrade()
elif chosen == "Generate Swap Station request": elif chosen == "Generate Swap Station request":
swapstation() swapstation()
elif chosen == "Generate Release Roulette comment":
roulette()
print("\n") print("\n")
input("Press Enter to continue or Ctrl-C to exit") input("Press Enter to continue or Ctrl-C to exit")