From: Christian Heller Date: Fri, 22 Jan 2016 01:59:14 +0000 (+0100) Subject: Simplify quote line counting. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/calendar?a=commitdiff_plain;h=25eb45ae6cb294744e92406acfa9fe931550ffcb;p=plomlombot-irc.git Simplify quote line counting. --- 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]: