Ping-Skript führt zu Problemen?

  • Hey, ich hab nen kleines Skript geschrieben um meinen Ping durchgehend im Auge behalten zu können, jetzt die Frage.. führt das zu Problemen wenn man so viele Pings an eine Website schickt (bei mir google) oder dulden die das ohne Probleme?
    Das Skript:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    Global $MyPing = 0
    Global $i = 0
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 187, 104, 193, 125)
    $Label1 = GUICtrlCreateLabel($MyPing, 0, 0, 180, 97)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    Switch $i
    Case 500
    _Ping ()
    GUICtrlSetData ($Label1,$MyPing)
    $i=0
    Case Else
    $i=$i+1
    EndSwitch

    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    func _Ping ()
    Global $MyPing = Ping("www.google.de")
    EndFunc

    [/autoit]


    Edit : Skript jetzt richtig.. Chrome :( ....

    2 Mal editiert, zuletzt von lordofmoney (1. Dezember 2012 um 17:46)

  • Formatier mal dein Script richtig, ansonst wird dir keiner helfen (können).

    Versuch es mal in einem anderen Browser einzufügen ;)

    Mfg

    Edit: Im Normalfall nicht, aber füge am besten noch ein Sleep ein bevor "_Ping()" aufgerufen wird ;)
    Ich denke es genügt wenn er es alle 1-2 Minuten prüft.

    There's a joke that C has the speed and efficieny of assembly language combined with readability of....assembly language. In other words, it's just a glorified assembly language. - Teh Interwebz

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, you blow off your whole leg. - Bjarne Stroustrup
    Genie zu sein, bedeutet für mich, alles zu tun, was ich will. - Klaus Kinski

  • Naja Sleeps sind ja immer so ne Sache.. Kann das Programm ja denn nicht mehr über das normale rote Kreuz schließen weil der sleep ausgeführt wird deshalb die $i Variable.. ich werde die allerdings auch noch höher setzen. Aber danke für die Antwort :)

  • Das Script aktualisiert nun alle 2 Sekunden deinen Ping (kannst ggf. anpassen) und du kannst es jederzeit via "ESC" schließen.

    http://pastebin.com/pwfyYpF8

    Mfg

    P.S.: Verwende auch Chrome, ich find es auch blöd das Chrome es falsch formatiert :(

    There's a joke that C has the speed and efficieny of assembly language combined with readability of....assembly language. In other words, it's just a glorified assembly language. - Teh Interwebz

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, you blow off your whole leg. - Bjarne Stroustrup
    Genie zu sein, bedeutet für mich, alles zu tun, was ich will. - Klaus Kinski

  • Mit AdlibRegister funktiniert es auch ohne HotkeySet:

    Spoiler anzeigen
    [autoit]

    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    #include <GUIConstants.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Global $iMsec = 1000 ;Millisekumden
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Ping Checker", 187, 104, 193, 125)
    $Label1 = GUICtrlCreateLabel("", 0, 0, 180, 97)
    _Ping()
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    AdlibRegister("_Ping",$iMsec)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Ping()
    Local $MyPing = Ping("www.google.de")
    GUICtrlSetData($Label1, $MyPing)
    EndFunc ;==>_Ping

    [/autoit]

    mfg autoBert

  • Sehr gut, die Funktion kannte ich noch gar nicht :), ja das mit dem HotkeySet ist nicht so das ware.. denn klickt man mal wo anders ESC und das Programm ist auch weg :(
    Naja danke für die AdlibRegister-Funktion, die ist sicherlich hilfreich in vielen Programmen :)