Jump to content

wait for a color with a timer and start over if it take too long


Recommended Posts

Hello

I want to use AutoIt to work with some Internet Based Softwares
but as disconnect, ping and many other stuff might happen

working on such softwares are always ending to a 2 path if&else that i found hard to create it on AutoIt by what i know from it

for example you want to open software, and it take time to connect to server

but if anything happen, you must close it and start over

and as i didn't found halts like Lable&Goto it seem hard to do it on AutoIt

for example if I could use them, i did this
 

;first steps

while $sec < 10
    if color = 123557
        go to Success
    Endif
    sleep (1000)
Wend
Fail
    go back and start over
:success
    ;Rest of steps

in short, they are several steps with high possibility of hang or disconnect and if anything go wrong you must close everything and start over, then how I can solve such problem with AutoIt

Thank you

Link to comment
Share on other sites

  • Moderators

@Digiraiter welcome to the forum. You are correct that you aren't going to find GOTO in AutoIt (thank goodness), but looking for a pixel color is going to be just as unstable. Can you share what application you're launching? How do you know that it is connected to the server (message pop-up, message in the GUI, etc.)? How about a screenshot of what tells you that you have successfully connected? I am sure there will be a much more reliable way to automate what you're after than looking for a pixel color.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

from the way I was going for programming, 2 way If&Else was never a problem

I can give Algorithm that summon how my Client Software work

Start Client
    Wait for Window to get active
    Wait for it to connect to internet
        Possible Hang
        Close, Start over
    Click on Connect
        Wait for Client to come up
        Enter Username Password
        Click Start
            Hang Possible
            Close, Start Over
        Choose Server
        Click Ok
        wait to connect to server
            Hang Possible
            Close, Start Over
        Choose Acount
        Click Ok
            Hang Possible
            Close, Start Over
        Software connection Complete

as you can see, there are many places where software my show me "disconnect from server" or crash
then I had to deal with it like this

wait for color for 30s, if timeout goto Label

so it wait for color and if it take too long, it start over

Link to comment
Share on other sites

  • Moderators

I'd still say there are better ways to do it, but as you seem to be stuck on pixelsearch and pixelsearch only, good luck in your efforts :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Just now, JLogan3o13 said:

I'd still say there are better ways to do it, but as you seem to be stuck on pixelsearch and pixelsearch only, good luck in your efforts :)

I didn't ask for Pixel Search, Actually, it's a specific pixel in a fixed place with fixed color

yet if you know better ways to deal with such problems, please tell me some examples

I want a Login method for unsustainable clients without wasting time too much

Link to comment
Share on other sites

  • Moderators
Quote

it's a specific pixel in a fixed place with fixed color

Which you would get with the PixelSearch function. And as far as using other methods, as I stated we would need more information about the application or website. All I was saying is perhaps someone who uses PixelSearch will wander along to assist you; it is much to unreliable for many of us.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

can we forget about messenger and stick to main problem

there is a software that might crash, and we do'nt want to stay there and re-open macro each time it crash, so we need a method to find out if it crashed or not

and what a crashed software output is, nothing

Link to comment
Share on other sites

  • Moderators

@AutoBert I share your frustration when people ask for help and then do not want to give enough information to facilitate that help. However, rather than responding harshly, please just move along to other threads where there is less "pulling of teeth" to get information. Perhaps the crickets chirping in this thread will be enough to convince the OP he is not giving enough info.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...