Hallo LuZ1F3R,
da ich keinen Roter habe, heir einmal da abgespeckte Skript:
Spoiler anzeigen
#include <IE.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Username = "root"
$PW = "xxxxxxx"
#region ### START Koda GUI section ### Form=
$Form2 = GUICreate("EasyBox 602 Manager", 591, 349, 464, 189)
$Group1 = GUICtrlCreateGroup(" Informationen ", 8, 8, 369, 329, $BS_FLAT)
$List1 = GUICtrlCreateList("", 16, 24, 353, 305, BitOR($WS_VSCROLL, $WS_BORDER))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button3 = GUICtrlCreateButton("Fenster schließen", 392, 312, 187, 25, $WS_GROUP)
$Group2 = GUICtrlCreateGroup("Befehle", 384, 8, 201, 177)
$Button1 = GUICtrlCreateButton("Neue IP besorgen", 392, 24, 187, 73, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Aktuelle Verbindungsinfos", 392, 104, 187, 73, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
; Case $GUI_EVENT_CLOSE, $Button3 so geht es auch dann sparst du dir den case $Button3
Exit
Case $Button2
MsgBox(0,"","Button 2")
#cs
$ie=_IECreate("http://192.168.2.1", 0, 0)
$form = _IEGetObjById($ie,'tF')
$object = _IEGetObjByName($ie,'user')
_IEFormElementSetValue($object, $Username)
$object2 = _IEGetObjByName($ie,'pws')
_IEFormElementSetValue($object2, $PW)
_IEFormSubmit($form)
_IEQuit($ie)
;eingeloggt
_GUICtrlListBox_ResetContent($List1)
GUICtrlSetData($List1, "Verbindungsinformationen:")
GUICtrlSetData($List1, "--------------------------------------")
$ie=_IECreate("http://192.168.2.1/status_main.stm", 0, 0)
$form = _IEGetObjById($ie,'tF')
$object = _IEGetObjByName($ie,'user')
_IEFormElementSetValue($object, $Username)
$object2 = _IEGetObjByName($ie,'pws')
_IEFormElementSetValue($object2, $PW)
_IEFormSubmit($form)
$body = _IEBodyReadTEXT($ie)
$bodyArray = StringSplit($body, @LF)
For $x=1 to $bodyArray[0]
If StringInStr($bodyArray[$x],"adsl:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "Verbindung: " & $bodyToken[2] & " " & $bodyToken[3])
EndIf
If StringInStr($bodyArray[$x],"modus:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "Modus: " & $bodyToken[3] & " " & $bodyToken[4])
EndIf
If StringInStr($bodyArray[$x],"download:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "Download: " & $bodyToken[2] & " " & $bodyToken[3] & "kbps")
EndIf
If StringInStr($bodyArray[$x],"upload:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "Upload: " & $bodyToken[2] & " " & $bodyToken[3] & "kbps")
EndIf
If StringInStr($bodyArray[$x],"wan ip:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "Wan IP: " & $bodyToken[3] & " " & $bodyToken[4])
EndIf
If StringInStr($bodyArray[$x],"dhcp server:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "DHCP Server: " & $bodyToken[3])
EndIf
If StringInStr($bodyArray[$x],"Anzahl DHCP-Clients")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "DHCP Clients connected: " & $bodyToken[3] & " " & $bodyToken[4])
EndIf
Next
_IEQuit($ie)
#ce
Case $Button3
MsgBox(0,"","Button 3")
Exit
Case $Button1
MsgBox(0,"","Button 1")
#cs
GUICtrlSetData($List1, "")
; #######################################################
; Neu Verbinden
; #######################################################
; Loginform
$IE=_IECreate("http://192.168.2.1", 0, 1)
$form = _IEGetObjById($ie,'tF')
$object = _IEGetObjByName($ie,'user')
_IEFormElementSetValue($object, $Username)
$object2 = _IEGetObjByName($ie,'pws')
_IEFormElementSetValue($object2, $PW)
_IEFormSubmit($form)
_GUICtrlListBox_ResetContent($List1)
GUICtrlSetData($List1, "Restarte Internetverbindung")
GUICtrlSetData($List1, "Dies wird ca 20 Sekunden dauern.")
GUICtrlSetData($List1, "Bitte warten...")
Sleep(2000)
;Zum Button navigieren
;Hier Anpassen!!!!
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{SPACE}")
_IEQuit($IE)
Sleep(20000)
; Neu Verbunden
$ie=_IECreate("http://192.168.2.1", 0, 0)
$form = _IEGetObjById($ie,'tF')
$object = _IEGetObjByName($ie,'user')
_IEFormElementSetValue($object, $Username)
$object2 = _IEGetObjByName($ie,'pws')
_IEFormElementSetValue($object2, $PW)
_IEFormSubmit($form)
_IEQuit($ie)
;eingeloggt
GUICtrlSetData($List1, "Verbindungsinformationen:")
GUICtrlSetData($List1, "--------------------------------------")
$ie=_IECreate("http://192.168.2.1/status_main.stm", 0, 0)
$form = _IEGetObjById($ie,'tF')
$object = _IEGetObjByName($ie,'user')
_IEFormElementSetValue($object, $Username)
$object2 = _IEGetObjByName($ie,'pws')
_IEFormElementSetValue($object2, $PW)
_IEFormSubmit($form)
$body = _IEBodyReadTEXT($ie)
$bodyArray = StringSplit($body, @LF)
For $x=1 to $bodyArray[0]
If StringInStr($bodyArray[$x],"adsl:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "Verbindung: " & $bodyToken[2] & " " & $bodyToken[3])
EndIf
If StringInStr($bodyArray[$x],"modus:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "Modus: " & $bodyToken[3] & " " & $bodyToken[4])
EndIf
If StringInStr($bodyArray[$x],"download:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "Download: " & $bodyToken[2] & " " & $bodyToken[3] & "kbps")
EndIf
If StringInStr($bodyArray[$x],"upload:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "Upload: " & $bodyToken[2] & " " & $bodyToken[3] & "kbps")
EndIf
If StringInStr($bodyArray[$x],"wan ip:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "Wan IP: " & $bodyToken[3] & " " & $bodyToken[4])
EndIf
If StringInStr($bodyArray[$x],"dhcp server:")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "DHCP Server: " & $bodyToken[3])
EndIf
If StringInStr($bodyArray[$x],"Anzahl DHCP-Clients")<>0 then
$bodyFound = $bodyArray[$x]
$bodyToken = StringSplit($bodyFound, " ")
GUICtrlSetData($List1, "DHCP Clients connected: " & $bodyToken[3] & " " & $bodyToken[4])
EndIf
Next
_IEQuit($ie)
#ce
EndSwitch
WEnd
in dem ich keinen Fehler finden kann. Falls du keinen ganz grassen Fehler (den ich dann leider übersehen habe) eingebaut hast sollte das Skript funktionieren, ansonsten schau dir [ offen ] Tutorial: Wie man Script-Fehler erfolgreich sucht/findet bzw. richtig debuggt an,
mfg (Auto)Bert