From 4a2cbf7f1f6c1e00d6b59eb84e1a14da3e92f59b Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 29 Jun 2014 15:33:27 +0200 Subject: [PATCH] shift items, then check for empty line --- cycle.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cycle.py b/cycle.py index 2dcad51..3c7a681 100644 --- a/cycle.py +++ b/cycle.py @@ -56,10 +56,9 @@ def doCycle(player, up): shift = -9 if up else 9 shift = shift % len(items) for _ in range(4): - uniq_items = sorted(set(list(items)[:shift])) # crazy code msg(player, items[:shift]) - items = items[shift:] + items[:shift] # shift "around" + items = items[shift:] + items[:shift] # shift "around" + uniq_items = sorted(set(list(items)[:9])) # get unique inventory if uniq_items != [None]: # row not empty break - inv.setContents(items) \ No newline at end of file