Python Forum
Dedector Bot - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Dedector Bot (/thread-33370.html)



Dedector Bot - greathill - Apr-19-2021

Hello Python lovers,
There is a thing I want but couldn't one.
I want to build a bot which is acts in order to images. For example, I want to say it click if image1 comes(it must be wait image one and click it then can pass to another command), However, we don't know when image1 will come. How can I do this?


RE: Dedector Bot - supuflounder - Apr-20-2021

(Apr-19-2021, 05:09 PM)greathill Wrote: Hello Python lovers,
There is a thing I want but couldn't one.
I want to build a bot which is acts in order to images. For example, I want to say it click if image1 comes(it must be wait image one and click it then can pass to another command), However, we don't know when image1 will come. How can I do this?
There's nothing you can do about the time it arrives. You just have to wait for it. Presumably you have some ML system that is doing the recognition. All that happens is when the image arrives and is recognized, you react to it. Key here is that everything is asynchronous and event-driven. There is nothing that is "serial" programming.


RE: Dedector Bot - greathill - Apr-20-2021

(Apr-20-2021, 04:53 AM)supuflounder Wrote:
(Apr-19-2021, 05:09 PM)greathill Wrote: Hello Python lovers,
There is a thing I want but couldn't one.
I want to build a bot which is acts in order to images. For example, I want to say it click if image1 comes(it must be wait image one and click it then can pass to another command), However, we don't know when image1 will come. How can I do this?
There's nothing you can do about the time it arrives. You just have to wait for it. Presumably you have some ML system that is doing the recognition. All that happens is when the image arrives and is recognized, you react to it. Key here is that everything is asynchronous and event-driven. There is nothing that is "serial" programming.
Thanks for the answer, I did with multiple while loops. E.g.
while True:
           image=imagesearch('./image')
           if image != [-1,-1]
              click()