-2

What I'm trying to do with this script is create cords for the mouse to travel too but I want the X cords to move to a location which is in the range of 0-1670.

import win32api
import win32con


def move(x,y):
    win32api.SetCursorPos((x,y))


move(1670,955)

Any help would be great!

Dave
  • 27
  • 3

2 Answers2

1
import random

move(random.randint(0, 1670), 955)
aifrey
  • 52
  • 3
0

according to https://docs.python.org/2/library/random.html

It's random.randrange(start, stop[, step]), so

random.randrange(0, 1670)

Google and docs are your friend, learn to use them.

Kache
  • 15,647
  • 12
  • 51
  • 79