[Sikuli-driver] [Question #708013]: getCenter on a user coded region returns a clickpoint on the bottom right of the region

2023-09-22 Thread Mark McGuinn
New question #708013 on SikuliX:
https://answers.launchpad.net/sikuli/+question/708013


I've defined a region using the Region command and when I do a highlight of the 
region is show corrrectly. But when I want to click on the region I use the 
gtCenter call but the clickpoint for the region is shown at the bottom right 
corner and when I try to do the click it does not activate the region.

I expect the getCenter command would return co-ordinates at the center of the 
region and when I click on this co-ordinate it would activate the region on the 
screen

My question is whether the getCenter call works with regions created with the 
Region call?

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

___
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


[Sikuli-driver] [Question #689848]: Is there a way of ensuring that only the required number of clicks are carried out?

2020-04-12 Thread Mark McGuinn
New question #689848 on Sikuli:
https://answers.launchpad.net/sikuli/+question/689848


I have an app which is designed to automate certain aspects of an auction 
process. The app cycles through the auction catalog to gather specific 
information on each item available. The catalog has the following format:




 

[x]  [1]   [4][7]   [8]   
[10]...
   [2]   [5][9]   
[11].
   [3]   [6]
[12}

The catalog is made up of multiple columns and each column can have 1,2 or 3 
items  in it. If you click on an item it drills down to give more detailed 
information on the item. Once you click back from the detailed information you 
are placed back at position [x] ( a design feature over which I have absolutely 
no control).

I have designed the sub-routine below to cycle through the items and position 
the cursor at the first item in a column. The  and  are clickable and 
move 6 columns across the catalog. The issue I am having is that when I use the 
loop to cycle to the correct column a variable number of clicks is being 
executed which means  that the cursor is not landing in the correct place and 
sometimes duplicate information is loaded, other times if more clicks than 
needed are executed information is loaded out of sequence. I an

I have tried to include a test to ensure that the click is being executed, I 
have also put a wait in to see if that makes a difference, it doesn't. The UI 
is so fast that when there is no wait in you can't see the items scrolling 
across the screen. My question therefore is, is there a way to ensure only the 
correct number of clicks is being executed?

def goto_car_column(cols):
right_tabs = 0
right_jumps = 0
Debug.user("The count at cols is.."+str(cols))
wait(1)
store_car ="Holder"
quicksteps = (cols - 10) // 6
normalsteps = (cols - 10) % 6
while right_jumps <= quicksteps:
click(Location(1566, 239))
car_reg = (Region(1340,221,151,31))
read_car = car_reg.text()

if store_car == read_car:
click(Location(1566, 239))
wait(1)
else:
store_car = read_car

right_jumps +=1

while right_tabs <= normalsteps:
   
#type (Key.RIGHT)
click(Location(958, 380))
wait(1)
right_tabs +=1

One thing to note as well is that the debug statement shows the correct value 
being passed to the routine.

-- 
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 #689782]: Region text read not always returning correct text

2020-04-09 Thread Mark McGuinn
Question #689782 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/689782

Status: Answered => Solved

Mark McGuinn confirmed that the question is solved:
The suggestion to use the space character as the delimiter instead
worked, thanks!

-- 
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 #689782]: Region text read not always returning correct text

2020-04-09 Thread Mark McGuinn
Question #689782 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/689782

Status: Needs information => Open

Mark McGuinn gave more information on the question:

as requested the ascii string after the ascii_reg.text() when the programs 
works is:

('The ascii text is-->', '\xc2\xa9 40,000 \xc2\xa9 78,000 H')

and when it doesn't is:

('The ascii text is-->', '\xc2\xa9 40,000 @ 78,000 ;')


It is not possible to do a copy/paste of the screen because the area is a 
'button' and if you try to right click on it to select it the button is 
triggered.

-- 
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 #689782]: Region text read not always returning correct text

2020-04-09 Thread Mark McGuinn
Question #689782 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/689782

Mark McGuinn gave more information on the question:
I thought it might be useful to add the output for when firstly the
program runs correctly:

('Character is ...', '\xc2')
('Character is ...', 194)
('Character is ...', '\xa9')
('Character is ...', 169)
('Character is ...', ' ')
('Character is ...', 32)
('Character is ...', '1')
('Character is ...', 49)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', ',')
('Character is ...', 44)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', ' ')
('Character is ...', 32)
('Character is ...', '\xc2')
('Character is ...', 194)
('Character is ...', '\xa9')
('Character is ...', 169)
('Character is ...', ' ')
('Character is ...', 32)
('Character is ...', '1')
('Character is ...', 49)
('Character is ...', '6')
('Character is ...', 54)
('Character is ...', ',')
('Character is ...', 44)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', '0')
('Character is ...', 48)
(
'Character is ...', ' ')
('Character is ...', 32)
('Character is ...', '|')
('Character is ...', 124)
('The result is -->', 1)
('The second result is -->', 11, 2)
('The bid is ', '1')
('The ask is ', '16000')

and secondly when it doesn't:

('Character is ...', '\xc2')
('Character is ...', 194)
('Character is ...', '\xa9')
('Character is ...', 169)
('Character is ...', ' ')
('Character is ...', 32)
('Character is ...', '1')
('Character is ...', 49)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', ',')
('Character is ...', 44)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', ' ')
('Character is ...', 32)
('Character is ...', '@')
('Character is ...', 64)
('Character is ...', ' ')
('Character is ...', 32)
('Character is ...', '1')
('Character is ...', 49)
('Character is ...', '6')
('Character is ...', 54)
('Character is ...', ',')
('Character is ...', 44)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', '0')
('Character is ...', 48)
('Character is ...', ' ')
('Character is ...', 32)
('Charact
er is ...', '|')
('Character is ...', 124)
('The result is -->', 1)
('The second result is -->', 1, 2)
('The bid is ', '')
('The ask is ', '116000')

-- 
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


[Sikuli-driver] [Question #689782]: Region text read not always returning correct text

2020-04-08 Thread Mark McGuinn
New question #689782 on Sikuli:
https://answers.launchpad.net/sikuli/+question/689782

I have a auction app which reads the region on the screen containing 
information on the current bid position and the amount the vendor wants in 
order to sell the item immediately. The fields are shown on the screen as shown 
in the following example.

(CR)  4,000 (CR) 2

Because the size of the area containing the amounts of the bid and the ask can 
vary what I do is define a region which contains all of the information and 
then read the text which I then manipulate to extract the numbers as integers. 
I do this by looking for a special character in the text (The ")" character 
ascii 169) and then using that to split out the number which I  then convert 
into an integer. I have included a simple test piece of code below.

The problem is that after a variable amount of times read the text I will get a 
-1 returned indicating that the special character was not found even though it 
was on the screen. If I rerun the code on the same image it will work with 
nothing changed in either the code or on the screen.

My question therefore is whether  the region.text() call is problematic or if 
there is an issue with the way I am doing things. As usual any help would be 
much appreciated.

The code snippet:


import re
loc_code = 0
if loc_code == 0:
ascii_reg =(Region(460,381,366,41))
else:
ascii_reg = (Region(561,762,258,30))
ascii_text = ascii_reg.text()
ore_count =0 
ore = len(ascii_text)

while ore_count < ore:
print("Character is ...",ascii_text[ore_count])
print("Character is ...",ord(ascii_text[ore_count]))
ore_count +=1

result = ascii_text.find(chr(169))
print("The result is -->",result)
result2 =ascii_text.find(chr(169),result+1)
print("The second result is -->",result2,result+1)
bid_val = ascii_text[result:result2]
# print("The ask is -->",ask_val)
bid_val_i =  re.sub("[^0-9]","",bid_val)   
bid_s = bid_val_i.replace(',','')
int_bid_val = int(bid_s)

ask_val = ascii_text[result2+1:ore]
ask_val_i = re.sub("[^0-9]","",ask_val)
ask_s = ask_val_i.replace(',','')
int_ask_val = int(ask_s)

print("The bid is ",bid_s)
print("The ask is ",ask_s)





-- 
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 #688106]: Reload error when no reload calls present

2020-01-19 Thread Mark McGuinn
Question #688106 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/688106

Status: Needs information => Open

Mark McGuinn gave more information on the question:
The script is being run in the IDE and below are the lines with import:

def auction_control():



myScriptPath = "c:\\Users\\mmcguinn\\Documents"
if not myScriptPath in sys.path: sys.path.append(myScriptPath)
from sikuli import *
from ast import literal_eval
from mensel import *
from bidding import *
from auction_questions import *


import unittest
Settings.OcrReadText = True
Settings.OcrLanguage="ENG"
Settings.DebugLogs = True
import java.lang.System
import java.util.Arrays
import java.lang.Object
import java.awt.event.InputEvent
import java.io.FilterInputStream 
from java import *
import unittest
import re
import xlrd
import xlwt
import call_auction
import os.path

-- 
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


[Sikuli-driver] [Question #688106]: Reload error when no reload calls present

2020-01-19 Thread Mark McGuinn
New question #688106 on Sikuli:
https://answers.launchpad.net/sikuli/+question/688106

I have a main control routine which calls 4 sub-routines to do various things. 
However when I try to run the main routine I get the following error:

[error] IDE: Run Script: internal error:
Traceback (most recent call last):
  File "", line 1, in 
TypeError: reload() argument must be a module

The thing is that there is no reload calls anywhere in the code. I am confused 
as to why this error i occurring and would welcome any pointers as to its cause.

-- 
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 #687794]: Calling a click from a sub-routine causes an exception.

2020-01-13 Thread Mark McGuinn
Question #687794 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687794

Status: Needs information => Open

Mark McGuinn gave more information on the question:
My apologies, I did not do a specific import of the routines, I thought
that they would be imported automatically as outlined in the
Documentation


Sikuli automatically finds other Sikuli scripts in the same directory, when 
they are imported

I guess I misunderstood what the documentation was saying.

-- 
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 #687794]: Calling a click from a sub-routine causes an exception.

2020-01-13 Thread Mark McGuinn
Question #687794 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687794

Mark McGuinn gave more information on the question:
Looking into the issue to try and find a workaround I discovered that
the image path does not contain the sub-routine folder as it apparently
should. If you manually add the directory to the default image path then
the image that is being looked for is found.

-- 
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 #687794]: Calling a click from a sub-routine causes an exception.

2020-01-13 Thread Mark McGuinn
Question #687794 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687794

Mark McGuinn posted a new comment:
HI, I was wonderng if anyone has had the time to look at this issue. If
they have is it reproducible from the simple example above?

-- 
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 #687794]: Calling a click from a sub-routine causes an exception.

2020-01-10 Thread Mark McGuinn
Question #687794 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687794

Status: Answered => Open

Mark McGuinn is still having a problem:
Here is the simplest test case:

result = test()
print result

which calls:


def test():
click("1578666326196.png")
return(0)

The image it is calling is just the "Sikuli" link on the page above. The
error as reported is:


[error] ImagePath: find: not there: 1578666326196.png
[error] script [ call_bug_routine ] stopped with error in line 1
[error] FindFailed ( 1578666326196.png not loaded )
[error] --- Traceback --- error source first
line: module ( function ) statement 
2: bug_routine (  test ) click("1578666326196.png")
1: main (   ) resu8lt = test()
[error] --- Traceback --- end --

-- 
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 #687794]: Calling a click from a sub-routine causes an exception.

2020-01-10 Thread Mark McGuinn
Question #687794 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687794

Status: Answered => Open

Mark McGuinn is still having a problem:
This is marked as answered but the bug remains. What do I need to do to
confirm it is 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


Re: [Sikuli-driver] [Question #687794]: Calling a click from a sub-routine causes an exception.

2020-01-06 Thread Mark McGuinn
Question #687794 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687794

Description changed to:
Below is a simple test case which shows the problem. The click command
if called on its own works fine, however if you try to call it from a
sub-routine then you get an exception saying the image file could not be
found

result = test_auction(1000,1000)
print result

the called routine:

def test_auction(high_bid,low_bid):


click(Pattern("1575297163479-1.png").similar(0.80))

The error message:

[error] script [ ttauction ] stopped with error in line 2
[error] FindFailed ( 1575297163479-1.png: (37x31) in R[0,0 1680x1050]@S(0) )
[error] --- Traceback --- error source first
line: module ( function ) statement 
5: Sauction (  test_auction ) 
click(Pattern("1575297163479-1.png").similar(0.80))
2: main (   ) result = test_auction(1000,1000)
[error] --- Traceback --- end --

This is Sikuli 2.0.1 on Windows 10 (64 bit). I have also tried without
the similar option and that makes no difference . I also tried a sub-
routine with o parameters and again no difference.


The image does exist before the call is made there is no waiting for an image 
to appear. The code runs ok on the same page if not called from the subroutine.

-- 
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


[Sikuli-driver] [Question #687794]: Calling a click from a sub-routine causes an exception.

2020-01-06 Thread Mark McGuinn
New question #687794 on Sikuli:
https://answers.launchpad.net/sikuli/+question/687794

Below is a simple test case which shows the problem. The click command if 
called on its own works fine, however if you try to call it from a sub-routine 
then you get an exception saying the image file could not be found

result = test_auction(1000,1000)
print result

the called routine:

def test_auction(high_bid,low_bid):


click(Pattern("1575297163479-1.png").similar(0.80))

The error message:

[error] script [ ttauction ] stopped with error in line 2
[error] FindFailed ( 1575297163479-1.png: (37x31) in R[0,0 1680x1050]@S(0) )
[error] --- Traceback --- error source first
line: module ( function ) statement 
5: Sauction (  test_auction ) 
click(Pattern("1575297163479-1.png").similar(0.80))
2: main (   ) result = test_auction(1000,1000)
[error] --- Traceback --- end --

This is Sikuli 2.0.1 on Windows 10 (64 bit). I have also tried without the 
similar option and that makes no difference . I also tried a sub-routine with o 
parameters and again no difference.

-- 
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


[Sikuli-driver] [Bug 1858343] [NEW] Calling a click from a sub-routine causes an exception.

2020-01-05 Thread Mark McGuinn
Public bug reported:

Below is a simple test case which shows the problem. The click command
if called on its own works fine, however if you try to call it from a
sub-routine then you get an exception saying the image file could not be
found

result = test_auction(1000,1000)
print result

the called routine:

def test_auction(high_bid,low_bid):


click(Pattern("1575297163479-1.png").similar(0.80))

The error message:

[error] script [ ttauction ] stopped with error in line 2
[error] FindFailed ( 1575297163479-1.png: (37x31) in R[0,0 1680x1050]@S(0) )
[error] --- Traceback --- error source first
line: module ( function ) statement 
5: Sauction (  test_auction ) 
click(Pattern("1575297163479-1.png").similar(0.80))
2: main (   ) result = test_auction(1000,1000)
[error] --- Traceback --- end --

This is Sikuli 2.0.1 on Windows 10 (64 bit). I have also tried without
the similar option and that makes no difference . I also tried a sub-
routine with o parameters and again no difference.

** Affects: sikuli
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1858343

Title:
  Calling a click from a sub-routine causes an exception.

Status in Sikuli:
  New

Bug description:
  Below is a simple test case which shows the problem. The click command
  if called on its own works fine, however if you try to call it from a
  sub-routine then you get an exception saying the image file could not
  be found

  result = test_auction(1000,1000)
  print result

  the called routine:

  def test_auction(high_bid,low_bid):

  
  click(Pattern("1575297163479-1.png").similar(0.80))

  The error message:

  [error] script [ ttauction ] stopped with error in line 2
  [error] FindFailed ( 1575297163479-1.png: (37x31) in R[0,0 1680x1050]@S(0) )
  [error] --- Traceback --- error source first
  line: module ( function ) statement 
  5: Sauction (  test_auction ) 
click(Pattern("1575297163479-1.png").similar(0.80))
  2: main (   ) result = test_auction(1000,1000)
  [error] --- Traceback --- end --

  This is Sikuli 2.0.1 on Windows 10 (64 bit). I have also tried without
  the similar option and that makes no difference . I also tried a sub-
  routine with o parameters and again no difference.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1858343/+subscriptions

___
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 #687690]: Use of a Mask

2020-01-01 Thread Mark McGuinn
Question #687690 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687690

Status: Answered => Solved

Mark McGuinn confirmed that the question is solved:
Many, many thanks for the quick response which appears to have sorted
out 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


[Sikuli-driver] [Question #687690]: Use of a Mask

2019-12-31 Thread Mark McGuinn
New question #687690 on Sikuli:
https://answers.launchpad.net/sikuli/+question/687690

Hi,

  I am trying to use the Pattern mask feature to search for an image. Below is 
the code I have written, but this code causes an exception, is there something 
wrong with the code?

new_img = Pattern("1577396415423.png").mask
if exists ( new_img ):
print("found it")

The exceptions is:


[error] script [ tepm ] stopped with error in line 6
[error] java.lang.RuntimeException ( sikulix.RuntimeException: find, wait, 
exists: invalid parameter:  )

This is on 2.0.1 on Windows 10.

-- 
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


[Sikuli-driver] [Bug 1856450] Re: looks like an extra Click being added by IDE during loop --- definitely no

2019-12-27 Thread Mark McGuinn
Unfortunately the wait sis not solve the issue, and with the debug set
to level 3 it is not recording the extra activity after the item is
found. The debug shows the script finding the item, and then it logs the
click at a specified location, it does not however log the click which
takes the item back to ANY and thus the wrong results are returned from
the script. I can provide a recording showing the behaviour along with
the debug log.

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1856450

Title:
  looks like an extra Click being added by IDE during loop ---
  definitely no

Status in Sikuli:
  New

Bug description:
  Hi,
  the following script is designed to loop through a menu item until it fins 
the one it is looking for and when it does it stops the loop and is supposed to 
click a confirm button which takes the screen to another page. However what is 
happening is that the IDE finds the correct option but adds another click which 
takes the menu on to the next option before it clicks confirm which means it is 
confirming the wrong item. In the log file the extra click does not seems to be 
recorded but it does happen. Below is the code snippet and the logfile with 
debug(3) set. As far as I can tell the code logic is sound but if there is a 
problem with it which is causing the extra click please point it out. The code 
is looking for "BMW 2002 TURBO" but it is find that and then clicking on:

  try:
  while found == 0:
    print("About to click")
    click("1576020708907.png")
    print("clicking")
    current_model = model_region.text()
    wait(1)

    if current_model == find_model:
  print("Found It")
  found = 1
  print ("Found is = ",found)
  click("1576403393174.png")
  break
  # wait(5)

    elif current_model == "ANY":
  print("Did Not Find -->",find_model)
  break
  except:
     print("Caught exception ")

  The debug output is:
   more ...
  [debug] highlight R[1157,402 233x37]@S(0) for 2.0 secs
  ('M is -->', 'BMW |')
  ('Storecar is -->', 'BMW')
  exact match
  [debug] DOUBLE CLICK on L[1273,420]@S(0) (558 msec)
  [debug] Image: reused: 1576019906865.png 
(file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1576019906865.png)
  [debug] Region: wait: waiting 3.0 secs for 1576019906865.png to appear in 
R[0,0 1680x1050]@S(0)
  
  [debug] Region: wait: 1576019906865.png appeared (M[788,457 56x32]@S(0) 
S:0.99 C:816,473 [510 msec])
  [debug] CLICK on L[816,473]@S(0) (523 msec)
  [debug] Finder2: makeMat: INT_RGB (223x36)
  [debug] Image: reused: 1576020708907.png 
(file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1576020708907.png)
  [debug] Region: wait: waiting 3.0 secs for 1576020708907.png to appear in 
R[0,0 1680x1050]@S(0)
  About to click
  
  [debug] Region: wait: 1576020708907.png appeared (M[789,451 44x43]@S(0) 
S:0.93 C:811,472 [167 msec])
  clicking
  [debug] CLICK on L[811,472]@S(0) (527 msec)
  [debug] Finder2: makeMat: INT_RGB (223x36)
  ('Did Not Find -->', 'BMW 2002 TURBO')

  The IDE version is 2.0.1 running on Windows 10 64 bit Version
  10.0.18362 Build 18362

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1856450/+subscriptions

___
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 #687415]: IDE: How to solve/track strange problems

2019-12-24 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Answered => Open

Mark McGuinn is still having a problem:
I get the error with the following simple test


max_bid = 5

I have emailed a screenshot of the error to the sikuli account as there
does not appear a way to upload it to this app.

-- 
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 #687415]: IDE: How to solve/track strange problems

2019-12-24 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Mark McGuinn gave more information on the question:
Yes the problem still exists.

Sent from my Huawei phone


 Original message 
From: Mark McGuinn 
Date: Mon, 23 Dec 2019, 18:22
To: bb...@hotmail.com
Subject: Re: [Question #687415]: IDE: How to solve/track strange problems
Your question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Answered => Open

You are still having a problem:
Manfred,

apologies for the mis-assignment on the code, given that the code which
I forgot to include is now available to you are you able to reproduce
the problem?

Thanks
Mark


The Future Is Certain Give Us Time To Work It Out

From: boun...@canonical.com  on behalf of Manfred Hampl 

Sent: Monday 23 December 2019 18:03
To: bb...@hotmail.com 
Subject: Re: [Question #687415]: IDE: How to solve/track strange problems

Your question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Open => Answered

Manfred Hampl proposed the following answer:
But that definition (which isn't my proposal) is missing in your comment
#13

Repeating RaiMan's command #8: please do not reply with history!

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/687415/+confirm?answer_id=17

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/687415

You received this question notification because you asked the question.

--
You received this question notification because you asked the 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 #687415]: IDE: How to solve/track strange problems

2019-12-23 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Answered => Open

Mark McGuinn is still having a problem:
Manfred,

 apologies for the mis-assignment on the code, given that the code which
I forgot to include is now available to you are you able to reproduce
the problem?

Thanks
Mark


The Future Is Certain Give Us Time To Work It Out

From: boun...@canonical.com  on behalf of Manfred Hampl 

Sent: Monday 23 December 2019 18:03
To: bb...@hotmail.com 
Subject: Re: [Question #687415]: IDE: How to solve/track strange problems

Your question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Open => Answered

Manfred Hampl proposed the following answer:
But that definition (which isn't my proposal) is missing in your comment
#13

Repeating RaiMan's command #8: please do not reply with history!

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/687415/+confirm?answer_id=17

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/687415

You received this question notification because you asked the 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 #687415]: IDE: How to solve/track strange problems

2019-12-23 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Needs information => Open

Mark McGuinn gave more information on the question:

Hi Manfred,

  the definition is the one you proposed i.e.

def test_if_char(value):
for e in value:​
if ord(e) > 255: return False​
return True

regards
Mark


The Future Is Certain Give Us Time To Work It Out

From: boun...@canonical.com  on behalf of Manfred Hampl 

Sent: Monday 23 December 2019 17:23
To: bb...@hotmail.com 
Subject: Re: [Question #687415]: IDE: How to solve/track strange problems

Your question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Open => Needs information

Manfred Hampl requested more information:
Where is the definition of test_if_char ?

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/sikuli/+question/687415

You received this question notification because you asked the 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 #687415]: IDE: How to solve/track strange problems

2019-12-23 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Answered => Open

Mark McGuinn is still having a problem:
Changed all the variable names to be the same and the lines still fail.

-- 
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 #687415]: IDE: How to solve/track strange problems

2019-12-23 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Needs information => Open

Mark McGuinn gave more information on the question:
Hi Manfred,

   below is the simplified script plus a sub-routine it calls. Attached
are a couple of screen shots showing the various possible elements in
the time area which I am trying to process. I hope sending this directly
to you is ok,

Mark


​
def make_bid(bid_amount):​
​
#​
# Here check that ​
​
​
Debug.user("In make_bid")​
print("In Make Bid")​
if exists ("1576597641783.png",5):​
#​
# ​
click("1576597838526.png")​
wait("1576597897207.png")​
click("1576597948174.png")​
print("Bid Placed")​
return(1)​
​
 #​
 # if ending soon is not present somethin went wrong, either we are too early​
 # or someone bought the item​
​
elif exists ("1577013855062.png",2) :​
print("Auction Complete")​
return(1)​
​
else:​
print(" Auction is not ending yet need to rerty")​
return (2)​
​
​
#​
# need to loop back to calling proc​
​
max_bid = 5​
time_left_i = get_time_left(Region(260,692,89,29))​
#time_split = time_left_i.split(" ")​
print("The len of time_left_i is:",len(time_left_i))​
print("Time Left i1..",time_left_i)​
​
if time_left_i[0] == "PLETE":​
print("Auction Over")​
​
elif time_left_i[0] == "SOON":​
make_bid(max_bid)​
# elif test_if_char(time_lefti[0])​  # <--- These lines cause the 
problem
 #   print("Empty string")​​#  <
 #break​​   #  <
else:​
 wait_time_1 =  re.sub("[^0-9]","",time_left_i[0])​
 print("Wait time 1 is ",wait_time_1)​
 print("The type of wait_time_ is:",type(wait_time_1))   ​
 result = isinstance(wait_time_1, str)​
 print(wait_time_1,'instance of string?', result)​


The Future Is Certain Give Us Time To Work It Out

From: boun...@canonical.com  on behalf of Manfred Hampl 

Sent: Monday 23 December 2019 15:43
To: bb...@hotmail.com 
Subject: Re: [Question #687415]: IDE: How to solve/track strange problems

Your question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Open => Needs information

Manfred Hampl requested more information:
Can you provide a simplified version of your script - as short as
possible but still failing, and provide the full text?

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/sikuli/+question/687415

You received this question notification because you asked the 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 #687415]: IDE: How to solve/track strange problems

2019-12-23 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Needs information => Open

Mark McGuinn gave more information on the question:

Adding the *:* after the if makes no difference to the exception being raised. 
The def for get time left is:

def get_time_left(reg):
return reg.text().split(" ")

-- 
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 #687415]: IDE: How to solve/track strange problems

2019-12-23 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Answered => Open

Mark McGuinn is still having a problem:
I've done what was suggested and am still getting the error when the
test procedure basically contains just the if statement:


   def test():   
# 
 time_left_i = get_time_left(Region(260,692,89,29)) 
if  time_left_i[0] == ""
  print("Empty string")​

-- 
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 #687415]: Strange problem or a bug in Sikuli

2019-12-23 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Needs information => Open

Mark McGuinn gave more information on the question:
Hi Manfred

   thanks for the followup. The exception is raised when the ide does a
check before executing the code therefore there is no print output just
the error message.

regards
Mark



The Future Is Certain Give Us Time To Work It Out

From: boun...@canonical.com  on behalf of Manfred Hampl 

Sent: Monday 23 December 2019 07:44
To: bb...@hotmail.com 
Subject: Re: [Question #687415]: Strange problem or a bug in Sikuli

Your question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Open => Needs information

Manfred Hampl requested more information:
What is the last output before that error message?

I assume it should be the output of
print("Time Left i...",time_left_i)​

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/sikuli/+question/687415

You received this question notification because you asked the 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 #687415]: Strange problem or a bug in Sikuli

2019-12-22 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Answered => Open

Mark McGuinn is still having a problem:
Manfred,

   thanks for the suggestion, unfortunately it is causing an exception
when I try to implement it:


[error] script [ auction_control ] stopped with error at line --unknown--
[error] Error caused by: java.lang.IllegalArgumentException: Cannot create 
PyString with non-byte value

I had a look for the error and there is a suggestion that this is a
problem in jython. I am also still wondering why the correct code is
returned when the int() function is not used, but when it is there  a
problem shows up even when the screen is exactly the same.

regards
Mark


The Future Is Certain Give Us Time To Work It Out

From: boun...@canonical.com  on behalf of Manfred Hampl 

Sent: Sunday 22 December 2019 18:04
To: bb...@hotmail.com 
Subject: Re: [Question #687415]: Strange problem or a bug in Sikuli

Your question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Open => Answered

Manfred Hampl proposed the following answer:
"ValueError ( invalid literal for int() with base 10: '' )​"

This indicates that the value that you wanted to convert was the empty
string which cannot be converted into a number.

My guess:
The screen shows something unexpected - not "PLETE", not "SOON", but also not a 
number, or the OCR program could not correctly interpret the text on the screen

Possible workaround:
In addition the the if-s for "PLETE" and "SOON" add also a branch for the case 
that time_left_i[0] is the empty string after the re.sub action.

maybe something like
…
elif time_left_i[0] == "":​
 print("Empty string")​
 break​
…

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/687415/+confirm?answer_id=3

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/687415

You received this question notification because you asked the 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


[Sikuli-driver] [Bug 1856450] Re: looks like an extra Click being added by IDE during loop --- definitely no

2019-12-22 Thread Mark McGuinn
Adding in the wait solved the problem.

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1856450

Title:
  looks like an extra Click being added by IDE during loop ---
  definitely no

Status in Sikuli:
  New

Bug description:
  Hi,
  the following script is designed to loop through a menu item until it fins 
the one it is looking for and when it does it stops the loop and is supposed to 
click a confirm button which takes the screen to another page. However what is 
happening is that the IDE finds the correct option but adds another click which 
takes the menu on to the next option before it clicks confirm which means it is 
confirming the wrong item. In the log file the extra click does not seems to be 
recorded but it does happen. Below is the code snippet and the logfile with 
debug(3) set. As far as I can tell the code logic is sound but if there is a 
problem with it which is causing the extra click please point it out. The code 
is looking for "BMW 2002 TURBO" but it is find that and then clicking on:

  try:
  while found == 0:
    print("About to click")
    click("1576020708907.png")
    print("clicking")
    current_model = model_region.text()
    wait(1)

    if current_model == find_model:
  print("Found It")
  found = 1
  print ("Found is = ",found)
  click("1576403393174.png")
  break
  # wait(5)

    elif current_model == "ANY":
  print("Did Not Find -->",find_model)
  break
  except:
     print("Caught exception ")

  The debug output is:
   more ...
  [debug] highlight R[1157,402 233x37]@S(0) for 2.0 secs
  ('M is -->', 'BMW |')
  ('Storecar is -->', 'BMW')
  exact match
  [debug] DOUBLE CLICK on L[1273,420]@S(0) (558 msec)
  [debug] Image: reused: 1576019906865.png 
(file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1576019906865.png)
  [debug] Region: wait: waiting 3.0 secs for 1576019906865.png to appear in 
R[0,0 1680x1050]@S(0)
  
  [debug] Region: wait: 1576019906865.png appeared (M[788,457 56x32]@S(0) 
S:0.99 C:816,473 [510 msec])
  [debug] CLICK on L[816,473]@S(0) (523 msec)
  [debug] Finder2: makeMat: INT_RGB (223x36)
  [debug] Image: reused: 1576020708907.png 
(file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1576020708907.png)
  [debug] Region: wait: waiting 3.0 secs for 1576020708907.png to appear in 
R[0,0 1680x1050]@S(0)
  About to click
  
  [debug] Region: wait: 1576020708907.png appeared (M[789,451 44x43]@S(0) 
S:0.93 C:811,472 [167 msec])
  clicking
  [debug] CLICK on L[811,472]@S(0) (527 msec)
  [debug] Finder2: makeMat: INT_RGB (223x36)
  ('Did Not Find -->', 'BMW 2002 TURBO')

  The IDE version is 2.0.1 running on Windows 10 64 bit Version
  10.0.18362 Build 18362

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1856450/+subscriptions

___
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 #687415]: Strange problem or a bug in Sikuli

2019-12-22 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Answered => Open

Mark McGuinn is still having a problem:
Hi RaiMan,

   many thanks for the response,i t has helped me to move things
forward. However there is still a problem which is difficult for me as a
newbie to sikuli and python to understand. Using the function you
provided I get back as string containing the time left, which is fine.
The problem arises when I try to convert the string to an int, I get the
situation where the string being returned doesn't contain a string with
a number instead it returns a string which is linked to the auction but
does not appear on the screen. Below is the code:

time_left_i = get_time_left(Region(260,692,89,29))
print("Time Left i...",time_left_i)​
if time_left_i[0] == "PLETE":​
print("Auction Over")​
break​
elif time_left_i[0] == "SOON":​
make_bid(max_bid)​
else:​
wait_time_1 =  re.sub("[^0-9]","",time_left_i[0]) ​
print("Wait time 1 is ",wait_time_1)​
print("The type of wait_time_ is:",type(wait_time_1))​
#wait_time_2 = int(wait_time_1)​
result = isinstance(wait_time_1, str)​
print(wait_time_1,'instance of string?', result)​
​
wait_time_2 = wait_time_1 * 60​
print("Wait time 3 is ",wait_time_2)​
   # wait_time = wait_time_1 - 5​
print("Else")​
#

This invalid string causes  an exception in the ide. It therefore
appears that the int() function is interfering with the reg.text call.
Is this possible?

Error caused by int()
[error] script [ auction_control ] stopped with error in line 95
[error] ValueError ( invalid literal for int() with base 10: '' )​
[error] --- Traceback --- error source first​
line: module ( function ) statement ​
95: main (   ) wait_time_2 = int(wait_time_1)​
[error] --- Traceback --- end --


Thanks
Mark


The Future Is Certain Give Us Time To Work It Out

From: boun...@canonical.com  on behalf of RaiMan 

Sent: Sunday 22 December 2019 13:38
To: bb...@hotmail.com 
Subject: Re: [Question #687415]: Strange problem or a bug in Sikuli

Your question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Status: Open => Answered

RaiMan proposed the following answer:
--- The names used in this piece of code are unique and only used in
these few lines

not really true: time_left_i

Surely not a SikuliX problem, but a coding flaw.

Make a new def: (I prefer camelCase over camel_case)

def getTimeLeft(reg):
return reg.text().split(" ")

and use this one:
time_left_i = getTimeLeft(Region(260,692,89,29))
print ("Time left i = ",time_left_i)

or completely get rid of the def:
time_left_i = Region(260,692,89,29).text().split(" ")
print ("Time left i = ",time_left_i)

if either of those works, you have to go back and check your coding.

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/687415/+confirm?answer_id=1

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/687415

You received this question notification because you asked the 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


[Sikuli-driver] [Bug 1857230] Re: Exist not finding image even though it exists

2019-12-22 Thread Mark McGuinn
Some more info:

If I run the script is sikuli1.1.3 then the following error is thrown:

[error] Image: could not be loaded: 
file:/C:/Users/mmcguinn/Documents/main_bid_test.sikuli/test_for_complete.png
[error] RunTimeIDE: ImageMissing: P(test_for_complete.png -- not valid!) S: 0.79

This happens even though the image is there and is accessible. The java
trace is:

[error] RunTimeIDE: Exists: Abort: Jython traceback - current first: bid_test 
(8) main_bid_test (2)
[error] script [ main_bid_test ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last): File 
"C:\Users\mmcguinn\Documents\main_bid_test.sikuli\main_bid_test.py", line 2, in 
 File "C:\Users\mmcguinn\Documents\bid_test.sikuli\bid_test.py", line 
8, in bid_test at java.lang.Thread.stop(Unknown Source)
at org.sikuli.script.RunTime.abortScripting(RunTime.java:74)
at org.sikuli.script.Region.exists(Region.java:2390)
at org.sikuli.script.Region.exists(Region.java:2370)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.refle

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1857230

Title:
  Exist not finding image even though it exists

Status in Sikuli:
  New

Bug description:
  In the script below the routine looks for the text "Auction Complete"
  and if it exists does something. The problem is that the image exists,
  and is shown if you do a pattern matching on the image but when you
  run the script the image is not detected even though it is there.

  Script

  outcome = bid_test()
  print("The outcome is...",str(outcome))


  def bid_test():
  Debug.user("In make_bid")
  print("In Make Bid")
   #
   # if ending soon is not present somethin went wrong, either we are too early
   # or someone bought the item

  if exists (Pattern("1577013855062.png").similar(0.79)) :
  print("Auction Complete")
  return(1)

  else:
  print(" Auction is not ending yet need to rerty")
  return (2)

  This is sikuli 2.0.1 on Win10 Pro 64 Bit Version 1903. I can provide a
  screen shot which has the image the script should detect.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1857230/+subscriptions

___
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


[Sikuli-driver] [Bug 1857230] [NEW] Exist not finding image even though it exists

2019-12-22 Thread Mark McGuinn
Public bug reported:

In the script below the routine looks for the text "Auction Complete"
and if it exists does something. The problem is that the image exists,
and is shown if you do a pattern matching on the image but when you run
the script the image is not detected even though it is there.

Script

outcome = bid_test()
print("The outcome is...",str(outcome))


def bid_test():
Debug.user("In make_bid")
print("In Make Bid")
 #
 # if ending soon is not present somethin went wrong, either we are too early
 # or someone bought the item

if exists (Pattern("1577013855062.png").similar(0.79)) :
print("Auction Complete")
return(1)

else:
print(" Auction is not ending yet need to rerty")
return (2)

This is sikuli 2.0.1 on Win10 Pro 64 Bit Version 1903. I can provide a
screen shot which has the image the script should detect.

** Affects: sikuli
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1857230

Title:
  Exist not finding image even though it exists

Status in Sikuli:
  New

Bug description:
  In the script below the routine looks for the text "Auction Complete"
  and if it exists does something. The problem is that the image exists,
  and is shown if you do a pattern matching on the image but when you
  run the script the image is not detected even though it is there.

  Script

  outcome = bid_test()
  print("The outcome is...",str(outcome))


  def bid_test():
  Debug.user("In make_bid")
  print("In Make Bid")
   #
   # if ending soon is not present somethin went wrong, either we are too early
   # or someone bought the item

  if exists (Pattern("1577013855062.png").similar(0.79)) :
  print("Auction Complete")
  return(1)

  else:
  print(" Auction is not ending yet need to rerty")
  return (2)

  This is sikuli 2.0.1 on Win10 Pro 64 Bit Version 1903. I can provide a
  screen shot which has the image the script should detect.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1857230/+subscriptions

___
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 #687415]: Strange problem or a bug in Sikuli

2019-12-21 Thread Mark McGuinn
Question #687415 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/687415

Mark McGuinn gave more information on the question:
This is the extracted routine:

def get_time():

time_reg = (Region(260,692,89,29))   
Debug.user("In Timer calculator...")   
time_left_s = time_reg.text()   
Debug.user("time_left_s = "+time_left_s)   
time_left_i = time_left_s.split(" ")

return(time_left_i)

and this is what calls it when it works:
time_left_i = get_time()
print ("Time left i = ",time_left_i)

-- 
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


[Sikuli-driver] [Question #687415]: Strange problem or a bug in Sikuli

2019-12-21 Thread Mark McGuinn
New question #687415 on Sikuli:
https://answers.launchpad.net/sikuli/+question/687415

Hi, I have an application which is designed to automate taking part in 
auctions. One of the functions in the app is to monitor the time left on the 
auction. It does this by defining a region where the timer appears and then 
grabs the text from there before doing some processing on the text  to convert 
it into a number.

   time_reg = (Region(260,692,89,29))
   Debug.user("In Timer calculator...")
   time_left_s = time_reg.text()
 #  Debug.user("time_left_s = "+time_left_s)
   time_left_i = time_left_s.split(" ")
  # time_left_j = time_left_i.split()
   print ("Time left i = ",time_left_i)
   number_of_elements = len(time_left_i)

The problem is that the time_reg.text() call is finding text  which does not 
exists when I call it from my procedure. If I extract the code to a function on 
its own and then call that from a simple piece of code it finds the correct 
information. If I call the procedure from my main procedure it doesn't.  The 
names used in this piece of code are unique and only used in these few lines. 
The phantom text that is found is pretty consistent in that it relates to the 
item being auctioned (cars), for example:

('Time left i = ', ['|', 'ASTI'])

But this string appears nowhere on the screen never mind in the region defined 
by time_reg. My question therefore is: is this a bug in Sikuli ?

-- 
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


[Sikuli-driver] [Bug 1856450] [NEW] Extra Click being added by IDE during loop

2019-12-15 Thread Mark McGuinn
Public bug reported:

Hi,
the following script is designed to loop through a menu item until it fins the 
one it is looking for and when it does it stops the loop and is supposed to 
click a confirm button which takes the screen to another page. However what is 
happening is that the IDE finds the correct option but adds another click which 
takes the menu on to the next option before it clicks confirm which means it is 
confirming the wrong item. In the log file the extra click does not seems to be 
recorded but it does happen. Below is the code snippet and the logfile with 
debug(3) set. As far as I can tell the code logic is sound but if there is a 
problem with it which is causing the extra click please point it out. The code 
is looking for "BMW 2002 TURBO" but it is find that and then clicking on:

try:
while found == 0:  
  print("About to click")   
  click("1576020708907.png")
  print("clicking")
  current_model = model_region.text()
  wait(1)

  if current_model == find_model:
print("Found It")
found = 1
print ("Found is = ",found)
click("1576403393174.png")
break
# wait(5)
   
  elif current_model == "ANY":
print("Did Not Find -->",find_model)
break
except:
   print("Caught exception ")

The debug output is:
[debug] HotkeyManager: add  Hotkey: CTRL F1 (112, 2)
[debug] Image: reused: 1575998355996.png 
(file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998355996.png)
[debug] Region: wait: waiting 3.0 secs for 1575998355996.png to appear in R[0,0 
1680x1050]@S(0)
[debug] Finder2: makeMat: INT_RGB (43x22)
[debug] Finder2: makeMat: 3BYTE_BGR (43x22)
[debug] Finder2: doFind: start (stdDev: 123.8099 mean: 673.958774)
[debug] Finder2: doFind: in original: %0. (?99) 0 msec 
[debug] Finder2: doFind: end 0 msec
[debug] Region: checkLastSeen: not there
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: makeMat: 3BYTE_BGR (43x22)
[debug] Finder2: doFind: start (stdDev: 123.8099 mean: 673.958774)
[debug] Finder2: doFind: in original: %98.5212 (?80) 130 msec 
[debug] Finder2: doFind: end 130 msec
[debug] Region: wait: 1575998355996.png appeared (M[1072,204 43x22]@S(0) S:0.99 
C:1093,215 [181 msec])
[debug] DOUBLE CLICK on L[1093,215]@S(0) (570 msec)
[debug] Image: reused: 1575998402284.png 
(file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998402284.png)
[debug] Region: wait: waiting 3.0 secs for 1575998402284.png to appear in R[0,0 
1680x1050]@S(0)
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: makeMat: 3BYTE_BGR (158x29)
[debug] Finder2: doFind: start (stdDev: 287.3884 mean: 251.658010)
[debug] Finder2: doFind: in original: %40.2877 (?70) 160 msec 
[debug] Finder2: doFind: end 160 msec
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: doFind: start (stdDev: 287.3884 mean: 251.658010)
[debug] Finder2: doFind: in original: %95.5664 (?70) 172 msec 
[debug] Finder2: doFind: end 172 msec
[debug] Region: wait: 1575998402284.png appeared (M[759,504 158x29]@S(0) S:0.96 
C:838,518 [551 msec])
[debug] Image: reused: 1575998609275.png 
(file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998609275.png)
[debug] Region: wait: waiting 3.0 secs for 1575998609275.png to appear in R[0,0 
1680x1050]@S(0)
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: makeMat: 3BYTE_BGR (150x22)
[debug] Finder2: doFind: start (stdDev: 284.4761 mean: 359.097576)
[debug] Finder2: doFind: in original: %99.4264 (?70) 157 msec 
[debug] Finder2: doFind: end 157 msec
[debug] Region: wait: 1575998609275.png appeared (M[763,506 150x22]@S(0) S:0.99 
C:838,517 [202 msec])
[debug] CLICK on L[838,517]@S(0) (531 msec)
[debug] Image: reused: 1575998641601.png 
(file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998641601.png)
[debug] Region: wait: waiting 3.0 secs for 1575998641601.png to appear in R[0,0 
1680x1050]@S(0)
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: makeMat: 3BYTE_BGR (35x21)
[debug] Finder2: doFind: start (stdDev: 110.1870 mean: 397.500680)
[debug] Finder2: doFind: in original: %47.0695 (?70) 136 msec 
[debug] Finder2: doFind: end 136 msec
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: doFind: start (stdDev: 110.1870 mean: 397.500680)
[debug] Finder2: doFind: in original: %97.8258 (?70) 130 msec 
[debug] Finder2: doFind: end 130 msec
[debug] Region: wait: 1575998641601.png appeared (M[827,549 35x21]@S(0) S:0.98 
C:844,559 [519 msec])
[debug] CLICK on L[844,559]@S(0) (532 msec)
[debug] Image: reused: 1575998671670.png 
(file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998671670.png)
[debug] Region: wait: waiting 5.0 secs for 1575998671670.png to appear in R[0,0 
1680x1050]@S(0)
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: makeMat: 3BYTE_BGR (115x37)

Re: [Sikuli-driver] [Question #686932]: Is it possible to pass a variable to the Region command?

2019-12-11 Thread Mark McGuinn
Question #686932 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/686932

Status: Answered => Solved

Mark McGuinn confirmed that the question is solved:
Many thanks for ending my frustration on this one! Just for completeness
incase anyone is looking at this later the x_cord_s has to be an integer
otherwise you'll trigger the coercion error.

-- 
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


[Sikuli-driver] [Question #686932]: Is it possible to pass a variable to the Region command?

2019-12-11 Thread Mark McGuinn
New question #686932 on Sikuli:
https://answers.launchpad.net/sikuli/+question/686932

Hi,

 I am trying to dynamically create regions on the screen at different locations 
and want to pass the Region() command a variable containing  the co-ordinates 
of the new region.

base_loc = str("("+x_cord_s+","+y_cord_s+","+w_const_s+","+h_const_s+")")
reg2 = Region(base_loc)

 However when I do that it returns an error:

[error] script [ build_index ] stopped with error in line 105
[error] TypeError ( org.python.proxies.sikuli.Region$Region$3(): 1st arg can't 
be coerced to boolean, java.awt.Rectangle, org.sikuli.script.Region )
[error] --- Traceback --- error source first
line: module ( function ) statement 
105: main (   ) reg2 = Region(base_loc)
[error] --- Traceback --- end --

If I enter the exact same coordinates manually it works. I've tried passing a 
string variable and an integer variable neither worked. My question is can this 
be done and if it can How?

-- 
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 #686745]: What am I doing wrong?

2019-12-10 Thread Mark McGuinn
Question #686745 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/686745

Status: Answered => Solved

Mark McGuinn confirmed that the question is solved:
Thanks for the response, the changes you suggested solve the issue,
cheers

-- 
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 #686745]: What am I doing wrong?

2019-12-10 Thread Mark McGuinn
Question #686745 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/686745

Status: Answered => Open

Mark McGuinn is still having a problem:
Because the down arrow does not appear the system starts to print out
the string:

Auctions True but no downlit arrow-->

It should add in test_string a variable which contains "true", however
the system hangs and the only way to get it back is to kill the process.

-- 
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


[Sikuli-driver] [Question #686745]: Am I doing something wrong or is this a bug in Sikuli

2019-12-06 Thread Mark McGuinn
New question #686745 on Sikuli:
https://answers.launchpad.net/sikuli/+question/686745


Hi,

I am writing a script to gather some info from a auction site. I ran into a 
problem and tried to use the debug features of Sikuli. However the simple 
script below hangs when it tries to print out a string and variable. Is there 
something I am missing or is this a bug:


rom sikuli import *
from ast import literal_eval
import unittest
Settings.OcrReadText = True
Settings.OcrLanguage="ENG"
import java.lang.System
import java.util.Arrays
import java.lang.Object
import java.awt.event.InputEvent
import java.io.FilterInputStream 
from java import *
import unittest
import re
import org.sikuli.basics.Debug
import org.sikuli.script.ImagePath;
import org.sikuli.script.Match;
import org.sikuli.script.Screen;
#public class Arrays
 #   java.lang.Object
# import java.io.Object
Settings.OcrTextSearch=True
Settings.OcrTextRead=True
Settings.UserLogs = True
Settings.UserLogPrefix = "user"
Settings.UserLogTime = True
Debug.setUserLogFile("C:\\Users\\mmcguinn\\Documents\\sikuli_log.txt")
Debug.on(3)
strippedString = [12345]
def takeSecond(val):
return val[1]
def runkey(event):
global running
running = False
stored_info =   []
sorted_stored_info= []
Env.addHotkey(Key.F1,KeyModifier.CTRL,runkey)
import java.util
import java.lang.System
import java.lang.Object
import java.awt.event.InputEvent
carmake = "FORD"
counter = 0

def end_loop(val):
return val[1]



wait( "1575294322743.png")

# check if there are any auctions
#

auctions_reg = ("1575542482620.png")

if exists (auctions_reg):
print("No Auctions")
Debug.user("No Auctions")
Auctions = False
else:
 print("Auctions ")   
 Debug.user("Auctions ")
 lowestbid = 0   
 lowestask = 0
 auction_count = 0
 Auctions = True 
 Continue = True
 test_str = "true"



arrow_region = (Region(410,792,147,33)) 

#
# Here need to deal with th case where there is no downlit arrow
# This means there could be 1 - 4 auctions
#
if Auctions is True and 
arrow_region.exists(Pattern("downarrowlit.png").similar(0.91)) :
Debug.user("Auctions  True and downlit arrow exists")
 
  
elif Auctions is True:
   popup ("Auction true and count is-->")
   Debug.user("Auctions  True but no downlit arrow-->", test_str,"<---")
 
else:
Debug.user("Fell through to Pass")
print"Passing "
pass

The log file contains:

6/12/19 17:37:48)] Auctions 
[user (06/12/19 17:37:53)] Auctions  True but no downlit arrow-->

and the debug output in the ide is:


debug] HotkeyManager: add  Hotkey: CTRL F1 (112, 2)
[debug] Image: reused: 1575294322743.png 
(file:C:\Users\mmcguinn\Documents\testdebug.sikuli\1575294322743.png)
[debug] Region: wait: waiting 3.0 secs for 1575294322743.png to appear in R[0,0 
1680x1050]@S(0)
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: makeMat: 3BYTE_BGR (111x38)
[debug] Finder2: doFind: start (stdDev: 118.1697 mean: 648.124467)
[debug] Finder2: doFind: in original: %99. (?70) 185 msec 
[debug] Finder2: doFind: end 185 msec
[debug] Region: wait: 1575294322743.png appeared (M[212,219 111x38]@S(0) S:1.00 
C:267,238 [242 msec])
[debug] Image: reused: 1575542482620.png 
(file:C:\Users\mmcguinn\Documents\testdebug.sikuli\1575542482620.png)
[debug] Region: exists: waiting 3.0 secs for 1575542482620.png to appear in 
R[0,0 1680x1050]@S(0)
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: makeMat: 3BYTE_BGR (315x48)
[debug] Finder2: doFind: start (stdDev: 154.3045 mean: 461.725132)
[debug] Finder2: doFind: in original: %47.1262 (?70) 157 msec 
[debug] Finder2: doFind: end 157 msec
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: doFind: start (stdDev: 154.3045 mean: 461.725132)
[debug] Finder2: doFind: in original: %47.2291 (?70) 144 msec 
[debug] Finder2: doFind: end 144 msec
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: doFind: start (stdDev: 154.3045 mean: 461.725132)
[debug] Finder2: doFind: in original: %47.3131 (?70) 146 msec 
[debug] Finder2: doFind: end 146 msec
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: doFind: start (stdDev: 154.3045 mean: 461.725132)
[debug] Finder2: doFind: in original: %47.4196 (?70) 188 msec 
[debug] Finder2: doFind: end 188 msec
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: doFind: start (stdDev: 154.3045 mean: 461.725132)
[debug] Finder2: doFind: in original: %47.4097 (?70) 148 msec 
[debug] Finder2: doFind: end 149 msec
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: doFind: start (stdDev: 154.3045 mean: 461.725132)
[debug] Finder2: doFind: in original: %47.4929 (?70) 143 msec 
[debug] Finder2: doFind: end 143 msec
[debug] Finder2: makeMat: INT_RGB (1680x1050)
[debug] Finder2: doFind: start (stdDev: 154.3045 mean: 461.725132)
[debug] Finder2: doFind: in original: %47.8846 (?70) 154 msec 
[debug] Finder2: doFind: end 154 msec
[debug] Finder2: makeMat: INT_RGB 

Re: [Sikuli-driver] [Question #686442]: Using onAppear

2019-12-01 Thread Mark McGuinn
Question #686442 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/686442

Mark McGuinn gave more information on the question:
I have been experimenting with this and despite using the IDE tool  to
define a region I am getting the following in the error messages:

error] Region: observe: Nothing to observe (Region might be invalid):
R[541,309 597x407]@S(0)

This is the code I am currently using, am I doing something wrong with
the way I am calling this function?


modelarea = Region(541,309,597,407)

# while not (findWord(modelname) or findWord("ANY")):
print modelname

def changed(event):
print("Found It")
modelarea.stopobserver()

modelarea.observe(10)
 
modelarea.onAppear(  "1575203969807.png",changed)

for step in range(5):
click(Pattern("1575203845288.png").targetOffset(250,123))

-- 
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


[Sikuli-driver] [Question #686442]: Using onAppear

2019-12-01 Thread Mark McGuinn
New question #686442 on Sikuli:
https://answers.launchpad.net/sikuli/+question/686442

In version 2.0.1 I am trying to use the onAppear function to catch when a 
specific piece of text appears. Below is the code I am using, it simple click a 
button which causes the image to change. The expected image is within five 
clicks of the button but the onAppear does not see it and the next click 
happens which takes away the text I am looking for.I have trued passing the 
text as a constant, as a variable and as shown in the code as an image. None 
worked.


def changed(event):
print("Found It")
 
regmake.onAppear(  "1575203969807.png",changed)

for step in range(5):
click(Pattern("1575203845288.png").targetOffset(250,123)

-- 
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 #686421]: How To Input a variable containing text to reg.find()

2019-12-01 Thread Mark McGuinn
Question #686421 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/686421

Status: Answered => Open

Mark McGuinn is still having a problem:

Have managed to get somewhere with v2.0.1. Now getting to the point where it 
does the findText but it fails with an error even though the text is in the 
image:

Code

reg = Region(300,293,1083,535)

m = reg.findText(carmake)

print m

Error
[error] script [ Mensel ] stopped with error in line 25
[error] FindFailed ( FORD as text )
[error] --- Traceback --- error source first
line: module ( function ) statement 
25: main (   ) m = reg.findText(carmake)
[error] --- Traceback --- end --

-- 
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 #686421]: How To Input a variable containing text to reg.find()

2019-12-01 Thread Mark McGuinn
Question #686421 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/686421

Status: Answered => Open

Mark McGuinn is still having a problem:
Did as suggested and am still getting an error:

[error] RunTimeIDE: ImageMissing: FORD
[error] RunTimeIDE: Wait: Abort: Jython: at Mensel (20)
[error] script [ Mensel ] stopped with error at line --unknown--

This is where I pass a hard coded string to the find command


reg = Region(300,293,1083,535)

m = reg.find("FORD")

-- 
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 #686421]: How To Input a variable containing text to reg.find()

2019-12-01 Thread Mark McGuinn
Question #686421 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/686421

Status: Answered => Open

Mark McGuinn is still having a problem:
Hi,

thanks for the feedback. I had been using 1.1.3 because I could not get
the side tab with the various coding shortcuts to work in v2. If I try
to run the script in v2.0.1 I get a strange problem in that the ide will
move the mouse to the correct point on the screen but will not click as
it is supposed to. This is he first step in the script so I cannot
confirm the solution until I can reach that point in the test script.

If there is something which is stopping the script from clicking in v2
would you let me know. Below is the code

#
Settings.OcrTextSearch=True
Settings.OcrTextRead=True
# Open a spreadsheet and read values
def openAppleMenu(event):  
   
import java.lang.System
import java.lang.Object
import java.awt.event.InputEvent
carmake = "Ford"
Env.addHotkey(Key.F1, KeyModifier.ALT+KeyModifier.CTRL,openAppleMenu)

click("1575150169419.png")
wait("1575150442463.png")

-- 
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


[Sikuli-driver] [Question #686421]: How To Input a variable containing text to reg.find()

2019-11-30 Thread Mark McGuinn
New question #686421 on Sikuli:
https://answers.launchpad.net/sikuli/+question/686421

Trying to create a script which passes from excel to Sikul a name and then 
searches on an application screen for that name. The screen has 50 visible 
icons with a different name in each. I am trying to find the icon which matches 
the name passed in and click it. However when using the following code I get an 
error:

 reg=Region(303,294,1078,530)
m = reg.find("FORD")



[error] RunTimeIDE: ImageMissing: FORD
[error] RunTimeIDE: Wait: Abort: Jython: at xcel1 (49)
[error] script [ xcel1 ] stopped with error at line --unknown--

If I pass an image in it works, but not passing either hard coded text or a 
variable with the text. SO the question is how can I pass just a text string to 
the reg.find() command?


-- 
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


[Sikuli-driver] [Bug 1854055] [NEW] Screen Resolution C hnages during capture

2019-11-26 Thread Mark McGuinn
Public bug reported:

I am newb and am trying out a simple example from YouTube. In the
example the tutor uses the capture function to take an image of Windows
start button and click it.

When I try to do the same thing the resolution of the screen changes so
that the Start button disappears from the bottom of the screen. It seems
as if the screen gets larger which causes the disappearance. If I select
an icon I can see that script will run and try and click the icon, but
because the resolution is different when the script runs it clicks in
the wrong spot.

Another issue which may be related is that it is only when I rollover
the name of the image file created by the ide do I see the actual image.
In the youtube video the actual image is displayed in the IDE script
editing box.

I am using v1.1.3 on  Windows 10 64bit with an 3.70 gigahertz AMD Ryzen
7 2700X Eight-Core processor and an NVIDIA GeForce GTX 1050 Ti on a BenQ
PD3200U [Monitor].

** Affects: sikuli
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1854055

Title:
  Screen Resolution C hnages during capture

Status in Sikuli:
  New

Bug description:
  I am newb and am trying out a simple example from YouTube. In the
  example the tutor uses the capture function to take an image of
  Windows start button and click it.

  When I try to do the same thing the resolution of the screen changes
  so that the Start button disappears from the bottom of the screen. It
  seems as if the screen gets larger which causes the disappearance. If
  I select an icon I can see that script will run and try and click the
  icon, but because the resolution is different when the script runs it
  clicks in the wrong spot.

  Another issue which may be related is that it is only when I rollover
  the name of the image file created by the ide do I see the actual
  image. In the youtube video the actual image is displayed in the IDE
  script editing box.

  I am using v1.1.3 on  Windows 10 64bit with an 3.70 gigahertz AMD
  Ryzen 7 2700X Eight-Core processor and an NVIDIA GeForce GTX 1050 Ti
  on a BenQ PD3200U [Monitor].

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1854055/+subscriptions

___
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