← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #685815]: Drag drop to random (pre-defined) location

 

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

    Status: Open => Answered

TestMechanic proposed the following answer:
You need to fix script like that ( I test it with hover but you can run
it with your drag-drop)

import random
from random import choice

def position1():
    return Location(548,292)

def position2():
    return Location(633,293)

def position3():
    return Location(738,288)

def position4():
    return Location(817,284)

def randomDrop():
    positionOneToFour = [position1(), position2(), position3(), position4()]
    return random.choice(positionOneToFour)


def main():
    hover(randomDrop())
    print('done')

main()

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