Jump to content

problemin loop


shai
 Share

Recommended Posts

i have a loop for ping. this is a code:

While 1
    $ping = ping ("www.google.com")
    If $ping > 0 then
    checktvexsit()
        ExitLoop
    Else
        SplashOff()
        $xsec = 30
        do
        TrayTip ("No connected","You are not connected to the internet, chacking again in " & $xsec & " sec",1)
            sleep(1000)
            $xsec = $xsec - 1
        until $xsec = 0        
    EndIf
Wend

the problem is. if after 30 sec the internet is connection the script go to checktvexsit function but the loop cannot exit and the tooltip is also show in the task bar.

thanks.

Link to comment
Share on other sites

We cant help you. We need more information if you are expecting an answer.

shanet

[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:

%programfiles%/AutoIt3/autoit3.chm
Link to comment
Share on other sites

Maybe this is right?

Local $ping, $xsec

While 1
$ping = Ping("www.google.com", 1000)
If $ping > 0 Then
  ExitLoop
Else
  SplashOff()
  $xsec = 30
  Do
   TrayTip("No connected", "Not connected to internet, checking again in " & $xsec & " sec", 1)
   Sleep(1000)
   $xsec = $xsec - 1
  Until $xsec = 0
EndIf
WEnd

checktvexsit()

Func checktvexsit()
TrayTip("Connected to internet", "",  1)
MsgBox(0, "", "Connection established")
EndFunc   ;==>checktvexsit

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Link to comment
Share on other sites

Maybe this is right?

Local $ping, $xsec

While 1
$ping = Ping("www.google.com", 1000)
If $ping > 0 Then
  ExitLoop
Else
  SplashOff()
  $xsec = 30
  Do
   TrayTip("No connected", "Not connected to internet, checking again in " & $xsec & " sec", 1)
   Sleep(1000)
   $xsec = $xsec - 1
  Until $xsec = 0
EndIf
WEnd

checktvexsit()

Func checktvexsit()
TrayTip("Connected to internet", "",  1)
MsgBox(0, "", "Connection established")
EndFunc   ;==>checktvexsit

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