Jump to content

Ping every 20 seconds


Recommended Posts

Could som,eone help me fix this . i'm so lost .

I want to ping google every 20 sceonds .

For
Ping("www.google.com",250)
if ContinueLoop
Else
    Msgbox(0,"Status","An error occured with number: " & @error)
 next

Not having much luck with if's and then's . lol

Link to comment
Share on other sites

  • Developers

i looked at the docu there seems to be no ping function/command...

only way to do it with AutoIT is -i guess- let it open command prompt and then let it type in : ping google.de [Enter]

let it do this every 20seconds (or whatever just use ´Sleep´ command for that)

<{POST_SNAPBACK}>

There is a ping comand in the current unstable... :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Your code totally does nothing and is completely messed up. What is the point of pinging google 20 times? Are you trying to see how fast your internet connection is?

<{POST_SNAPBACK}>

Well if you must know a friend wants to stay on line so a ping would stop him from having his ISP kick him off line .

And I would not of ask for if my Your code totally does nothing and is completely messed up

Link to comment
Share on other sites

You could use a MsgBox instead of a tooltip, but MsgBox "pauses" execution of the script until dismissed.... Also, the Beep is optional.

While 1
   Run(@Comspec & " /c echo " & Chr(7), "", @SW_HIDE);beep pc speaker
   $result = Ping("www.google.com", 250)
   If @error Then
      ToolTip("PING FAILED", 0, 0)
   Else
      Tooltip("Ping okay", 0, 0)
   EndIf
   Sleep(20000);20 seconds
WEnd
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

You could use a MsgBox instead of a tooltip, but MsgBox "pauses" execution of the script until dismissed....  Also, the Beep is optional.

While 1
   Run(@Comspec & " /c echo " & Chr(7), "", @SW_HIDE);beep pc speaker
   $result = Ping("www.google.com", 250)
   If @error Then
      ToolTip("PING FAILED", 0, 0)
   Else
      Tooltip("Ping okay", 0, 0)
   EndIf
   Sleep(20000);20 seconds
WEnd

<{POST_SNAPBACK}>

Actually it would be most convienient if you were running WinXP or 2000 so you could use the TrayTip. I also don't suggest running this every 20 seconds as it will cause your system and network to be on overhual all the time. If he requires a constant dialup connection then I would suggest a ping each minute. I wouldn't be surprised if your dialup provider doesnt boot you for filling the traffic with so much trash.

*** Matt @ MPCS

Link to comment
Share on other sites

That is an odd dsl provider... I might venture to say it is his router... some routers goto sleep.

Also what is the point of sending the message box, and most ISP diss you after 20 mins of inactivity. So what you could do is ping google every 19 mins. See how that works. That will save you from creating soo much traffic.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

I don't think it would be his provider.  Its hard to sell an always-on connection when the ISP boots you periodically.

<{POST_SNAPBACK}>

Yea that was my point. I didnt know that old routers used to goto sleep but they do... and even some newer ones I have seen do that. It disconnects you (kinda) depends on the settings I am sure. Also there are settings within routers that you can set to setup a manual timout.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

That is an odd dsl provider... I might venture to say it is his router... some routers goto sleep.

Also what is the point of sending the message box, and most ISP diss you after 20 mins of inactivity. So what you could do is ping google every 19 mins. See how that works. That will save you from creating soo much traffic.

JS

<{POST_SNAPBACK}>

Not really . Look at my dsl provider . only one you can get . no one else can do it here as we live in the fucking boondocks .

I pay what they want or don't get it . $70.00 a month for 256 .

Link to comment
Share on other sites

yeah, bob's not crazy, there's DSL service that isn't always on...

why not inetget google.com on the same loop, so it doesn't look like ping garbage.

@Matt: a single ping every 20 seconds isn't really a burden to any networking system...

you could also include a random in the pause between req's and therefor not make it look artificial...

like this:

sleep(20000 + int(random(1000, 10000))

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

Whats funny is I can make things with autohotkey most of the time with out help . I made this and it will do the samething . but just wanted a ping to do it .

But autohotkey does not have a ping .

Loop, 3
{
URLDownloadToFile, http://www.google.com , C:\WINDOWS\temp\index.html
SoundPlay, %SystemRoot%\Media\ding.wav
Sleep, 20000; 20 second
}

But I can never get anything to work with autoit .

Link to comment
Share on other sites

Whats funny is I can make things with autohotkey most of the time with out help . I made this and it will do the samething  . but just wanted a ping to do it .

But autohotkey does not have a ping .

Loop, 3
{
URLDownloadToFile, http://www.google.com , C:\WINDOWS\temp\index.html
SoundPlay, %SystemRoot%\Media\ding.wav
Sleep, 20000; 20 second
}

But I can never get anything to work with autoit .

<{POST_SNAPBACK}>

$count = 0
do
   Ping("http://www.google.com",250)
   SoundPlay("%SystemRoot%\Media\ding.wav")
   Sleep(20 * 1000)
   $count = $count + 1
until $count = 3

this'll do the exact same thing.

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

It's not really a correction, they both do the exact same thing, just the details of the implementation are different.

Edit: Assuming Opt("ExpandEnvStrings", 1) is added to emmanuel's.

Edited by Valik
Link to comment
Share on other sites

It's not really a correction, they both do the exact same thing, just the details of the implementation are different.

Edit: Assuming Opt("ExpandEnvStrings", 1) is added to emmanuel's.

<{POST_SNAPBACK}>

Whoops, I was just being lazy, didn't realize such an opt existed.

You got it. I don't assume on the part of another if I can help it.

<{POST_SNAPBACK}>

good deal.

"I'm not even supposed to be here today!" -Dante (Hicks)

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