Cannot capture other screen, shoud this be bug report?

Asked by CoLd As IcE on 2018-05-17

it sees the icon on both my screen it just cant click hover find or anything else on my second monitor, since i can only run this on that monitor.

http://prntscr.com/jizx8b

[error] script [ BOTing ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last): File "C:\Users\COLDAS~1\AppData\Local\Temp\Sikulix_2091426092\sikuli-2222790208724041746.py", line 1, in <module> hover(Pattern("1526550256319.png").exact()) Line 2782, in file Region.java
at org.sikuli.script.Region.wait(Region.java:2782)
at org.sikuli.script.Region.find(Region.java:2329)
at org.sikuli.script.Region.getLocationFromTarget(Region.java:3238)
at org.sikuli.script.Region.mouseMove(Region.java:4032)
at org.sikuli.script.Region.hover(Region.java:3693)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
org.sikuli.script.FindFailed: FindFailed: 1526550256319.png: (106x35) seen at (665, 214) with 1.00 in S(0)[0,0 1920x1080] E:Y, T:3.0 Line 2782, in file Regio

n.java

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
CoLd As IcE
Solved:
2018-05-19
Last query:
2018-05-19
Last reply:
2018-05-19
CoLd As IcE (coldasice) said : #2

do i do this inn the ide?

CoLd As IcE (coldasice) said : #3

SCREEN = Screen(1)
Screen(1)
print Screen.getBounds(1)
Region(1925,11,1890,979)
print getBounds()
find("1526736761414.png") secound monitor

java.awt.Rectangle[x=1920,y=0,width=1920,height=1080]
java.awt.Rectangle[x=0,y=0,width=1920,height=1080]

[error] script [ BOTing ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last): File "C:\Users\COLDAS~1\AppData\Local\Temp\Sikulix_1242605189\sikuli-4733532879306360584.py", line 6, in <module> find("1526736761414.png") Line 2782, in file Region.java
at org.sikuli.script.Region.wait(Region.java:2782)
at org.sikuli.script.Region.find(Region.java:2329)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
org.sikuli.script.FindFailed: FindFailed: 1526736761414.png: (114x106) in S(0)[0,0 1920x1080] E:Y, T:3.0 Line 2782, in file Region.java

RaiMan (raimund-hocke) said : #4

you have to tell SikuliX, that you are searching on Screen(1) or in a region on Screen(1):

scr1 = Screen(1)
matchOnSecondMonitor = scr1.find(someImage)

CoLd As IcE (coldasice) said : #5

seems like i have to use

region.

or screen(1).

hard to find that out ;(

CoLd As IcE (coldasice) said : #6

@RaiMan you answered the same time i found out what i did wrong :)
maby in the futrure let it be easyer to find how to use secound monitor, had to look hard ;(

RaiMan (raimund-hocke) said : #7

--- had to look hard ;(
Ok, understood and agreed.

The problem is, that the standard usage of SikuliX in the IDE using Python language has the convenience feature, that undotted function usage automatically are run against the standard Screen(), which normally is the primary monitor.

Without this convenience feature you would have to say:
scr = Screen(0)
scr.click(someImage)

I will add some notes to the docs for people who are not aware of the object oriented programming scenario.

CoLd As IcE (coldasice) said : #8

yeah, its nice when you have only 1 monitor ^^, in a way that you have to do that would help a lot if you have two monitors at least then u know u have to declare a screen to use program.
but keep it as it is, as long as you document it better