|
11 | 11 | import winreg as reg
|
12 | 12 |
|
13 | 13 | import pyautogui
|
| 14 | +import pygetwindow as gw |
14 | 15 | import win32clipboard
|
15 | 16 | import wmi
|
16 | 17 |
|
@@ -1724,6 +1725,88 @@ def start(self):
|
1724 | 1725 | except KeyboardInterrupt:
|
1725 | 1726 | print("Mouse freeze stopped.")
|
1726 | 1727 |
|
| 1728 | + class DrunkGUI: |
| 1729 | + def __init__(self): |
| 1730 | + # Constants for desktop manipulation |
| 1731 | + self.SPI_SETDESKWALLPAPER = 20 |
| 1732 | + self.SPI_GETDESKWALLPAPER = 0x0073 |
| 1733 | + # Global variable to store original window states |
| 1734 | + self.original_states = {} |
| 1735 | + |
| 1736 | + @staticmethod |
| 1737 | + def __bug_desktop(): |
| 1738 | + """Randomly manipulate the desktop and taskbar to create a 'drunk' effect.""" |
| 1739 | + desktop_hwnd = ctypes.windll.user32.GetDesktopWindow() |
| 1740 | + |
| 1741 | + end_time = time.time() + 15 |
| 1742 | + while time.time() < end_time: |
| 1743 | + # Randomly flicker desktop visibility |
| 1744 | + ctypes.windll.user32.ShowWindow(desktop_hwnd, random.choice([5, 0, 1])) # 5: Minimize, 0: Hide, 1: Show |
| 1745 | + |
| 1746 | + # Random background color change for chaos |
| 1747 | + random_color = random.choice([random.randint(0, 0xFFFFFF) for _ in range(5)]) |
| 1748 | + ctypes.windll.user32.SetSysColors(1, (5,), random_color) |
| 1749 | + |
| 1750 | + time.sleep(0.1) # Small delay between chaotic effects |
| 1751 | + |
| 1752 | + def __bug_windows(self): |
| 1753 | + """Randomly manipulate open windows.""" |
| 1754 | + windows = [win for win in gw.getAllWindows() if win.title.strip()] |
| 1755 | + |
| 1756 | + # Save original states |
| 1757 | + for win in windows: |
| 1758 | + self.original_states[win.title] = (win.left, win.top, win.width, win.height) |
| 1759 | + |
| 1760 | + end_time = time.time() + 15 |
| 1761 | + while time.time() < end_time: |
| 1762 | + for win in windows: |
| 1763 | + try: |
| 1764 | + # Randomly move the window |
| 1765 | + new_left = random.randint(0, win.width) |
| 1766 | + new_top = random.randint(0, win.height) |
| 1767 | + win.moveTo(new_left, new_top) |
| 1768 | + |
| 1769 | + # Randomly resize the window |
| 1770 | + new_width = random.randint(200, 800) |
| 1771 | + new_height = random.randint(200, 600) |
| 1772 | + win.resizeTo(new_width, new_height) |
| 1773 | + |
| 1774 | + # Add some random lines or 'glitches' in windows |
| 1775 | + win.activate() |
| 1776 | + pyautogui.moveTo(random.randint(0, win.width), random.randint(0, win.height)) |
| 1777 | + pyautogui.click() |
| 1778 | + |
| 1779 | + except Exception: |
| 1780 | + continue |
| 1781 | + |
| 1782 | + time.sleep(0.3) # Small delay to maintain chaos |
| 1783 | + |
| 1784 | + def __revert_gui(self): |
| 1785 | + """Revert GUI to its original state.""" |
| 1786 | + # Revert windows |
| 1787 | + for win in gw.getAllWindows(): |
| 1788 | + if win.title in self.original_states: |
| 1789 | + left, top, width, height = self.original_states[win.title] |
| 1790 | + try: |
| 1791 | + win.moveTo(left, top) |
| 1792 | + win.resizeTo(width, height) |
| 1793 | + except Exception: |
| 1794 | + continue |
| 1795 | + |
| 1796 | + print("All changes reverted.") |
| 1797 | + |
| 1798 | + def start(self): |
| 1799 | + # Start bugging threads for maximum chaos |
| 1800 | + desktop_thread = threading.Thread(target=self.__bug_desktop, daemon=True) |
| 1801 | + windows_thread = threading.Thread(target=self.__bug_windows, daemon=True) |
| 1802 | + |
| 1803 | + desktop_thread.start() |
| 1804 | + windows_thread.start() |
| 1805 | + |
| 1806 | + # Run for 15 seconds, then revert |
| 1807 | + time.sleep(15) |
| 1808 | + self.__revert_gui() |
| 1809 | + |
1727 | 1810 |
|
1728 | 1811 | # ----------------------------- Script Code ------------------------- #
|
1729 | 1812 |
|
|
0 commit comments