Jump to content

Pinger


Recommended Posts

Hello all.

I need some help. is there some way to make your own ping() function in autoit that doesent require any extra files, like ping.exe?

Thanks in advance!

Link to comment
Share on other sites

I know there is a ping function its just that i need to be able to send my own ping packet. how would you send your own coustom ping pacet though autoit?

I don't think any tcp/ip function in autoIt will help.

but before you do that, do you know how ping packets look like?(requests/echos)

Edited by rbhkamal

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Link to comment
Share on other sites

Use the address as a parameter to the script?

;run as: scriptname address
;example for script named my_ping:
;my_ping www.AutoItScript.com

If $CmdLine[0] <> 1 Then
    MsgBox(0, "", "No parameter found!")
    Exit
EndIf
$speed = Ping($CmdLine[1], 1000)
MsgBox(0, "", $speed)
Edited by xcal
Link to comment
Share on other sites

Try something like this:

#include <Constants.au3>
Dim $log, $output
$log=Run ( @ComSpec & ' /c ping 127.0.0.1', '', @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD )
While 1
    $line = StdoutRead($log)
    If @error Then ExitLoop
    $output = $output & @CR & $line
Wend
While 1
    $line = StderrRead($log)
    If @error Then ExitLoop
    $output = $output & @CR & $line
Wend
MsgBox (0, 'Ping', $output)

You can replace "ping 127.0.0.1" with your own program and/or ip. You will have to do some String-commands to get what you want. :P

Edited by dabus
Link to comment
Share on other sites

the 'ping' packet is a special case packet for intergated into TCP/TP. There is only one type of 'ping' packet...if you alter it, it is no logner a 'ping' packet...its is just data..the kind you would send with TCPSend()

You could send the data that is in the Ping packet with TCPSend() and it woudl be the same as ping...

read this- http://pcausa.com/resources/ndispacket_decode.htm

So really you could go TCPSend ("TheDataShownOnThatLink") and it would be a 'ping' packet

Edited by evilertoaster
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...