← Back to team overview

sikuli-driver team mailing list archive

[Question #172860]: While loop

 

New question #172860 on Sikuli:
https://answers.launchpad.net/sikuli/+question/172860

I'm trying to make a wireless status notification system based on the wireless icon in the system tray.

The way it'll work is it will run an be idle until it sees the Wireless Radio Disconnected symbol (the computer with an "x" next to it). When it sees this it will give me a popup. 

Then when it sees the Acquiring IP symbol (the computer with the bouncing ball), it gives me another popup. 

Then when it sees the Online symbol (the computer with the wireless symbol) it will give me a third popup and start all over again, waiting for the Disconnected sign.

I figured I needed a while loop, but for some reason it gives me a fake Disconnected popup in the beginning, and then once I go through the enire program (Disconnected, Acquiring, Online), it just loops all three popups.

Here is the program so far:

setAutoWaitTimeout(FOREVER)
while(1):
    while not exists("1317412001875.png"):
        sleep(0.5)
        
    popup("Internet connection has been lost.")
    wait("5.png")
    popup("Negotiating with server...")
    wait("J.png")
    popup("Online.")


    
If you could help, that would be great because this has been bugging me for forever.

Thanks a ton,
Dylan


    
    

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.