From 696a1bfbbd8f419c69bf2dcff10424317f4551a1 Mon Sep 17 00:00:00 2001 From: Mez Date: Sat, 2 Aug 2025 19:55:16 +0100 Subject: [PATCH] List randoms at the end of trade requests --- tools.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools.py b/tools.py index 01b9771..59422a8 100644 --- a/tools.py +++ b/tools.py @@ -1456,6 +1456,14 @@ def maketrade(): thein = sorted(inc + ins) theout = sorted(outc + outs) if randoms: + realwant = [] + fakewant = [] + for card in theout: + if card in theirwantlist: + realwant.append(card) + else: + fakewant.append(card) + theout = realwant + fakewant randomstotal = totalrandomch + totalrandomsp addsigs = input("Add signatures? [y/N] ") if addsigs == "y": @@ -1465,7 +1473,7 @@ def maketrade(): tradestring = "\nmy " + ", ".join(theout) + "\n\nfor your " + ", ".join(thein) + "?" if randoms: if randomstotal > 0: - tradestring += "\n\n(" + str(len(thein)) + " cards, including " + str(randomstotal) + " randoms)" + tradestring += "\n\n(" + str(len(thein)) + " cards, including " + str(randomstotal) + " randoms [end of list])" elif len(thein) > 19: tradestring += "\n\n(" + str(len(thein)) + " cards)" tradestring += "\n\n"