Erst schauen, dann klicken: aktiver Reiter, offene Tische, Klick nur im Fenster; Tests ohne echten Client
Live 30.10. the bot clicked the Practice tab it was already on and the user saw clicks beside the window. Lobby: read the active tab (.active-tab, measured) and click only if needed, then verify it switched; never Join a table whose window is open (fill and self-heal). A real mouse click is only sent when the point and its scattered end lie inside the target window (KlickAusserhalb, a FensterNichtVorn), and not at all without a lobby window. Two mcp_server_spec tests patched the wrong name and clicked the real lobby with the real mouse whenever CoinPoker ran - they now patch lobby_adapter and demand an opened table; tests/lauf.py blocks the real debug port for every spec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -59,9 +59,12 @@ def tisch_klick(px, py, fenster, halb=(0.0, 0.0), wie=None, rng=None):
|
||||
|
||||
|
||||
def lobby_maus_klick(x, y):
|
||||
"""Echter Mausklick in der Lobby (Bildschirmpunkte), Lobbyfenster vorher nach vorn."""
|
||||
"""Echter Mausklick in der Lobby (Bildschirmpunkte), Lobbyfenster vorher nach vorn. Ohne
|
||||
erkanntes Lobbyfenster kein Klick (False) - der Punkt läge sonst irgendwo (live 30.10.)."""
|
||||
import fenster as fenster_
|
||||
lobby = next((f for f in fenster_.alle() if not f.get("tischfenster")), None)
|
||||
if lobby is None:
|
||||
return False
|
||||
_click().click(x, y, fenster=lobby)
|
||||
return True
|
||||
|
||||
@@ -76,5 +79,6 @@ def lobby_antwort(text):
|
||||
x, y = float(d["x"]), float(d["y"])
|
||||
except (ValueError, KeyError, TypeError):
|
||||
return text
|
||||
lobby_maus_klick(x, y)
|
||||
if not lobby_maus_klick(x, y):
|
||||
return "nicht geklickt: kein Lobbyfenster gefunden"
|
||||
return "per Maus geklickt: " + str(d.get("text") or "")
|
||||
|
||||
Reference in New Issue
Block a user