mouse.move doesnt accept a list
Motzumoto opened this issue · comments
Chris commented
Doing this:
button_left = [400, 960]
button_middle = [480, 960]
button_right = [580, 960]
button_choices = [button_left, button_middle, button_right]
mouse.move(random.choice(button_choices))
TypeError: move() missing 1 required positional argument: 'y'
Is there some other way i can do this?
mudkip commented
mouse.move
accepts x
and y
arguments. Have you considered doing one of the following?
choice = random.choice(button_choices)
mouse.move(choice[0], choice[1])
choice = random.choice(button_choices)
mouse.move(*choice)
choice_x, choice_y = random.choice(button_choices)
mouse.move(choice_x, choice_y)
Chris commented
mouse.move
acceptsx
andy
arguments. Have you considered doing the following?choice = random.choice(button_choices) mouse.move(choice[0], choice[1])
I have not considered that, thanks!