#!/usr/bin/env python3 """ Test to understand the original mouse.py logic exactly """ import time import pyautogui def test_original_logic(): """Test the exact logic from the original mouse.py script""" print("🧪 Testing Original mouse.py Logic") print("=====================================") print("This simulates exactly what your original script does") print("Move your mouse and watch the behavior...") print("Press Ctrl+C to stop") print("") WAITTIME = 30 # 30 seconds for testing countdown = WAITTIME xold = 0 yold = 0 try: iteration = 0 while True: iteration += 1 x, y = pyautogui.position() print(f"\n--- Iteration {iteration} ---") print(f"Current position: ({x}, {y})") print(f"Previous: xold={xold}, yold={yold}") if countdown <= 0: print("šŸ”„ TIMER EXPIRED - Would move mouse here") countdown = WAITTIME print(f"Timer reset to {WAITTIME}") continue # The key condition from your original script if x == xold or y == yold: print(f"šŸ’¤ IDLE DETECTED: (x=={xold}) = {x==xold}, (y=={yold}) = {y==yold}") print(f"Countdown: {countdown}") countdown -= 1 time.sleep(1) else: print(f"🐭 MOVEMENT DETECTED: Mouse moved from ({xold}, {yold}) to ({x}, {y})") print(f"Timer RESET from {countdown} to {WAITTIME}") countdown = WAITTIME yold = y # Only update yold! print(f"Updated yold to {yold}, xold stays {xold}") except KeyboardInterrupt: print("\nā¹ļø Test stopped by user") print("āœ… Test completed!") if __name__ == "__main__": test_original_logic()