- Download python for windows: http://www.python.org/download/windows/
- Download win32api extension for python: http://sourceforge.net/projects/pywin32/
- Maximize your Hangout Window
- Run the script:
python main.py
python main.py
#!/usr/bin/python | |
import win32api, win32con | |
import threading | |
class AutoMouseMove(threading.Thread): | |
def __init__(self): | |
threading.Thread.__init__(self) | |
self.event = threading.Event() | |
self.state = False | |
self.first_point = (100, 5) | |
self.second_point = (win32api.GetSystemMetrics(0) / 2, win32api.GetSystemMetrics(1) / 2) | |
def run(self): | |
while True: | |
self.state = not self.state | |
self.event.wait(3) | |
self.execute() | |
def execute(self): | |
move_to_point = self.first_point | |
if self.state: | |
move_to_point = self.second_point | |
win32api.SetCursorPos(move_to_point) | |
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN | win32con.MOUSEEVENTF_LEFTUP, | |
move_to_point[0], move_to_point[1], 0, 0) | |
auto = AutoMouseMove() | |
auto.run() |