Rick Posted November 26, 2006 Share Posted November 26, 2006 Very nice but how do you wrap around a while or do statement that requires the result to the dllcall to be 1 before continuing to run the script? Ant like this.................... ; $IsCon[0] = 0 not connected, $IsCon[0] = 1 is connected. While 1 $IsCon=DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) if $IsCon[0] = 0 then $Ask=Msgbox(4,"","Not connected to internet" & @CR & "Try again?") if $Ask = 7 then Exit else Exitloop endif Wend Msgbox(0,"","Connected") Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
anixon Posted November 27, 2006 Share Posted November 27, 2006 (edited) like this.................... ; $IsCon[0] = 0 not connected, $IsCon[0] = 1 is connected. While 1 $IsCon=DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) if $IsCon[0] = 0 then $Ask=Msgbox(4,"","Not connected to internet" & @CR & "Try again?") if $Ask = 7 then Exit else Exitloop endif Wend Msgbox(0,"","Connected") Thanks for that. What I am learning about scripting is that there appears to be more than one way of getting the job done. After quite a bit of trial and error (before you published your version) I found that this worked $IsCon=DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) while $iscon[0] = 0 $i = 0 do beep(500,150) sleep(100) Beep(500,150) sleep(100) $i = $i + 1 Until $i = 2 Sleep(5000) $IsCon=DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) wend Whilst it is waiting for the network it gives an audible signal just to let you know it is actually doing something :"> Ant Quick edit. I like your version as it avoids the$IsCon=DllCall statement appearing twice - Ant Edited November 27, 2006 by anixon Link to comment Share on other sites More sharing options...
Rick Posted November 28, 2006 Share Posted November 28, 2006 (edited) yup, theres always other ways to do things, how about this.... While 1 $IsCon=DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) if $iscon[0] = 1 then ExitLoop beep(500,150) sleep(100) Beep(500,150) sleep(100) beep(500,150) sleep(100) Beep(500,150) Sleep(5000) wend Edited November 28, 2006 by Rick Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
anixon Posted November 28, 2006 Share Posted November 28, 2006 yup, theres always other ways to do things, how about this.... While 1 $IsCon=DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) if $iscon[0] = 1 then ExitLoop beep(500,150) sleep(100) Beep(500,150) sleep(100) beep(500,150) sleep(100) Beep(500,150) Sleep(5000) wend Cool I'm just going to change it so that I can control the number of beeps based on an INI file setting. great to get help from a cheers Ant Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now