Just a question for a beginner

Asked by James

So hello im new with coding, sikuli and i created a bot which is flying but one need is missing that when my ship fly and image appears i need to click on it quick but in my script its just flying and pass image like its nothing so all i want to do is to do click on image when it appears instantly when flying(moving)

additional information if u dont understand so i want to create a bot which will collect boxes which will appear randomly when flying so when theres no box in the screen it just randomly clicks on minimap and flying and the problem is when i fly my ship just passes box without noticing it so i need bot to react to box and click on it thats all

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
James (jomie) said :
#1

EDIT: i fixed now the problem is that when the image appears it reacts so slow that sometimes i fly through it and sikuli dont recognize box how to make react faster

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

read to understand:
http://sikulix-2014.readthedocs.io/en/latest/basicinfo.html#sikulix-how-does-it-find-images-on-the-screen

... so only search in the area, where you expect the image to appear.

using
exists(image, 0)

does not wait for the image (standard 3 seconds), but comes back after one search.

Revision history for this message
James (jomie) said :
#3

and last question is why i m getting this weird error from this line
while True:
    if exists(image, 0):
        click()
        wait(2.5)
    else:
        randomClick(imageMap)
        wait(Pattern("image.png").similar(0.82), 5) - this line
        click(Pattern("image.png").similar(0.83))

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

what error?

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.