def wrapped(*args, **kwargs): original_location = Env.getMouseLocation() original_move_delay = Settings.MoveMouseDelay Settings.MoveMouseDelay = 0 move_mouse(Location(SCREEN.getW()-1, SCREEN.getH()-1)) result = func(*args, **kwargs) move_mouse(original_location) Settings.MoveMouseDelay = original_move_delay return result
def getWindowsVersion(): """Returns the Windows version. The return values is 'XP', 'Vista' or '7'. """ rawversion = Env.getOSVersion() if rawversion[0] == '7': return '7' elif rawversion[0] == '6': return 'Vista' elif rawversion[0] == '5': return 'XP' else: raise Exception('unknown OS version: %s' % rawversion)
screen.type(Key.DOWN) screen.type(Key.TAB) for i in range(random.randint(1, 12)): screen.type(Key.DOWN) screen.type(Key.TAB) for i in range(random.randint(18, 50)): screen.type(Key.DOWN) screen.type(Key.TAB) screen.type(Key.DOWN) #question screen.type(Key.TAB) screen.paste( str(random.randint(1111111111111111111, 111111111111111111111))) #secret answer screen.type(Key.TAB) screen.mouseMove('Image_Next_To_Captcha.png') current_loc = Env.getMouseLocation() current_loc.x -= 150 screen.hover(current_loc) #screen.wait(copyImageLocation,15) #screen.click(copyImageLocation) tries = 0 while True: #try a few times to decode the captcha tries += 1 if tries == 10: #solve manually captcha_solution = input( "Please enter the solution to the captcha manually") break screen.rightClick(current_loc) try: screen.wait(copyImageLocation, 15) screen.click(copyImageLocation)
screen.type(Key.TAB) for i in range(random.randint(1,27)): #date screen.type(Key.DOWN) screen.type(Key.TAB) for i in range(random.randint(1,12)): screen.type(Key.DOWN) screen.type(Key.TAB) for i in range(random.randint(18,50)): screen.type(Key.DOWN) screen.type(Key.TAB) screen.type(Key.DOWN) #question screen.type(Key.TAB) screen.paste(str(random.randint(1111111111111111111,111111111111111111111))) #secret answer screen.type(Key.TAB) screen.mouseMove('Image_Next_To_Captcha.png') current_loc = Env.getMouseLocation() current_loc.x -= 150 screen.hover(current_loc) #screen.wait(copyImageLocation,15) #screen.click(copyImageLocation) tries = 0 while True: #try a few times to decode the captcha tries += 1 if tries == 10: #solve manually captcha_solution = input("Please enter the solution to the captcha manually") break screen.rightClick(current_loc) try: screen.wait(copyImageLocation,15) screen.click(copyImageLocation) #screen.type("o", KeyModifier.CTRL)