浏览代码

fix tap if x is tuple

Richard Köhl 1 年之前
父节点
当前提交
6f6d78af41
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      dungeon.py

+ 3 - 0
dungeon.py

@@ -83,6 +83,9 @@ def tap(name, x, y=None):
     sleep += random.uniform(0, 0.2)
     text = f"- {name} (pause for {sleep}s)"
 
+    if y is None and isinstance(x, tuple):
+        x, y, *_ = x
+
     tap_helper(x + random.randint(-3, 3), y + random.randint(-3, 3), text)
     time.sleep(sleep)