Created
October 12, 2011 11:28
-
-
Save kra3/1280975 to your computer and use it in GitHub Desktop.
To keep your mouse busy, so you will be always online in IM even if you are not at desk.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = "Arun K Rajeevan (kra3)" | |
__copyright__ = "Copyright 2011-2012" | |
__license__ = "BSD" | |
__version__ = "2" | |
__email__ = "the1.arun@gmail.com" | |
__status__ = "Production" | |
import time | |
import ctypes | |
class POINT(ctypes.Structure): | |
_fields_ = [('x', ctypes.c_ulong), ('y', ctypes.c_ulong)] | |
u32 = ctypes.windll.user32 | |
global pt | |
pt = POINT() | |
if __name__ == "__main__": | |
while True: | |
for i in range(27): | |
u32.GetCursorPos(ctypes.byref(pt)) | |
x = int(pt.x+1) | |
y = int(pt.y+1) | |
u32.SetCursorPos(x,y) | |
time.sleep(3.33) | |
u32.mouse_event(4, x, y, 0,0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment