change location and not duplicating results

Asked by Jeremy

So, I have a couple questions...

1) I used to have the old version of the jar. I would do a find. get the Match and do Match.click(). In some areas, I had to do Match.click().below(70).left(-75). However, I can't do that anymore. I have tried screen.click(match).below(70).left(-75), but it doesn't seem to work as it has in the past.

2) When doing multiple runs, I would close out of the screen. Open it back up. When I run a match.score() they are over 95%. However, when I try on the same screen with a different login, I can't get them to match up. It would appear that the location on the screen changes the percentage of the score. However, that is just a guess.

This is my code:
       while(option_selection.hasNext()){
        Match down_arrow = option_selection.next();
        if (down_arrow.getScore() < .96)
         continue;
        s.click(down_arrow);
        for (int x = 0; x <=10; x++){
         Thread.sleep(200);
         s.type(Key.UP);
        }
        s.type(Key.DOWN);
        s.type(Key.ENTER);
        Thread.sleep(500);

       }

It works with one user, but when I log into the next and on the same screen it doesn't work.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

what SikuliX versions we are talking about?

Revision history for this message
Jeremy (hsloan1a) said :
#2

So, I used to use the version that had sikuli-script.jar. When I go to the properties of it, I just have a modification date: 9/14/2011.

I upgraded it to your latest version I can't seem to use sikuli-script.jar anymore. I have sikulixapi.jar now. My guess would be 1.01 to 1.1.

However, the second problem existed on both versions. It was one of the reasons I upgraded. I'm running more and more complex code.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

problem 1:
Match.click().below(70).left(-75)
should have never worked: click() returns a number 0 or 1, which does not know anything about below.

what makes sense:

screen.click(Match.below(70).left(-75))

problem 2:

there must be some findAll before.

Best would be if you send me a complete code snippet including pictures and some screenshots all zipped together.
Find my mail at https://launchpad.net/~raimund-hocke (the one at top left!)

Can you help with this problem?

Provide an answer of your own, or ask Jeremy for more information if necessary.

To post a message you must log in.