Jump to content

How do I get that the internet is connected?


 Share

Recommended Posts

so I tried doing _RunDos with a rasdial to see..but how do I get the output of cmd?

or maybe I could get _GetIp and if @error then its not connected..

anyone done it?

Output in CMD is AFAIK easiest to catch with StdoutRead(). Check it's help. Also you can make it write to a file (like "dir c:\ > test.txt") and then reading in the file. There are multiple ways to reach your goal.

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

you could try to Ping ( address or hostname [, timeout] ) to a known reliable host (router, gateway, dns or whatever). It's not foolproof, but close. If you get a pong you're connected.

> there are 10 types of people in the world, those who understand binary and those who don't.

Link to comment
Share on other sites

well 4 seconds if no respond then shot down script and software..is there a big chance of people to lag for 4 seconds?

Depends mostly on if the people in question are using dialup or broadband lines, if they are using a lot of connections at the time (read 9/10 times: are running P2P sharing software) and if they are using a firewall, router, proxy, whatever might fook with your connection :whistle:

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

well alright maybe something that I could ping is 100% online?

Well, you could check Jinxter's post for some suggestions to reliable hosts, or use www.google.com (which I have never found to be offline, always found to respond fast, and often use for the same purpose :whistle:)

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

if u connect to specifi port ..

try change this code ..

if this app have tcp connection and need all time alive connection ...

$check = Run(@ComSpec & ' /c netstat -n', '', @SW_HIDE, 2)

$aa = StringRegExp(StdoutRead ($check), '(\d+.\d+.\d+.\d+:5666\s*USTANOWIONO)', 3)

IF IsArray($aa) Then

call("do_something")

endif

USTANOWIONO is polish word .. like connected or somthing like that

check netstat -n :whistle:

gl

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