TypeError: click(): expected 2 args; got 1 --- workaround: use click(Region())

Asked by SkaiCloud

Hello sikuli! I'm back! I have a very frustrating issue and wondering if anyone can help me. I have been playing with sikuli for a while now and can claim myself as an intermediate user any.

code: (NOT WORKING)
Region_Menu_Guide=find("Main.png") #Find this image anywhere on the screen
Region_Menu=Region(Region_Menu_Guide).left(200) #Create a New region 200 pixel left of the finding image
Region_Menu.setH(600) # setting New region height by 600
Region_Menu.setW(600) # setting new region width by 600
Region_Screen.highlight(5) # Highlight the new region area so I can see where it is

Region_Menu.click("godhand.png")

ERROR: TypeError: click(): expected 2 args; got 1
--------------------------------
code: (WORKING)
Region_ItemArea_Guide=find("Dish.png") #Find this image anywhere on the screen
Region_ItemArea=Region(Region_ItemArea_Guide) #Create a New region (Notice I don't have a .left here)
Region_ItemArea.setH(350) # setting New region height by 350 (Notice it's height is shorter)
Region_ItemArea.setW(250) # setting new region width by 250 (Notice it's width is smaller
Region_ItemArea.highlight(5) # Highlight the new region area so I can see where it is

Region_ItemArea.click("Dish.png")
bam bing boom etc.. continuing to next function

As simple as it looks the top code isn't working compare to the bottom code. Please help :)
If I have to guess I think it could be something wrong with .left, .above, .right etc class

Question information

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

known bug.

see linked bug 583090

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

this should work

click(Region_Menu.find("godhand.png"))

Revision history for this message
SkaiCloud (flypilot43) said :
#3

awww! I knew it! was something fishy about the IDE sigh.. I guess this part of the project gonna have to wait until sikuli get fix or at least a "edit" "find" "replace" is implemented.

Revision history for this message
SkaiCloud (flypilot43) said :
#4

sorry forget to mention that click(Region_Menu.find("godhand.png")) does work thnx agian RaiMan