Jump to content

Checkinet


WhiteTiger
 Share

Recommended Posts

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

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 by anixon
Link to comment
Share on other sites

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 by Rick

Who needs puzzles when we have AutoIt!!

Link to comment
Share on other sites

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

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