From 25eb45ae6cb294744e92406acfa9fe931550ffcb Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Fri, 22 Jan 2016 02:59:14 +0100 Subject: [PATCH] Simplify quote line counting. --- plomlombot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plomlombot.py b/plomlombot.py index 9da1166..4befc39 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -151,8 +151,9 @@ def lineparser_loop(io, nickname): quotesfile = open(quotesfile_name, "r") lines = quotesfile.readlines() quotesfile.close() - i = random.randrange(len(lines) - 1) + 1 - notice("QUOTE #" + str(i) + ": " + lines[i]) + lines = lines[1:] + i = random.randrange(len(lines)) + notice("QUOTE #" + str(i + 1) + ": " + lines[i]) sender = "" for rune in tokens[0]: -- 2.30.2