def menu_action(self, action): """action = 1 (first menu item), 2 (second menu item), ...""" self._logger.info("menu_action(%d)" % (action, )) mousecontrol.mouse_click() time.sleep(self.delay) mousecontrol.mouse_warp(self.x + 5, self.y + 5 + (action-1) * YDIST_MENU_ITEM) mousecontrol.mouse_click() time.sleep(self.delay)
def menu_action(self, action): """action = 1 (first menu item), 2 (second menu item), ...""" self._logger.info("menu_action(%d)" % (action, )) mousecontrol.mouse_click() time.sleep(self.delay) mousecontrol.mouse_warp(self.x + 5, self.y + 5 + (action - 1) * YDIST_MENU_ITEM) mousecontrol.mouse_click() time.sleep(self.delay)
def move(self, ysteps, xsteps): """Move bot with ysteps on vertical and xsteps on horizontal""" self._logger.info("move(%s, %s)" % (ysteps, xsteps)) # move with ysteps self.x += ysteps * self.step * self.zoom * XDIST_ZOOM1 self.y -= ysteps * self.step * self.zoom * YDIST_ZOOM1 # move with xsteps self.x += xsteps * self.step * self.zoom * XDIST_ZOOM1 self.y += xsteps * self.step * self.zoom * YDIST_ZOOM1 self._logger.debug("move: mouse_warp(%s, %s)" % (self.x, self.y)) mousecontrol.mouse_warp(self.x, self.y) time.sleep(self.delay)