← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #690371]: Drag and Drop random region

 

Question #690371 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/690371

    Status: Open => Answered

Manfred Hampl proposed the following answer:
Just a small modification, I had expected that you can do the required changes yourself.
Probably something like

import random
random.seed()

myRegion = ... # define your region by whatever means, e.g. by
specifying the coordinates, or as a match for a find action, ...

myX = myRegion.getX()
myY = myRegion.getY()
myW = myRegion.getW()
myH = myRegion.getH()

dragDrop(Location(random.randint(myX,myX+myW),random.randint(myY,myY+myH)),
Location(random.randint(myX,myX+myW),random.randint(myY,myY+myH)))

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.