[Sikuli-driver] [Question #654227]: Use offset(Location(x, y)} but get wrong position some time

2017-07-30 Thread YO
New question #654227 on Sikuli:
https://answers.launchpad.net/sikuli/+question/654227

Hi! 

Here is the similar picture I use  in Sikuli:
  http://imgur.com/a/v1Ft5

Here is my code:

target = find(target_pic)#the link above
scene_list = ["","","","","",""]
scene_list[1] = target.offset(Location((- scene_offset*2), 0))  
scene_list[2] = target.offset(Location((- scene_offset*1), 0)) 
scene_list[3] = target.offset(Location(0, 0)) 
scene_list[4] = target.offset(Location((scene_offset*1), 0)) 
scene_list[5] = target.offset(Location((scene_offset*2), 0)) 

for pos in scene_list :
mouseMove (pos)
sleep(0.5)


  Sometimes when it runs, the position of scene[4] and scene[5] will move too 
East from the target.
For example, it would move from middle of scene[5], to the "wrong point" in the 
picture.

I am sure there is other similar picture when running the script(by using 
setROI )

And when it happens, restart the sikuli would be Okay then.

But I still want to know is there any other workaround that I can do.

Information:
  Using sikuli 1.1.1 build 2017-03-30 01:00
  Window 10
  CPU usage 55% max when running
  RAM usage 40 % max when running

Thank you!




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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #654227]: Use offset(Location(x, y)} but get wrong position some time

2017-07-30 Thread YO
Question #654227 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/654227

YO gave more information on the question:
The problem is a little strange, but "the massive offset" happens on
positive offset only.

The negative offset might also happen but not that "massive" to observe.

Did I accidentally trigger some bug?

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #654227]: Use offset(Location(x, y)} but get wrong position some time

2017-07-31 Thread dinev
Question #654227 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/654227

dinev posted a new comment:
Use  "highlight" command to visualize your target and subsequent calculation
There is a chance that initial target is not recognized correctly if you 
dynamic application

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #654227]: Use offset(Location(x, y)} but get wrong position some time

2017-08-01 Thread YO
Question #654227 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/654227

YO posted a new comment:
I have use  mouseMove(target)  to ensure the central point of the image
I found.

If the initial target is getting wrong, the whole offset in "scene_list"
would be the same, since I use the variable "scene_offset" to control.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #654227]: Use offset(Location(x, y)} but get wrong position some time

2017-08-01 Thread dinev
Question #654227 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/654227

dinev posted a new comment:
I do not see where scene_offset is calculated. Maybe this can be the
problem.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #654227]: Use offset(Location(x, y)} but get wrong position some time

2017-08-02 Thread YO
Question #654227 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/654227

YO gave more information on the question:
sorry, I miss to copy that line.

I set scene_offset = 450 at start.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #654227]: Use offset(Location(x, y)} but get wrong position some time

2017-08-02 Thread YO
Question #654227 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/654227

YO gave more information on the question:
Sorry for the Code, I have made some correction by adding extra scene_list[0].
Using the picture http://imgur.com/a/v1Ft5
and the code below, may get the same result sometimes.


sleep(1)
scene_offset = 200
target = find(Pattern("1501664009243.png").similar(0.50)) #please use the link 
above for the .png
mouseMove(target)
sleep(1)
scene_list = ["","","","","",""]
scene_list[0] = target.offset(Location((- scene_offset*3), 0))
scene_list[1] = target.offset(Location((- scene_offset*2), 0))
scene_list[2] = target.offset(Location((- scene_offset*1), 0))
scene_list[3] = target.offset(Location(0, 0))
scene_list[4] = target.offset(Location((scene_offset*1), 0))
scene_list[5] = target.offset(Location((scene_offset*2), 0))

for pos in scene_list :
mouseMove(pos)
sleep(0.5)

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #654227]: Use offset(Location(x, y)} but get wrong position some time

2017-08-02 Thread dinev
Question #654227 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/654227

Status: Open => Answered

dinev proposed the following answer:
Can you try replacing this part :

#
mouseMove(target)
sleep(1)
scene_list = ["","","","","",""]
scene_list[0] = target.offset(Location((- scene_offset*3), 0))
scene_list[1] = target.offset(Location((- scene_offset*2), 0))
scene_list[2] = target.offset(Location((- scene_offset*1), 0))
scene_list[3] = target.offset(Location(0, 0))
scene_list[4] = target.offset(Location((scene_offset*1), 0))
scene_list[5] = target.offset(Location((scene_offset*2), 0))

for pos in scene_list :
mouseMove(pos)
sleep(0.5)
##


with this:

#
mouseMove(target)
sleep(1)
mouseMove((- scene_offset*3), 0)
for i in range(1,6) :
mouseMove(scene_offset,0)
sleep(0.5)
##

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #654227]: Use offset(Location(x, y)} but get wrong position some time

2017-08-02 Thread YO
Question #654227 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/654227

YO confirmed that the question is solved:
Thanks dinev, that solved my question.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #654227]: Use offset(Location(x, y)} but get wrong position some time

2017-08-02 Thread YO
Question #654227 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/654227

Status: Answered => Solved

YO confirmed that the question is solved:
I've try and there is no bug for "mouseMove" by saving the mouse
Location.

sleep(1)
target = find(Pattern("1501664009243.png").similar(0.50)) #the link above
mouseMove(target)

sleep(0.3)
scene_offset = 125
mouseMove((- scene_offset*3), 0)
i = 0
scene_list = []
scene_list.append([])
scene_list[i] = Env.getMouseLocation ()
sleep(0.3)

for i in range(1,6) :
mouseMove(scene_offset,0)
sleep(0.3)
scene_list.append([])
scene_list[i] = Env.getMouseLocation ()

for j in scene_list:
mouseMove(j)
sleep(0.3)


but the code using offset(Location(x,y)) is so strange,
can I count it as a bug?

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp