Comments (2)
- Use latest SikuliX (1.1.3 nightly)
- Read the docs - start here
- Ask such basic questions on Launchpad
Suggestion - if I understood your intention right
while True: # runs for ever
if exists(image,0): # check if image is seen
click() # click it if yes
else:
pass # do nothing when not found
wait(1) # wait a bit before checking/clicking again
# time can be adjusted
from sikulix1.
Thank you for your answer but isn't the problem.
The problem is that when sikulix can't find or click one image the script stops, I want that if can't click or find or wait for and image jump to the next lane code.
Example:
Click(image1)
Wait(image2,40)
Find(image3)
If I write this in case that image 1, 2 and 3 not appears the script stops, i want that in case that image 1 don't exists just jump to wait and if wait don't exists jump to find, etc. If its not possible just restart the script and start from 0 but still running the script.
I have the "if" sentence becouse i was trying to solve this problem but i don't know why sometimes (with mouse speed 0 and scan rate 0.1) the click after the if sometimes fails and stop the script.
Note: in the screen appear an image and I need to click it until desappears but fast. I write:
Mouse speed 0
while exists(image,0.3):
-----If exists(image,0.3):
-----------Click(image)
Mouse speed 0.5
Thats a bit strange becouse should be instant after the "if" exists to click the image, if the "if" exist 0.001 seconds before, the click should exists too but sometimes fails to find the click and stop it.
My knowleage of programing is like a beginer I learned c++ and a bit of python and I know only function, whiles and conditionals and vectors thats couse maybe I'm doing something wrong.
My script is whole write with whiles, ifs, click and waits. I always write "if" before a click and set the mouse 0 before the "if" and set it 0.5 when the while its over to prevent the error but maybe works 1h until click is not found and the script stops.
I wrote so much I think about my code and maybe the question is a bit confuse ^^. So know how it's my code the question is: if a "click" don't exists can I jump to the next lane code or start from 0 but the very important fact is not stop the script.
I can stop the script with the task manager if was necesary thats not a problem so i don't need to worry that the script stays 24/7 running and also all the script starts with a "while exists(image)" that i can make desappear to stop the script.
from sikulix1.
Related Issues (20)
- UI Scaling for HDPI Screens does not work
- isValidImageFilename throws java.lang.IllegalArgumentException
- Issue when trying to connect a tiger vnc server HOT 1
- sikulixIDE 2.0.x ImportError HOT 1
- VS Code extension for SikuliX scripts HOT 1
- Is there a way to generate long clicks (10 seconds +) on actionable elements? HOT 2
- Screen.click(pattern) returns FindFailed error right after screen.has(pattern) returned true. HOT 2
- Latest sikulix1api library contains dependencies with reported security vulmeralibilies
- OCR(region.text()) is detecting wrong text, when text is underlined HOT 6
- Write access to repository's wiki HOT 1
- Wiki cannot be checked out in windows HOT 2
- Exception in thread "Thread-22" java.lang.ExceptionInInitializerError HOT 9
- How to connect database influxdb HOT 1
- Problem with transparency
- Easy way to ignore the background for image search? --- use images with transparent background HOT 7
- IDE: Preview does not work or ends up in a Java crash
- The "Region.findAnyCollect" method maybe cause an endless loop
- Unable load script from command line HOT 1
- java.lang.NullPointerException HOT 4
- Using SikuliX1 from a SWT thread
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sikulix1.