From 876a8ce8ab598c4e79d81329b660a8006abaa655 Mon Sep 17 00:00:00 2001 From: Tino Date: Fri, 22 Nov 2024 10:25:51 -0500 Subject: [PATCH] Allow specifying the spin direction This adds a parameter to the `spin()` utility function that controls whether we're spinning clockwise (default and the way it previously worked) or counter-clockwise. This is not used by the bot as is, but can be used by plugins -- planning to use this as a very low-key easter egg in the Stream plugin. --- modules/modes/util/higher_level_actions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/modes/util/higher_level_actions.py b/modules/modes/util/higher_level_actions.py index 645d99b1..b13519b2 100644 --- a/modules/modes/util/higher_level_actions.py +++ b/modules/modes/util/higher_level_actions.py @@ -134,8 +134,8 @@ def fish() -> Generator: yield -def spin(stop_condition: Callable[[], bool] | None = None): - directions = ["Up", "Right", "Down", "Left"] +def spin(stop_condition: Callable[[], bool] | None = None, counter_clockwise: bool = False): + directions = ["Up", "Left", "Down", "Right"] if counter_clockwise else ["Up", "Right", "Down", "Left"] while True: avatar = get_player_avatar() if (