Digiraiter

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

12 posts in this topic

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

Share this post


Link to post
Share on other sites



@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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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 :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

It's a Messenger Client
for each step it take time to load from internet

and it might hand and say "Disconnect" and when you click ok, Client will be closed

so you must start over

Share this post


Link to post
Share on other sites
  • and what's the name?
  • Is the Messenger runing in Browser?

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

When meaning you can not helping us to help you for getting best solution, search allone for your poor solution.

Share this post


Link to post
Share on other sites

@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.

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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