THOMSON TG585 v7 - Tool (WLAN_LAN-Router / DSL-Modem)

  • Version 1.1 x64

    Funktionen:
    1.) WLAN_EIN
    2.) WLAN_AUS
    3.) NEUE_IP
    4.) NEU_STARTEN
    5.) SEND_TEXT

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.3.12.0
    Author: m47
    Version: 1.1

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here

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

    #include <Misc.au3>
    #include <GUIConstants.au3>

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

    Opt("MustDeclareVars", 1) ;1 = Variable muss deklariert werden
    Opt("GUIOnEventMode",1) ;Aktiviert die OnEvent Funktionsanmeldung.
    Opt("MouseCoordMode", 0) ;relative Koordinaten zum aktiven Fenster

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

    Global $Script_Name = "THOMSON TG585 v7 - Tool" ;THOMSON TG585 v7 (CANT-P) = WLAN-Router mit internem DSL-Modem
    ;http://wiki.openwrt.org/toh/thomson/tg585

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

    If _Singleton($Script_Name,1) = 0 Then
    Sound() ;
    Exit
    EndIf

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

    ;Loop
    Global $i

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

    ;GUI
    Global $GUIGetMsg

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

    ;Button
    Global $Button_Sperre = 0 ;0=AUS, 1=Ein

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

    ;Doubleclick_Button
    Global $Timer_DblClick
    Global $Counter_DblClick = 0
    Global $Switch_MousePos = True
    Global $MouseGetPos
    Global $Mouse_DoubleClickSpeed = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "DoubleClickSpeed")

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

    ;TCP
    Global $TCPRecv

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

    ;Timer
    Global $Timer_Modem_Restart
    Global $Timer_Modem_Wait_Off
    Global $Timer_Modem_Wait_On

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

    ;Data
    Dim $Data[31]
    $Data[0] = "192.168.1.254" ;Modem_IP
    $Data[1] = "23" ;Standart Port(http://de.wikipedia.org/wiki/Liste_der…disierten_Ports)
    $Data[2] = ""
    $Data[3] = "" ;Username
    $Data[4] = "" ;Password
    $Data[5] = ""
    $Data[6] = "wireless ifconfig state=enabled" ;WLAN_EIN
    $Data[7] = "wireless ifconfig state=disabled" ;WLAN_AUS
    $Data[8] = ""
    $Data[9] = "ppp ifdetach intf = Internet" ;NEUE_IP(Teil 1)
    $Data[10] = "ppp ifattach intf = Internet" ;NEUE_IP(Teil 2)
    $Data[11] = ""
    $Data[12] = "system reboot" ;NEU_STARTEN
    $Data[13] = ""
    $Data[14] = "2048" ;Maximale Anzahl der zu erhaltenen Daten/Zeichen von einem verbundenen "Socket" mit TCPRecv Befehl
    $Data[15] = ""
    $Data[16] = ">" ;Wird ins Fenster geschrieben(Zeilenanfang)
    $Data[17] = ""
    $Data[18] = "500" ;Pausezeit für Modem Rückmeldung. Falls Verbindung zum Modem langsam oder für Testzwecke den Wert erhöhen.
    $Data[19] = "2000" ;Zusatzpausezeit für Modem Rückmeldung.
    $Data[20] = "2000" ;Pausezeit nach TCPShutdown
    $Data[21] = ""
    $Data[22] = "Fehler"
    $Data[23] = "Kann keine Verbindung herstellen."
    $Data[24] = "Warten bis Modem abgestellt ist..."
    $Data[25] = "Warten bis Modem eingeschalten ist..."
    $Data[26] = " Sekunde(n) Gesamtzeit"
    $Data[27] = ""
    $Data[28] = "www.google.de" ;Ping Adresse für Verbindungstest
    $Data[29] = ""
    $Data[30] = "exit" ;Exit

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

    ;Command_Sequence
    Dim $Command_Sequence_1[4] = [3,4,6,30] ;Befehlsfolge WLAN_EIN
    Dim $Command_Sequence_2[4] = [3,4,7,30] ;Befehlsfolge WLAN_AUS
    Dim $Command_Sequence_3[5] = [3,4,9,10,30] ;Befehlsfolge NEUE_IP
    Dim $Command_Sequence_4[4] = [3,4,12,30] ;Befehlsfolge NEU_STARTEN
    Dim $Command_Sequence_5[3] = [3,4,29] ;Befehlsfolge SEND_TEXT ,29=Platzhalter für Text

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

    ;Switch_Command_Sequence
    Dim $Switch_Command_Sequence = 0

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

    ;Switch_Modem_Connected
    Dim $Switch_Modem_Connected = -1 ;(-1) = mit Modem nicht verbunden, (<> -1) = mit Modem verbunden

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

    ;Counter_Connect_Receive_Send
    Dim $Counter_Command_Sequence_ = 0

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

    ;OnAutoItExitRegister
    OnAutoItExitRegister(OnAutoItExit) ;Funktion OnAutoItExit starten wenn AutoIt Script beendet(Exit oder per Hand geschlossen)wurde.

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

    ;GUICreate
    Dim $GUICreate_Telnet_Client = GUICreate($Script_Name,800,800) ;Erstellt ein GUI-Fenster.
    GUISetFont(12, 800, 0, "MS Sans Serif") ;Legt die Standardschriftart eines GUI-Fensters fest.
    GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_EVENT_CLOSE") ;die Dialogbox wird geschlossen (entweder durch einen bestimmten Button oder das Systemmenü).
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "GUI_EVENT_MINIMIZE") ;die Dialogbox wird per Button in der Titelleiste minimiert.
    GUISetOnEvent($GUI_EVENT_MAXIMIZE, "GUI_EVENT_MAXIMIZE") ;die Dialogbox wird per Button in der Titelleiste maximiert.
    GUISetOnEvent($GUI_EVENT_RESTORE, "GUI_EVENT_RESTORE") ;die Dialogbox wird durch Klick auf das Taskleistensymbol wiederhergestellt.
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, '_PRdown') ;die erste (linke) Maustaste wurde gedrückt
    GUISetOnEvent($GUI_EVENT_PRIMARYUP, '_PRup') ;die erste (linke) Maustaste wurde losgelassen
    ;
    Dim $Input_GUICreate_Telnet_Client = GUICtrlCreateInput("",10,10,780,40) ;Erstellt eine Eingabe-Dialogbox für die GUI.
    GUICtrlSetFont($Input_GUICreate_Telnet_Client,18) ;Setzt die Schriftart und Schriftgröße für ein Control.
    GUICtrlSetBkColor($Input_GUICreate_Telnet_Client,0xffffff) ;White ;Setzt die Hintergrundfarbe eines Controls.
    ;
    Dim $Button_WLAN_EIN = GUICtrlCreateButton("WLAN_EIN",10,60,150,40,$BS_DEFPUSHBUTTON) ;Erzeugt eine Schaltfläche mit einem dicken, schwarzen Rand (Default-Schaltfläche).
    GUICtrlSetFont($Button_WLAN_EIN,16) ;Setzt die Schriftart und Schriftgröße für ein Control.
    GUICtrlSetBkColor($Button_WLAN_EIN,0xC0DCC0) ;MoneyGreen ;Setzt die Hintergrundfarbe eines Controls.
    ;
    Dim $Button_WLAN_AUS = GUICtrlCreateButton("WLAN_AUS",160,60,150,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_WLAN_AUS,16)
    GUICtrlSetBkColor($Button_WLAN_AUS,0xC0DCC0) ;MoneyGreen
    ;
    Dim $Button_NEUE_IP = GUICtrlCreateButton("NEUE_IP",310,60,150,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_NEUE_IP,16)
    GUICtrlSetBkColor($Button_NEUE_IP,0xC0DCC0) ;MoneyGreen
    ;
    Dim $Button_NEU_STARTEN = GUICtrlCreateButton("NEU_STARTEN",460,60,170,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_NEU_STARTEN,16)
    GUICtrlSetBkColor($Button_NEU_STARTEN,0xC0DCC0) ;MoneyGreen
    ;
    Dim $Button_SEND_TEXT = GUICtrlCreateButton("SEND_TEXT",630,60,160,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_SEND_TEXT,16)
    GUICtrlSetBkColor($Button_SEND_TEXT,0xffffff) ;White
    ;
    Dim $Edit_GUICreate_Telnet_Client = GUICtrlCreateEdit("",10,110,780,680,$WS_DISABLED) ;Erzeugt ein Fenster, das von Anfang an inaktiv ist.
    GUICtrlSetFont($Edit_GUICreate_Telnet_Client,12) ;Setzt die Schriftart und Schriftgröße für ein Control.
    GUICtrlSetBkColor($Edit_GUICreate_Telnet_Client,0x000000) ;Black ;Setzt die Hintergrundfarbe eines Controls.

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

    GUISetState(@SW_SHOWNORMAL) ;Verändert den Status eines GUI-Fensters. @SW_SHOWNORMAL - Aktiviert und stellt ein Fenster dar

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

    ;GUI_Loop
    While 1
    Sleep(100)
    WEnd

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

    ;Function
    Func _PRdown()
    If $Button_Sperre = 0 Then

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

    $MouseGetPos = MouseGetPos() ;

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

    If _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_WLAN_EIN) Then
    GUICtrlSetBkColor($Button_WLAN_EIN, 0xFF0000) ;Red
    Sound() ;
    WLAN_EIN() ;
    GUICtrlSetBkColor($Button_WLAN_EIN, 0xC0DCC0) ;MoneyGreen

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_WLAN_AUS) Then
    GUICtrlSetBkColor($Button_WLAN_AUS, 0xFF0000) ;Red
    Sound() ;
    WLAN_AUS() ;
    GUICtrlSetBkColor($Button_WLAN_AUS, 0xC0DCC0) ;MoneyGreen

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_NEUE_IP) Then
    GUICtrlSetBkColor($Button_NEUE_IP, 0xFF0000) ;Red
    Sound() ;
    NEUE_IP() ;
    GUICtrlSetBkColor($Button_NEUE_IP, 0xC0DCC0) ;MoneyGreen

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_NEU_STARTEN) Then
    GUICtrlSetBkColor($Button_NEU_STARTEN, 0xFF0000) ;Red
    Sound() ;
    NEU_STARTEN() ;
    GUICtrlSetBkColor($Button_NEU_STARTEN, 0xC0DCC0) ;MoneyGreen

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_SEND_TEXT) Then
    GUICtrlSetBkColor($Button_SEND_TEXT, 0xFF0000) ;Red
    Sound() ;
    SEND_TEXT() ;
    GUICtrlSetBkColor($Button_SEND_TEXT, 0xffffff) ;White
    Else
    $Switch_MousePos = False
    EndIf
    EndIf
    EndFunc

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

    Func _PRup()
    If $Switch_MousePos Then
    If $Counter_DblClick = 2 Then
    $Counter_DblClick = 0
    Else
    $Timer_DblClick = TimerInit() ;
    EndIf
    EndIf
    EndFunc

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

    Func _CheckCtrlDblClick($GUI, $CTRL)
    Local $CtrlPos = ControlGetPos($GUI, '', $CTRL)
    If ($MouseGetPos[0] >= $CtrlPos[0] And $MouseGetPos[0] <= $CtrlPos[0] + $CtrlPos[2]) And _
    ($MouseGetPos[1] >= $CtrlPos[1] + 20 And $MouseGetPos[1] <= $CtrlPos[1] + 20 + $CtrlPos[3]) Then
    $Counter_DblClick += 1
    $Switch_MousePos = True
    If $Counter_DblClick = 2 And (TimerDiff($Timer_DblClick) < $Mouse_DoubleClickSpeed) Then
    Return True
    Else
    $Timer_DblClick = TimerInit() ;
    $Counter_DblClick = 1
    EndIf
    EndIf
    EndFunc

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

    Func WLAN_EIN()
    $Switch_Command_Sequence = 1 ;WLAN_EIN
    Connect_Receive_Send() ;
    EndFunc

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

    Func WLAN_AUS()
    $Switch_Command_Sequence = 2 ;WLAN_AUS
    Connect_Receive_Send() ;
    EndFunc

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

    Func NEUE_IP()
    $Switch_Command_Sequence = 3 ;NEUE_IP
    Connect_Receive_Send() ;
    EndFunc

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

    Func NEU_STARTEN()
    $Switch_Command_Sequence = 4 ;NEU_STARTEN
    Connect_Receive_Send() ;
    EndFunc

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

    Func SEND_TEXT()
    $Switch_Command_Sequence = 5 ;SEND_TEXT
    Connect_Receive_Send() ;
    EndFunc

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

    Func Connect_Receive_Send()
    While 1
    $Button_Sperre = 1 ;Buttons gesperrt

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

    TCPStartup() ;Stellt den TCP Dienst zur Verfügung

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

    $Switch_Modem_Connected = TCPConnect($Data[0],$Data[1]) ;Verbinden

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

    If $Switch_Modem_Connected = -1 Then ;Verbindung zum Modem prüfen
    MsgBox(16, $Data[22], $Data[23])
    Sound() ;
    ExitLoop
    EndIf

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

    For $i In Eval("Command_Sequence_" & $Switch_Command_Sequence) ;Daten($Data) in der Schleife abarbeiten

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

    ;Schleifendurchgangzähler
    $Counter_Command_Sequence_ += 1

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

    ;Pause
    Sleep($Data[18])

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

    ;Consolewrite
    Consolewrite("Schritt " & $Counter_Command_Sequence_ & "/" & Ubound(Eval("Command_Sequence_" & $Switch_Command_Sequence)) &@LF)
    If $Counter_Command_Sequence_ = Ubound(Eval("Command_Sequence_" & $Switch_Command_Sequence)) Then
    Consolewrite(@LF)
    EndIf
    ;~ Consolewrite($TCPRecv)

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

    ;Schleife verlassen wenn Schleifendurchgangzähler größer als Anzahl der Daten(Command_Sequence)
    If $Counter_Command_Sequence_ > Ubound(Eval("Command_Sequence_" & $Switch_Command_Sequence)) Then
    Consolewrite(@LF)
    ExitLoop
    EndIf

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

    ;Empfangen
    $TCPRecv = TCPRecv($Switch_Modem_Connected, $Data[14]) ;Maximale Anzahl der zu erhaltenen Daten/Zeichen festlegen
    If @error Then
    ExitLoop
    EndIf
    If $TCPRecv <> "" Then
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, $Data[16] & $TCPRecv & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client)) ;die vom Modem empfangenen Daten ins Fenster schreiben
    EndIf

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

    ;Senden($Input_GUICreate_Telnet_Client)
    If $Switch_Command_Sequence = 5 And $Counter_Command_Sequence_ = 3 Then ;5=SEND_TEXT
    TCPSend($Switch_Modem_Connected, GUICtrlRead(($Input_GUICreate_Telnet_Client), 1) & @CRLF) ;Inhalt vom Eingabefeld senden
    GUICtrlSetData($Input_GUICreate_Telnet_Client,"") ;Eingabefeld leeren
    GUICtrlSetState($Input_GUICreate_Telnet_Client,$GUI_FOCUS) ;$GUI_FOCUS = Das Control erhält den Eingabe- bzw. Auswahlfokus
    Else
    ;Senden($Data)
    TCPSend($Switch_Modem_Connected, $Data[$i] & @CRLF)
    EndIf

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

    ;Zusatzpause
    If $Switch_Command_Sequence = 3 And $Counter_Command_Sequence_ = 4 Then ;3=NEUE_IP
    Sleep($Data[19])
    EndIf
    Next

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

    Disconnect_Receive_Send() ;Verbindung trennen

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

    While 1
    If $Switch_Command_Sequence = 4 Then ;4=NEU_STARTEN
    $Timer_Modem_Restart = TimerInit() ;
    $Timer_Modem_Wait_Off = TimerInit() ;
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, $Data[16] & $Data[24] & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client))
    While Ping($Data[28])
    Sleep(1000)
    If TimerDiff($Timer_Modem_Wait_Off) > 30000 Then ExitLoop 2
    WEnd
    $Timer_Modem_Wait_On = TimerInit() ;
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, $Data[16] & $Data[25] & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client))
    $i= GUICtrlRead($Edit_GUICreate_Telnet_Client)
    While Not Ping($Data[28])
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, $Data[16] & Round(TimerDiff($Timer_Modem_Restart)/1000) & $Data[26] & @CRLF & $i)
    Sleep(1000)
    If TimerDiff($Timer_Modem_Wait_On) > 300000 Then ExitLoop 2
    WEnd
    ExitLoop
    Else
    ExitLoop
    EndIf
    WEnd

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

    GUICtrlSetData($Edit_GUICreate_Telnet_Client, $Data[16] & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client)) ;Leerzeile ins Fenster schreiben
    $Counter_Command_Sequence_ = 0 ;Schleifendurchgangzähler Reset
    $Button_Sperre = 0 ;Buttons entperrt
    Sleep($Data[20]) ;Pausezeit nach TCPShutdown
    ExitLoop ;Zurück zur GUI
    WEnd
    EndFunc

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

    Func Disconnect_Receive_Send()
    If $Switch_Modem_Connected <> - 1 Then
    TCPCloseSocket($Switch_Modem_Connected)
    EndIf
    TCPShutdown()
    EndFunc

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

    Func OnAutoItExit()
    Disconnect_Receive_Send() ;
    Sound() ;
    EndFunc

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

    Func GUI_EVENT_CLOSE()
    Exit
    EndFunc

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

    Func GUI_EVENT_MINIMIZE()
    Sound() ;
    EndFunc

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

    Func GUI_EVENT_MAXIMIZE()
    Sound() ;
    EndFunc

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

    Func GUI_EVENT_RESTORE()
    Sound() ;
    EndFunc

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

    Func Sound()
    Beep(200,200)
    EndFunc

    [/autoit]
  • Version 1.8 x64

    Funktionen:
    1.) IP_?
    2.) SEND_TEXT
    3.) PPP_EIN
    4.) PPP_AUS
    5.) WLAN_EIN
    6.) WLAN_AUS
    7.) NEUE_IP
    8.) NEU_STARTEN
    9.) 18 Telnet Befehle per GUI-Button(F1-F18)

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.3.12.0
    Author: m47
    Version: 1.8

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here

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

    #include <Misc.au3>
    #include <GUIConstants.au3>
    #include <Inet.au3>

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

    Opt("MustDeclareVars", 1) ;1 = Variable muss deklariert werden
    Opt("GUIOnEventMode",1) ;Aktiviert die OnEvent Funktionsanmeldung
    Opt("MouseCoordMode", 0) ;relative Koordinaten zum aktiven Fenster

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

    Global $Script_Name = "THOMSON TG585 v7 - Tool" ;THOMSON TG585 v7 (CANT-P) = WLAN-Router mit internem DSL-Modem
    ;http://wiki.openwrt.org/toh/thomson/tg585
    If _Singleton($Script_Name,1) = 0 Then
    Sound() ;
    Exit
    EndIf

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

    ;Loop
    Global $i

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

    ;GUI
    Global $GUIGetMsg

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

    ;Button
    Global $Button_ID = 0
    Global $Button_Sperre = 0 ;0=AUS, 1=Ein

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

    ;Doubleclick_Button
    Global $Timer_DblClick
    Global $Counter_DblClick = 0
    Global $Switch_MousePos = True
    Global $MouseGetPos
    Global $Mouse_DoubleClickSpeed = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "DoubleClickSpeed")

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

    ;TCP
    Global $TCPRecv
    Global $TCP_IP_old
    Global $TCP_IP_new

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

    ;Timer
    Global $Timer_Modem_Restart
    Global $Timer_Modem_Wait_Off
    Global $Timer_Modem_Wait_On

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

    ;Data
    Dim $Data[59]
    $Data[0] = "192.168.1.254" ;Modem_IP
    $Data[1] = "23" ;Standart Port(http://de.wikipedia.org/wiki/Liste_der…disierten_Ports)
    $Data[2] = ""
    $Data[3] = "" ;Username
    $Data[4] = "" ;Password
    $Data[5] = ""
    $Data[6] = "ppp ifattach intf = Internet" ;PPP_EIN (Connect PPP)
    $Data[7] = "ppp ifdetach intf = Internet" ;PPP_AUS (Drop PPP)
    $Data[8] = ""
    $Data[9] = "wireless ifconfig state=enabled" ;WLAN_EIN
    $Data[10] = "wireless ifconfig state=disabled" ;WLAN_AUS
    $Data[11] = ""
    $Data[12] = "ppp ifdetach intf = Internet" ;NEUE_IP(Teil 1) (Drop PPP)
    $Data[13] = "ppp ifattach intf = Internet" ;NEUE_IP(Teil 2) (Connect PPP)
    $Data[14] = ""
    $Data[15] = "system reboot" ;NEU_STARTEN
    $Data[16] = ""
    $Data[17] = "2048" ;Maximale Anzahl der zu erhaltenen Daten/Zeichen von einem verbundenen "Socket" mit TCPRecv Befehl
    $Data[18] = ""
    $Data[19] = ">" ;Wird ins Fenster geschrieben(Zeilenanfang)
    $Data[20] = " --> " ;NEUE_IP (zwischen alt zu neu)
    $Data[21] = "500" ;Pausezeit für Modem Rückmeldung. Falls Verbindung zum Modem langsam oder für Testzwecke den Wert erhöhen.
    $Data[22] = "2000" ;Zusatzpausezeit für Modem Rückmeldung.
    $Data[23] = "2000" ;Pausezeit nach TCPShutdown
    $Data[24] = ""
    $Data[25] = "Fehler"
    $Data[26] = "Kann keine Verbindung herstellen."
    $Data[27] = "Warten bis Modem abgestellt ist..."
    $Data[28] = "Warten bis Modem eingeschalten ist..."
    $Data[29] = " Sekunde(n) Gesamtzeit"
    $Data[30] = "IP-Adresse: "
    $Data[31] = "www.google.de" ;Ping Adresse für Verbindungstest
    $Data[32] = "" ;Platzhalter für $Command_Sequence_1/SEND_TEXT
    $Data[33] = "exit" ;Exit
    $Data[34] = ""
    $Data[35] = ""
    $Data[36] = ""
    $Data[37] = ""
    $Data[38] = ""
    $Data[39] = ""
    $Data[40] = ""
    $Data[41] = "xdsl info expand=enabled"
    $Data[42] = "wireless ifconfig"
    $Data[43] = "eth device iflist"
    $Data[44] = "dhcp server lease list"
    $Data[45] = "sntp list"
    $Data[46] = "service system list"
    $Data[47] = "dns server route list"
    $Data[48] = "dyndns service list"
    $Data[49] = "xdsl debug multimode"
    $Data[50] = "connection bindlist"
    $Data[51] = "eth bridge igmpsnooping config"
    $Data[52] = "wireless macacl list"
    $Data[53] = "env get var=SESSIONTIMEOUT"
    $Data[54] = "ip iflist expand=enabled"
    $Data[55] = "service system list name=PING_RESPONDER expand=enabled"
    $Data[56] = "system locale"
    $Data[57] = "system qual led value=alloff"
    $Data[58] = "system qual led value=unlock"

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

    ;Data_Info
    Dim $Data_Info[59]
    $Data_Info[41] = "Get router stats"
    $Data_Info[42] = "Show wireless settings"
    $Data_Info[43] = "List state of ethernet ports"
    $Data_Info[44] = "View the pool name and MAC address of the connected device"
    $Data_Info[45] = "List the time servers"
    $Data_Info[46] = "Show if enabled or disabled"
    $Data_Info[47] = "List all DNS resolvers set in the router"
    $Data_Info[48] = "View existing settings. It's the 'custom' section we'll be changing"
    $Data_Info[49] = "Show all enabled modes"
    $Data_Info[50] = "View the bind list"
    $Data_Info[51] = "View present state. If state=enabled then apply the fix"
    $Data_Info[52] = "Display preset wireless MAC's"
    $Data_Info[53] = "Check telnet timeout setting"
    $Data_Info[54] = "Show present MTU setting. Show routers MAC and other stuff"
    $Data_Info[55] = "Check if 'interface' group is associated with WAN (ie enabled)"
    $Data_Info[56] = "Display present settings"
    $Data_Info[57] = "Turn all LED's off"
    $Data_Info[58] = "Enable LED's"

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

    ;Command_Sequence
    Dim $Command_Sequence_1[4] = [3,4,32,33] ;Befehlsfolge SEND_TEXT ,32=Platzhalter für Text senden(nicht entfernen)
    Dim $Command_Sequence_2[4] = [3,4,6,33] ;Befehlsfolge PPP_EIN
    Dim $Command_Sequence_3[4] = [3,4,7,33] ;Befehlsfolge PPP_AUS
    Dim $Command_Sequence_4[4] = [3,4,9,33] ;Befehlsfolge WLAN_EIN
    Dim $Command_Sequence_5[4] = [3,4,10,33] ;Befehlsfolge WLAN_AUS
    Dim $Command_Sequence_6[5] = [3,4,12,13,33] ;Befehlsfolge NEUE_IP
    Dim $Command_Sequence_7[4] = [3,4,15,33] ;Befehlsfolge NEU_STARTEN
    Dim $Command_Sequence_8[4] = [3,4,41,33] ;Befehlsfolge F1
    Dim $Command_Sequence_9[4] = [3,4,42,33] ;Befehlsfolge F2
    Dim $Command_Sequence_10[4] = [3,4,43,33] ;Befehlsfolge F3
    Dim $Command_Sequence_11[4] = [3,4,44,33] ;Befehlsfolge F4
    Dim $Command_Sequence_12[4] = [3,4,45,33] ;Befehlsfolge F5
    Dim $Command_Sequence_13[4] = [3,4,46,33] ;Befehlsfolge F6
    Dim $Command_Sequence_14[4] = [3,4,47,33] ;Befehlsfolge F7
    Dim $Command_Sequence_15[4] = [3,4,48,33] ;Befehlsfolge F8
    Dim $Command_Sequence_16[4] = [3,4,49,33] ;Befehlsfolge F9
    Dim $Command_Sequence_17[4] = [3,4,50,33] ;Befehlsfolge F10
    Dim $Command_Sequence_18[4] = [3,4,51,33] ;Befehlsfolge F11
    Dim $Command_Sequence_19[4] = [3,4,52,33] ;Befehlsfolge F12
    Dim $Command_Sequence_20[4] = [3,4,53,33] ;Befehlsfolge F13
    Dim $Command_Sequence_21[4] = [3,4,54,33] ;Befehlsfolge F14
    Dim $Command_Sequence_22[4] = [3,4,55,33] ;Befehlsfolge F15
    Dim $Command_Sequence_23[4] = [3,4,56,33] ;Befehlsfolge F16
    Dim $Command_Sequence_24[4] = [3,4,57,33] ;Befehlsfolge F17
    Dim $Command_Sequence_25[4] = [3,4,58,33] ;Befehlsfolge F18

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

    ;Switch_Command_Sequence
    Dim $Switch_Command_Sequence = 0

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

    ;Switch_Modem_Connected
    Dim $Switch_Modem_Connected = -1 ;(-1) = mit Modem nicht verbunden, (<> -1) = mit Modem verbunden

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

    ;Counter_Connect_Receive_Send
    Dim $Counter_Command_Sequence_ = 0

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

    ;OnAutoItExitRegister
    OnAutoItExitRegister(OnAutoItExit) ;Funktion OnAutoItExit starten wenn AutoIt Script beendet(Exit oder per Hand geschlossen)wurde.

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

    ;GUICreate
    Dim $GUICreate_Telnet_Client = GUICreate($Script_Name,785,800) ;Erstellt ein GUI-Fenster.
    GUISetFont(12, 800, 0, "MS Sans Serif") ;Legt die Standardschriftart eines GUI-Fensters fest.
    GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_EVENT_CLOSE") ;die Dialogbox wird geschlossen (entweder durch einen bestimmten Button oder das Systemmenü).
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "GUI_EVENT_MINIMIZE") ;die Dialogbox wird per Button in der Titelleiste minimiert.
    GUISetOnEvent($GUI_EVENT_MAXIMIZE, "GUI_EVENT_MAXIMIZE") ;die Dialogbox wird per Button in der Titelleiste maximiert.
    GUISetOnEvent($GUI_EVENT_RESTORE, "GUI_EVENT_RESTORE") ;die Dialogbox wird durch Klick auf das Taskleistensymbol wiederhergestellt.
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, '_PRdown') ;die erste (linke) Maustaste wurde gedrückt
    GUISetOnEvent($GUI_EVENT_PRIMARYUP, '_PRup') ;die erste (linke) Maustaste wurde losgelassen
    ;
    Dim $Button_INFO = GUICtrlCreateButton("?",5,5,25,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_INFO,16)
    GUICtrlSetBkColor($Button_INFO,0xFFFF00) ;Yellow
    ;
    Dim $Button_IP = GUICtrlCreateButton("IP_?",35,5,60,40,$BS_DEFPUSHBUTTON) ;Erzeugt eine Schaltfläche mit einem dicken, schwarzen Rand (Default-Schaltfläche).
    GUICtrlSetFont($Button_IP,16) ;Setzt die Schriftart und Schriftgröße für ein Control.
    GUICtrlSetBkColor($Button_IP,0xFFFF00) ;Yellow ;Setzt die Hintergrundfarbe eines Controls.
    ;
    Dim $Input_GUICreate_Telnet_Client = GUICtrlCreateInput("",100,5,534,40) ;Erstellt eine Eingabe-Dialogbox für die GUI.
    GUICtrlSetFont($Input_GUICreate_Telnet_Client,18) ;Setzt die Schriftart und Schriftgröße für ein Control.
    GUICtrlSetBkColor($Input_GUICreate_Telnet_Client,0xFFFFFF) ;White ;Setzt die Hintergrundfarbe eines Controls.
    ;
    Dim $Button_SEND_TEXT = GUICtrlCreateButton("SEND_TEXT",639,5,140,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_SEND_TEXT,16)
    GUICtrlSetBkColor($Button_SEND_TEXT,0xFFFFFF) ;White
    ;
    Dim $Button_PPP_EIN = GUICtrlCreateButton("PPP_EIN",5,50,110,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_PPP_EIN,16)
    GUICtrlSetBkColor($Button_PPP_EIN,0xC0DCC0) ;MoneyGreen
    ;
    Dim $Button_PPP_AUS = GUICtrlCreateButton("PPP_AUS",115,50,110,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_PPP_AUS,16)
    GUICtrlSetBkColor($Button_PPP_AUS,0xC0DCC0) ;MoneyGreen
    ;
    Dim $Button_WLAN_EIN = GUICtrlCreateButton("WLAN_EIN",225,50,137,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_WLAN_EIN,16)
    GUICtrlSetBkColor($Button_WLAN_EIN,0xC0DCC0) ;MoneyGreen
    ;
    Dim $Button_WLAN_AUS = GUICtrlCreateButton("WLAN_AUS",362,50,137,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_WLAN_AUS,16)
    GUICtrlSetBkColor($Button_WLAN_AUS,0xC0DCC0) ;MoneyGreen
    ;
    Dim $Button_NEUE_IP = GUICtrlCreateButton("NEUE_IP",499,50,110,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_NEUE_IP,16)
    GUICtrlSetBkColor($Button_NEUE_IP,0xC0DCC0) ;MoneyGreen
    ;
    Dim $Button_NEU_STARTEN = GUICtrlCreateButton("NEU_STARTEN",609,50,170,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_NEU_STARTEN,16)
    GUICtrlSetBkColor($Button_NEU_STARTEN,0xC0DCC0) ;MoneyGreen
    ;
    Dim $_Button_FUNKTION_[19] = [0,5,48,91,134,177,220,263,306,349,392,435,478,521,564,607,650,693,736], $Button_FUNKTION_[UBound($_Button_FUNKTION_)]
    For $i = 1 To UBound($_Button_FUNKTION_) - 1
    $Button_FUNKTION_[$i] = GUICtrlCreateButton("F" & $i, $_Button_FUNKTION_[$i],95,43,40,$BS_DEFPUSHBUTTON)
    GUICtrlSetFont($Button_FUNKTION_[$i],16)
    GUICtrlSetBkColor($Button_FUNKTION_[$i],0xC0DCC0) ;MoneyGreen
    GUICtrlSetTip(-1, $Data[$i+40] & @CR & $Data_Info[$i+40])
    GUICtrlSetOnEvent(-1, "Button_FUNKTION")
    Next
    ;
    Dim $Edit_GUICreate_Telnet_Client = GUICtrlCreateEdit("",5,140,780,680,$ES_READONLY+$WS_VSCROLL) ;Erzeugt ein Fenster, mit einem vertikalen Scroll-Balken($WS_VSCROLL).
    ;Verhindert die Eingabe oder Veränderung von Text im Eingabefeld durch den Nutzer($ES_READONLY).
    GUICtrlSetFont($Edit_GUICreate_Telnet_Client,12) ;Setzt die Schriftart und Schriftgröße für ein Control.
    GUICtrlSetBkColor($Edit_GUICreate_Telnet_Client,0x000000) ;Black ;Setzt die Hintergrundfarbe eines Controls.
    GUICtrlSetColor($Edit_GUICreate_Telnet_Client,0xC0C0C0) ;Silver ;Setzt die Textfarbe eines Controls.
    GUISetState(@SW_SHOWNORMAL) ;Verändert den Status eines GUI-Fensters. Aktiviert und stellt ein Fenster dar(@SW_SHOWNORMAL).

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

    Button_INFO() ;

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

    ;GUI_Loop
    While 1
    Sleep(100)
    WEnd

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

    ;Function
    Func Button_FUNKTION()
    $Button_ID = @GUI_CtrlId - 12
    Consolewrite($Button_ID & @LF)
    EndFunc

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

    Func _PRdown()
    If $Button_Sperre = 0 Then

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

    $MouseGetPos = MouseGetPos() ;

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

    If _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_INFO) Then
    GUICtrlSetBkColor($Button_INFO, 0xFF0000) ;Red
    Sound() ;
    Button_INFO() ;
    GUICtrlSetBkColor($Button_INFO, 0xFFFF00) ;Yellow

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_IP) Then
    GUICtrlSetBkColor($Button_IP, 0xFF0000) ;Red
    Sound() ;
    If Ping($Data[31]) Then
    $TCP_IP_new = _GetIP()
    Switch $Switch_Command_Sequence
    Case 2,6,7 ;2=PPP_EIN ;6=NEUE_IP ;7=NEU_STARTEN
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, @CRLF & $Data[30] & $TCP_IP_old & $Data[20] & $TCP_IP_new & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client))
    Case Else
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, @CRLF & $Data[30] & $TCP_IP_new & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client))
    EndSwitch
    EndIf
    GUICtrlSetBkColor($Button_IP, 0xFFFF00) ;Yellow

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_SEND_TEXT) Then
    GUICtrlSetBkColor($Button_SEND_TEXT, 0xFF0000) ;Red
    Sound() ;
    $Switch_Command_Sequence = 1 ;SEND_TEXT
    Connect_Receive_Send() ;
    GUICtrlSetBkColor($Button_SEND_TEXT, 0xFFFFFF) ;White

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_PPP_EIN) Then
    GUICtrlSetBkColor($Button_PPP_EIN, 0xFF0000) ;Red
    Sound() ;
    $Switch_Command_Sequence = 2 ;PPP_EIN
    Connect_Receive_Send() ;
    GUICtrlSetBkColor($Button_PPP_EIN, 0xC0DCC0) ;MoneyGreen

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_PPP_AUS) Then
    GUICtrlSetBkColor($Button_PPP_AUS, 0xFF0000) ;Red
    Sound() ;
    $Switch_Command_Sequence = 3 ;PPP_AUS
    IP_Swap() ;
    Connect_Receive_Send() ;
    GUICtrlSetBkColor($Button_PPP_AUS, 0xC0DCC0) ;MoneyGreen

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_WLAN_EIN) Then
    GUICtrlSetBkColor($Button_WLAN_EIN, 0xFF0000) ;Red
    Sound() ;
    $Switch_Command_Sequence = 4 ;WLAN_EIN
    Connect_Receive_Send() ;
    GUICtrlSetBkColor($Button_WLAN_EIN, 0xC0DCC0) ;MoneyGreen

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_WLAN_AUS) Then
    GUICtrlSetBkColor($Button_WLAN_AUS, 0xFF0000) ;Red
    Sound() ;
    $Switch_Command_Sequence = 5 ;WLAN_AUS
    Connect_Receive_Send() ;
    GUICtrlSetBkColor($Button_WLAN_AUS, 0xC0DCC0) ;MoneyGreen

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_NEUE_IP) Then
    GUICtrlSetBkColor($Button_NEUE_IP, 0xFF0000) ;Red
    Sound() ;
    $Switch_Command_Sequence = 6 ;NEUE_IP
    IP_Swap() ;
    Connect_Receive_Send() ;
    GUICtrlSetBkColor($Button_NEUE_IP, 0xC0DCC0) ;MoneyGreen

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_NEU_STARTEN) Then
    GUICtrlSetBkColor($Button_NEU_STARTEN, 0xFF0000) ;Red
    Sound() ;
    $Switch_Command_Sequence = 7 ;NEU_STARTEN
    IP_Swap() ;
    Connect_Receive_Send() ;
    GUICtrlSetBkColor($Button_NEU_STARTEN, 0xC0DCC0) ;MoneyGreen

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

    ElseIf _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[1]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[2]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[3]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[4]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[5]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[6]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[7]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[8]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[9]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[10]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[11]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[12]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[13]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[14]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[15]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[16]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[17]) Or _
    _CheckCtrlDblClick($GUICreate_Telnet_Client, $Button_FUNKTION_[18]) Then
    GUICtrlSetBkColor($Button_FUNKTION_[$Button_ID], 0xFF0000) ;Red
    Sound() ;
    $Switch_Command_Sequence = 7 + $Button_ID
    Connect_Receive_Send() ;
    GUICtrlSetBkColor($Button_FUNKTION_[$Button_ID], 0xC0DCC0) ;MoneyGreen

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

    Else
    $Switch_MousePos = False
    EndIf
    EndIf
    EndFunc

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

    Func _PRup()
    If $Switch_MousePos Then
    If $Counter_DblClick = 2 Then
    $Counter_DblClick = 0
    Else
    $Timer_DblClick = TimerInit() ;
    EndIf
    EndIf
    EndFunc

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

    Func _CheckCtrlDblClick($GUI, $CTRL)
    Local $CtrlPos = ControlGetPos($GUI, "", $CTRL)
    If ($MouseGetPos[0] >= $CtrlPos[0] And _
    $MouseGetPos[0] <= $CtrlPos[0] + $CtrlPos[2]) And _
    ($MouseGetPos[1] >= $CtrlPos[1] + 20 And _
    $MouseGetPos[1] <= $CtrlPos[1] + 20 + $CtrlPos[3]) Then
    $Counter_DblClick += 1
    $Switch_MousePos = True
    If $Counter_DblClick = 2 And (TimerDiff($Timer_DblClick) < $Mouse_DoubleClickSpeed) Then
    Return True
    Else
    $Timer_DblClick = TimerInit() ;
    $Counter_DblClick = 1
    EndIf
    EndIf
    EndFunc

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

    Func Button_INFO()
    For $i = 18 To 1 Step -1
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, " " & $Data_Info[$i+40] & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client))
    If $i < 10 Then
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, @CRLF & "F" & $i & " : " & $Data[$i+40] & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client))
    Else
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, @CRLF & "F" & $i & ": " & $Data[$i+40] & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client))
    EndIf
    Next
    EndFunc

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

    Func Connect_Receive_Send()
    While 1
    $Button_Sperre = 1 ;Buttons gesperrt

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

    TCPStartup() ;Stellt den TCP Dienst zur Verfügung

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

    $Switch_Modem_Connected = TCPConnect($Data[0],$Data[1]) ;Verbinden

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

    If $Switch_Modem_Connected = -1 Then ;Verbindung zum Modem prüfen
    MsgBox(16, $Data[25], $Data[26])
    Sound() ;
    ExitLoop
    EndIf

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

    For $i In Eval("Command_Sequence_" & $Switch_Command_Sequence) ;Daten($Data) in der Schleife abarbeiten

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

    ;Schleifendurchgangzähler
    $Counter_Command_Sequence_ += 1

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

    ;Pause
    Sleep($Data[21])

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

    ;Consolewrite
    Consolewrite("Schritt " & $Counter_Command_Sequence_ & "/" & Ubound(Eval("Command_Sequence_" & $Switch_Command_Sequence)) &@LF)
    If $Counter_Command_Sequence_ = Ubound(Eval("Command_Sequence_" & $Switch_Command_Sequence)) Then
    Consolewrite(@LF)
    EndIf
    ;~ Consolewrite($TCPRecv)

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

    ;Schleife verlassen wenn Schleifendurchgangzähler größer als Anzahl der Daten(Command_Sequence)
    If $Counter_Command_Sequence_ > Ubound(Eval("Command_Sequence_" & $Switch_Command_Sequence)) Then
    Consolewrite(@LF)
    ExitLoop
    EndIf

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

    ;Empfangen
    $TCPRecv = TCPRecv($Switch_Modem_Connected, $Data[17]) ;Maximale Anzahl der zu erhaltenen Daten/Zeichen festlegen
    If @error Then
    ExitLoop
    EndIf
    If $TCPRecv <> "" Then
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, $Data[19] & $TCPRecv & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client)) ;die vom Modem empfangenen Daten ins Fenster schreiben
    EndIf

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

    ;Senden($Input_GUICreate_Telnet_Client)
    If $Switch_Command_Sequence = 1 And $Counter_Command_Sequence_ = 3 Then ;1=SEND_TEXT
    TCPSend($Switch_Modem_Connected, GUICtrlRead(($Input_GUICreate_Telnet_Client), 1) & @CRLF) ;Inhalt vom Eingabefeld senden
    ;~ GUICtrlSetData($Input_GUICreate_Telnet_Client,"") ;Eingabefeld leeren
    GUICtrlSetState($Input_GUICreate_Telnet_Client,$GUI_FOCUS) ;$GUI_FOCUS = Das Control erhält den Eingabe- bzw. Auswahlfokus
    Else
    ;Senden($Data)
    TCPSend($Switch_Modem_Connected, $Data[$i] & @CRLF)
    EndIf

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

    ;Zusatzpause
    If $Switch_Command_Sequence = 6 And $Counter_Command_Sequence_ = 4 Then ;6=NEUE_IP
    Sleep($Data[21])
    EndIf
    Next

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

    Disconnect_Receive_Send() ;Verbindung trennen

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

    While 1
    If $Switch_Command_Sequence = 7 Then ;7=NEU_STARTEN
    $Timer_Modem_Restart = TimerInit() ;
    $Timer_Modem_Wait_Off = TimerInit() ;
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, $Data[19] & $Data[27] & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client))
    While Ping($Data[31])
    Sleep(1000)
    If TimerDiff($Timer_Modem_Wait_Off) > 30000 Then ExitLoop 2
    WEnd
    $Timer_Modem_Wait_On = TimerInit() ;
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, $Data[19] & $Data[28] & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client))
    $i= GUICtrlRead($Edit_GUICreate_Telnet_Client)
    While Not Ping($Data[31])
    GUICtrlSetData($Edit_GUICreate_Telnet_Client, $Data[19] & Round(TimerDiff($Timer_Modem_Restart)/1000) & $Data[29] & @CRLF & $i)
    Sleep(1000)
    If TimerDiff($Timer_Modem_Wait_On) > 300000 Then ExitLoop 2
    WEnd
    ExitLoop
    Else
    ExitLoop
    EndIf
    WEnd

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

    GUICtrlSetData($Edit_GUICreate_Telnet_Client, $Data[19] & @CRLF & GUICtrlRead($Edit_GUICreate_Telnet_Client)) ;Leerzeile ins Fenster schreiben
    $Counter_Command_Sequence_ = 0 ;Schleifendurchgangzähler Reset
    $Button_Sperre = 0 ;Pausezeit nach TCPShutdown
    ExitLoop ;Zurück zur GUI
    WEnd
    EndFunc

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

    Func Disconnect_Receive_Send()
    If $Switch_Modem_Connected <> - 1 Then
    TCPCloseSocket($Switch_Modem_Connected)
    EndIf
    TCPShutdown()
    EndFunc

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

    Func IP_Swap()
    $TCP_IP_old = $TCP_IP_new
    EndFunc

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

    Func OnAutoItExit()
    Disconnect_Receive_Send() ;
    Sound() ;
    EndFunc

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

    Func GUI_EVENT_CLOSE()
    Exit
    EndFunc

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

    Func GUI_EVENT_MINIMIZE()
    Sound() ;
    EndFunc

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

    Func GUI_EVENT_MAXIMIZE()
    Sound() ;
    EndFunc

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

    Func GUI_EVENT_RESTORE()
    Sound() ;
    EndFunc

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

    Func Sound()
    Beep(200,200)
    EndFunc

    [/autoit]

    [Blockierte Grafik: http://fs1.directupload.net/images/150107/b2rhv74l.gif]