Welcome Guest.   Make a donation to an author on the site July 29, 2014, 03:57:15 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: [REQUEST] Review "Mr. Ping"  (Read 5362 times)
robcull
Participant
*
Posts: 3


View Profile Give some DonationCredits to this forum member
« on: September 12, 2008, 12:17:19 AM »

Hey
 
i just made this coding snack in autoit for someone... somewhere. Upon completing it i've realized that I don't remember who it was for.

Therefore, i've decided to post the prelim "proto" script for you all to test, use, and (hopefully) review. I am looking for an alternate way of announcing messages to the user other than the tray balloons and the message boxes, but it's a start.

**update: I replaced the message boxes that tell you when a test failed and it is moving onto a different test, and the tray balloons that say the latency, with upper-right screen corner spash text. much nicer. try it out.

Description:

It starts out pinging google, and displays the latency in a splash**. If there is no connection, Mr. Ping will tell you that it failed and it will try a different site.

If that succeeds, then it will continue pinging every 6 seconds or so, and telling you the latency just the same as before. If it fails, then it does the same thing, but tries a different site.

It goes through a total of 4 websites. After all 4 of them fail, it will try to ping the localhost address (127.0.0.1).
-If successful, then it tells you the latency in **splash and in another **splash it tells you that it succeeded and you should check your connection/settings. Then it restarts in 10 seconds.
-If localhost fails, it tells you in a msgbox, and then gives its suggestions (hardware/driver problem), gives salutations, and exits.

The websites it cycles through (in order) are google, yahoo, donationcoder, and wikipedia. Then localhost of course.

.exe attached, here's the source:

[copy or print]

splashtexton ( "Mr. Ping", "Hi! My name is Mr. Ping. I'll help you test your connection to the internets.", 500, 60, -1, -1, 1, -1, 20, 700)
sleep (5000)
SplashOff()
splashtexton ( "Mr. Ping", "Starting....", 140, 30, -1, -1, 1, -1, 20, 700)
sleep (500)
SplashOff()

While 1

Do
sleep (1000)
$var = Ping ("www.google.com", 1000)
if $var then
splashtexton ( "Status", " I pinged Google in " & $var, 120, 16, 5, 5, 5, -1, 8, 450)
sleep (6000)
endif
until $var = 0

splashtexton ("Connection Problem", " I couldn't reach Google. I'll try Yahoo!...    Error number: " & @error, 240, 40, 5, 5, 1, -1, 10, 550)
sleep (3500)
SplashOff()

Do
sleep (1000)
$var = Ping ("www.yahoo.com", 1000)
if $var then
splashtexton ( "Status", " I pinged Yahoo! in " & $var, 120, 16, 5, 5, 5, -1, 8, 450)
sleep (6000)
endif
until $var = 0

splashtexton ("Connection Problem", " I couldn't reach Yahoo!. I'll try DonationCoder...    Error number: " & @error, 285, 40, 5, 5, 1, -1, 10, 550)
sleep (3500)
SplashOff()

Do
sleep (1000)
$var = Ping ("www.DonationCoder.com", 1000)
if $var then
splashtexton ( "Status", " I pinged DonationCoder in " & $var, 150, 16, 5, 5, 5, -1, 8, 450)
sleep (6000)
endif
until $var = 0

splashtexton ("Connection Problem", " I couldn't reach DonationCoder. I'll try Wikipedia...    Error number: " & @error, 300, 40, 5, 5, 1, -1, 10, 550)
sleep (3500)
SplashOff()

Do
sleep (1000)
$var = Ping ("www.wikipedia.org", 1000)
if $var then
splashtexton ( "Status", " I pinged Wikipedia in " & $var, 130, 16, 5, 5, 5, -1, 8, 450)
sleep (6000)
endif
until $var = 0

splashtexton ("Connection Problem", " I couldn't reach Wikipedia. I'll try the localhost (172.0.0.1)...    Error number: " & @error, 350, 40, 5, 5, 1, -1, 10, 550)
sleep (3500)
SplashOff()

sleep (1000)
$var = Ping ("127.0.0.1", 1000)

if $var then
splashtexton ( "Status", " I pinged the localhost in " & $var, 135, 16, 5, 5, 5, -1, 8, 450)
sleep (2000)
splashtexton ("Status", "I successfully pinged the localhost (127.0.0.1). Check your connection and/or connection settings. I'll restart the test in 10 seconds.", 440, 35, 5, 5, 1, -1, 10, 550)
sleep (10000)
SplashOff()
elseif $var = 0 Then
Msgbox (48, "Connection Problem", "I couldn't ping the localhost! Check for hardware/driver problems. That's as much as I can do for now... ping you later!")
Exit
endif

Wend


* Mr. Ping v1.2.exe (256.47 KB - downloaded 235 times.)
« Last Edit: September 12, 2008, 01:49:07 AM by robcull » Logged
mouser
First Author
Administrator
*****
Posts: 33,183



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: September 12, 2008, 12:24:14 AM »

neat idea.
Logged
robcull
Participant
*
Posts: 3


View Profile Give some DonationCredits to this forum member
« Reply #2 on: September 12, 2008, 01:29:41 AM »

thx. i just updated it so now it's much smoother and nicer than before.
Logged
freewareking101
Participant
*
Posts: 3

View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: November 08, 2008, 03:29:46 AM »

I wish its a powerbuilder code so I can understand it.. heheheh
Logged
Conquer
Honorary Member
**
Posts: 50



View Profile Give some DonationCredits to this forum member
« Reply #4 on: December 05, 2008, 01:48:37 PM »

[copy or print]
If ConnectedToInternet()
{
   Msgbox, An internet connection is currently detected.`nPress OK to exit the program.
   ExitApp
}
Else
{
   Msgbox, An internet connection was not detected.`nPress OK to exit the program.
   ExitApp
}

ConnectedToInternet(flag=0x43) {
Return DllCall("Wininet.dll\InternetGetConnectedState", Str,flag, Int,0 )
}
Logged
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: December 05, 2008, 10:40:01 PM »

Pinging localhost should always work, whether you have a network adapter installed or not - just saying smiley
Logged

- carpe noctem
robcull
Participant
*
Posts: 3


View Profile Give some DonationCredits to this forum member
« Reply #6 on: January 04, 2009, 07:06:46 PM »

Pinging localhost should always work, whether you have a network adapter installed or not - just saying smiley

Not necessarily. If you do not have a network adapter installed, or if it is damaged significantly, the localhost address will not reply. While it is highly unlikely that this would be the case (in all my years of experience, i've only encountered one instance where i could not ping the localhost due to a damaged NIC), i felt it necessary, since it is proper trouble shooting.
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.034s | Server load: 0.03 ]