Beiträge von Moombas
-
-
-
Naja, wenn man generell ' anstatt " nutzt, finde ich ist es wesentlich einfacher:
AutoIt$sPrintServer = 'PRINT:SERVER' $sText = 'TEXT' ConsoleWrite(@SystemDir & "\RUNDLL32 PRINTUI.DLL,PrintUIEntry /q /y /n " & '"' & "\\" & $sPrintServer & "\" & $sText & '"' & @CRLF) ; mit Stringformat muss "\" maskiert werden, also immer doppelt ConsoleWrite(StringFormat('%s\\RUNDLL32 PRINTUI.DLL,PrintUIEntry /q /y /n "\\\\%s\\%s"', @SystemDir, $sPrintServer, $sText) & @CRLF) ; generell ' nutzen ansatt ", das man ' in einem Pfad-String braucht ist eher unwahrscheinlich und man braucht kaum wechseln und auch keine Maskierung ConsoleWrite(@SystemDir & '\RUNDLL32 PRINTUI.DLL,PrintUIEntry /q /y /n "\\' & $sPrintServer & '\' & $sText & '"' & @CRLF)Ich fahre seit dem Wechsel von ' auf " wesentlich besser aber das ist ein wenig Geschmackssache.
-
Auch wenn ich Lernenden das gerne selber überlasse Alina und später dann bei Problemen aushelfe (á lá learning by doing) , ja das Prinzip past würde das aber meinerseits etwas anders anpacken (Achtung: Das ist kein Anspruch an einen Neuling was nun kommt (!), da ist die pragmatische Lösung von Alina eher die Aufzeigt wie es geht):
AutoIt
Alles anzeigenOpt('MustDeclareVars', 1) #include <MsgBoxConstants.au3> Global $iNumber $iNumber = Show_Random_Numbers(1, 1000) $iNumber = Show_Random_Numbers($iNumber, 1000) Func Show_Random_Numbers($iMin, $iMax) Local Const $f_Integer = 1 Local $iRandom_Number $iRandom_Number = Random($iMin, $iMax, $f_Integer) MsgBox($IDOK, "Zufallszahl", "Eine Zufallszahl zwischen " & $iMin & " und " & $iMax & ": " & $iRandom_Number) Return $iRandom_Number EndFunc -
Hi Skriptboomer,
Zu deinen Fragen:
1. Schau mal hier rein: https://www.autoitscript.com/autoit3/docs/functions/Random.htm
Für den 2. Part speicherst du dir die generierte Zahl und nimmst sie halt als neuen Min Wert.
2. Ja das geht. Die Umsetzung (und Möglichkeit) hängt aber davon ab was genau du wovon haben willst. Dann muss man schauen was geht und was nicht und wie.
-
Freut mich das ich helfen konnte.
Ich denke, das hier nichts anderes gemacht wird, als der WinAPI Berechtigungen zum Lesen der entsprechenden Informationen gegeben und am Ende wieder genommen werden.
Ich hoffe natürlich das ich das richtig verstanden habe aber ich gebe keine Garantie

-
Racer : Steht das nicht schon in der Hilfe?
Ich würde sagen, folgendes muss vor deinem _WinAPI_GetProcessUser einmalig aufgerufen werden:
AutoIt; Enable "SeDebugPrivilege" privilege for obtain full access rights to another processes Local $hToken = _WinAPI_OpenProcessToken(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY)) _WinAPI_AdjustTokenPrivileges($hToken, $SE_DEBUG_NAME, $SE_PRIVILEGE_ENABLED, $aAdjust)und folgendes, wenn du damit fertig bist:
-
Achso,sorry.
-
Alles? Never.
Da ich aber auch vor einiger Zeit mal die GPO's eines anderen PC's anschauen wollte und diese mir nur als Datei vorlagen, habe ich mal gesucht und eben das gefunden.
Evtl. gibts auch schon mehr/bessere Tools aber für meine Zwecke war es genug.
-
Es gibt einen von zorphnog.
Ich finde gerade nicht, wo ich die aktuellste version dir verlinken kann aber ich habe das im Anhang lokal liegen.
-
Velted : Nicht unbedingt. Per VPN etc. kannst du auch Geräte erreichen, die im entsprechenden (lokalen) Netz sind, sich jedoch physisch in einem anderen Gebäude/Stadt/Land befinden. Da er hier 4 Eingabefelder verwendet und die Strucktur sehr nach mehreren Filialen aussieht, vermute ich stark genau diese Konstellation.
Und da spielt dann die (lokale) Datenanbindung der Filiale und nocht vieles weitere mit rein, womit du da gerne mal auch ganz andere ping-zeiten erreichen kannst.
-
EhrenBrudi : Freut mich das ich helfen konnte. Beachte bitte das ich (gerade gesehen) als timeout in meinem letzten Beispiel noch die 4000ms drin hatte, diese kannst du, wenn es wirklich nur lokale Systeme sind runter setzen, musst du aber mal testen.
Zudem vermute ich das du dir vorher eine Schleife gebaut hattest, was dein Script zum hängen gebracht hat. Wenn das Inputfeld 4 chars drin hat (was du vorher nicht geleert hast), macht er deinen test immer wieder (da die Prüfung auf die Anzahl der zeichen im Input immer "true" ergibt) und hängt sich somit weg (Endlosschleife).
Das habe ich nebenbei bei den "Aufräumarbeiten" behoben aber erst später realisiert.
Ich hoffe ich habe das ganze für dich noch einigermaßen im Verständlichen gelassen, trotz der Nutzung vieler Arrays zur Kürzung des benötigten Codes.
-
So, hier der optimierte und korrigierte Code (jemand anders kann hier sicherlich noch weiter optimieren aber mir pers. würde es reichen
) EhrenBrudiDa dein Problem nur an Anzahl der Geräte * timeout lag, ist dahingehend keine weitere optimierung möglich.
AutoIt
Alles anzeigenOpt('MustDeclareVars', 1) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <ColorConstants.au3> #include <ListViewConstants.au3> #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 HotKeySet ("{ESC}","_close") Global Const $shGui = GUICreate("Pinger",400,180) Global Const $idInput_Notepad1 = GUICtrlCreateInput("", 30,30,45) Global Const $idInput_Notepad2 = GUICtrlCreateInput("", 30,70,45) Global Const $idInput_Notepad3 = GUICtrlCreateInput("", 30,110,45) Global Const $idInput_Notepad4 = GUICtrlCreateInput("", 30,150,45) Global Const $idButton_Close = GUICtrlCreateButton("Schließen", 300, 30, 80, 20) Global Const $idButton_Ping1 = GUICtrlCreateButton("GO->",80, 30, 35,20) GUICtrlSetBkColor ($idButton_Ping1, $Color_Orange) Global Const $idButton_Ping2 = GUICtrlCreateButton("GO->",80, 70, 35,20) GUICtrlSetBkColor ($idButton_Ping2, $Color_Orange) Global Const $idButton_Ping3 = GUICtrlCreateButton("GO->",80, 110, 35,20) GUICtrlSetBkColor ($idButton_Ping3, $Color_Orange) Global Const $idButton_Ping4 = GUICtrlCreateButton("GO->",80, 150, 35,20) GUICtrlSetBkColor ($idButton_Ping4, $Color_Orange) Global $aLabelStore1[8] $aLabelStore1[0] = 7 $aLabelStore1[1] = GUICtrlCreateLabel("", 120, 30, 8, 8) $aLabelStore1[2] = GUICtrlCreateLabel("", 120, 40, 8, 8) $aLabelStore1[3] = GUICtrlCreateLabel("", 170, 30, 8, 8) $aLabelStore1[4] = GUICtrlCreateLabel("", 170, 40, 8, 8) $aLabelStore1[5] = GUICtrlCreateLabel("", 230, 28, 5, 5) $aLabelStore1[6] = GUICtrlCreateLabel("", 230, 38, 5, 5) $aLabelStore1[7] = GUICtrlCreateLabel("", 230, 48, 5, 5) Global $aLabelStore2[$aLabelStore1[0] + 1] $aLabelStore2[0] = $aLabelStore1[0] $aLabelStore2[1] = GUICtrlCreateLabel("", 120, 70, 8, 8) $aLabelStore2[2] = GUICtrlCreateLabel("", 120, 80, 8, 8) $aLabelStore2[3] = GUICtrlCreateLabel("", 170, 70, 8, 8) $aLabelStore2[4] = GUICtrlCreateLabel("", 170, 80, 8, 8) $aLabelStore2[5] = GUICtrlCreateLabel("", 230, 68, 5, 5) $aLabelStore2[6] = GUICtrlCreateLabel("", 230, 78, 5, 5) $aLabelStore2[7] = GUICtrlCreateLabel("", 230, 88, 5, 5) Global $aLabelStore3[$aLabelStore1[0] + 1] $aLabelStore3[0] = $aLabelStore1[0] $aLabelStore3[1] = GUICtrlCreateLabel("", 120, 110, 8, 8) $aLabelStore3[2] = GUICtrlCreateLabel("", 120, 120, 8, 8) $aLabelStore3[3] = GUICtrlCreateLabel("", 170, 110, 8, 8) $aLabelStore3[4] = GUICtrlCreateLabel("", 170, 120, 8, 8) $aLabelStore3[5] = GUICtrlCreateLabel("", 230, 108, 5, 5) $aLabelStore3[6] = GUICtrlCreateLabel("", 230, 118, 5, 5) $aLabelStore3[7] = GUICtrlCreateLabel("", 230, 128, 5, 5) Global $aLabelStore4[$aLabelStore1[0] + 1] $aLabelStore4[0] = $aLabelStore1[0] $aLabelStore4[1] = GUICtrlCreateLabel("", 120, 150, 8, 8) $aLabelStore4[2] = GUICtrlCreateLabel("", 120, 160, 8, 8) $aLabelStore4[3] = GUICtrlCreateLabel("", 170, 150, 8, 8) $aLabelStore4[4] = GUICtrlCreateLabel("", 170, 160, 8, 8) $aLabelStore4[5] = GUICtrlCreateLabel("", 230, 148, 5, 5) $aLabelStore4[6] = GUICtrlCreateLabel("", 230, 158, 5, 5) $aLabelStore4[7] = GUICtrlCreateLabel("", 230, 168, 5, 5) Global Const $aStoreArrays[5][2] = [[4, 1],[$idInput_Notepad1, $aLabelStore1], [$idInput_Notepad2, $aLabelStore2], [$idInput_Notepad3, $aLabelStore3], [$idInput_Notepad4, $aLabelStore4]] For $Row = 1 to $aLabelStore1[0] GUICtrlSetBkColor($aLabelStore1[$Row], $Color_black) GUICtrlSetBkColor($aLabelStore2[$Row], $Color_black) GUICtrlSetBkColor($aLabelStore3[$Row], $Color_black) GUICtrlSetBkColor($aLabelStore4[$Row], $Color_black) Next GUISetState(@SW_SHOW, $shGui) While 1 Switch GUIGetMsg() case $GUI_EVENT_CLOSE ExitLoop Case $idButton_Ping1 _ping($idInput_Notepad1, $aLabelStore1) Case $idButton_Ping2 _ping($idInput_Notepad2, $aLabelStore2) Case $idButton_Ping3 _ping($idInput_Notepad3, $aLabelStore3) Case $idButton_Ping4 _ping($idInput_Notepad4, $aLabelStore4) Case $idButton_Close _close() EndSwitch For $Row = 1 to $aStoreArrays[0][0] if StringLen(GUICtrlRead($aStoreArrays[$Row][0])) = 4 then _ping($aStoreArrays[$Row][0], $aStoreArrays[$Row][1]) Next ;~ if StringLen(GUICtrlRead($idInput_Notepad1)) = 4 then _ping($idInput_Notepad1, $aLabelStore1) ;~ if StringLen(GUICtrlRead($idInput_Notepad2)) = 4 then _ping($idInput_Notepad2, $aLabelStore2) ;~ if StringLen(GUICtrlRead($idInput_Notepad3)) = 4 then _ping($idInput_Notepad3, $aLabelStore3) ;~ if StringLen(GUICtrlRead($idInput_Notepad4)) = 4 then _ping($idInput_Notepad4, $aLabelStore4) WEnd Func _ping($idButton, $aIDLabels) Local Const $timeout = 1000 Local Const $read1 = GUICtrlRead($idButton) Local Const $aDeviceIPs[8] = [7, 140, 10, 11, 12, 13, 1, 50] For $Row = 1 to $aDeviceIPs[0] WinSetTitle($shGui, '', 'Pinger - Ping: ' & StringFormat("10.%.2d.%.1d.",StringLeft($read1,2), StringRight($read1,2)) & $aDeviceIPs[$Row]) If Ping(StringFormat("10.%.2d.%.1d.",StringLeft($read1,2), StringRight($read1,2)) & $aDeviceIPs[$Row], $timeout) Then GUICtrlSetBkColor($aIDLabels[$Row], $Color_green) Else GUICtrlSetBkColor($aIDLabels[$Row], $Color_red) EndIf sleep(100) Next GUICtrlSetData($idButton, '') WinSetTitle($shGui, '', 'Pinger') EndFunc Func _close() Exit EndFuncEdit: Ich war mal so frei, bei jedem Ping noch den Titel deines Fensters zu ändern, dann sieht man auch, das er noch arbeitet. Ist nur ein kleiner Vorschlag, kannst du ggf. auch wieder raus nehmen.
-
Noch einen kleinen Fehler gefunden (meinerseits), passe ich im nächsten Post an.
-
So, ich denke es hat vorher bei dir 28 und nicht 26 Sekunden gedauert (4000ms je ping * 7 Geräte = 28). Womit die Theorie von AspirinJunkie bestätigt wäre.
Ich habe deinen Code in einem ersten Step etwas zusammen gestaucht (da istmit Arrays etc. definitv noch viel drin das ganze zu vereinfachen), den Ping mal auf 1 Sekunde reduziert, Einrückungen korrigiert und Local/Global korrigiert/ergänzt. Da es hier scheinbar nur um lokale Geräte geht, müsste 1 Sekunde reichen.
Zusätzlich die GUI-Schleife korrigiert und der ping Funktion noch das Rücksetzen des Inputfeldes hinzugefügt.
AutoIt
Alles anzeigenOpt('MustDeclareVars', 1) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <ColorConstants.au3> #include <ListViewConstants.au3> #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Global $shGui = GUICreate("Pinger",400,180) Global $idInput_Notepad1 = GUICtrlCreateInput("", 30,30,45) Global $idInput_Notepad2 = GUICtrlCreateInput("", 30,70,45) Global $idInput_Notepad3 = GUICtrlCreateInput("", 30,110,45) Global $idInput_Notepad4 = GUICtrlCreateInput("", 30,150,45) Global $idButton_Close = GUICtrlCreateButton("Schließen", 300, 30, 80, 20) HotKeySet ("{ESC}","_close") Global $idButton_Ping1 = GUICtrlCreateButton("GO->",80, 30, 35,20) GUICtrlSetBkColor ($idButton_Ping1, $Color_Orange) Global $idButton_Ping2 = GUICtrlCreateButton("GO->",80, 70, 35,20) GUICtrlSetBkColor ($idButton_Ping2, $Color_Orange) Global $idButton_Ping3 = GUICtrlCreateButton("GO->",80, 110, 35,20) GUICtrlSetBkColor ($idButton_Ping3, $Color_Orange) Global $idButton_Ping4 = GUICtrlCreateButton("GO->",80, 150, 35,20) GUICtrlSetBkColor ($idButton_Ping4, $Color_Orange) Global $Label_Switchk1 = GUICtrlCreateLabel("", 120,30,8,8) GUICtrlSetBkColor ($Label_Switchk1, $Color_black) Global $Label_Routerk1 = GUICtrlCreateLabel ("", 120,40,8,8) GUICtrlSetBkColor ($Label_Routerk1, $Color_black) Global $Label_BOFk1 = GUICtrlCreateLabel("", 170,30,8,8) GUICtrlSetBkColor ($Label_BOFk1, $Color_black) Global $Label_Druckerk1 = GUICtrlCreateLabel("", 170,40,8,8) GUICtrlSetBkColor ($Label_Druckerk1, $Color_black) Global $Label_Kasse1k1 = GUICtrlCreateLabel("", 230,28,5,5) GUICtrlSetBkColor ($Label_Kasse1k1, $Color_black) Global $Label_Kasse2k1 = GUICtrlCreateLabel("", 230,38,5,5) GUICtrlSetBkColor ($Label_Kasse2k1, $Color_black) Global $Label_Kasse3k1 = GUICtrlCreateLabel("", 230,48,5,5) GUICtrlSetBkColor ($Label_Kasse3k1, $Color_black) ;~ Switch140 Global $Label_Switchk2 = GUICtrlCreateLabel("", 120,70,8,8) GUICtrlSetBkColor ($Label_Switchk2, $Color_black) ;~ Router01 Global $Label_Routerk2 = GUICtrlCreateLabel ("", 120,80,8,8) GUICtrlSetBkColor ($Label_Routerk2, $Color_black) ;~ BüroPc10 Global $Label_BOFk2 = GUICtrlCreateLabel("", 170,70,8,8) GUICtrlSetBkColor ($Label_BOFk2, $Color_black) ;~ Drucker50 Global $Label_Druckerk2 = GUICtrlCreateLabel("", 170,80,8,8) GUICtrlSetBkColor ($Label_Druckerk2, $Color_black) ;~ Kasse1 Global $Label_Kasse1k2 = GUICtrlCreateLabel("", 230,68,5,5) GUICtrlSetBkColor ($Label_Kasse1k2, $Color_black) ;~ Kasse2 Global $Label_Kasse2k2 = GUICtrlCreateLabel("", 230,78,5,5) GUICtrlSetBkColor ($Label_Kasse2k2, $Color_black) ;~ Kasse3 Global $Label_Kasse3k2 = GUICtrlCreateLabel("", 230,88,5,5) GUICtrlSetBkColor ($Label_Kasse3k2, $Color_black) ;~ Switch140 Global $Label_Switchk3 = GUICtrlCreateLabel("", 120,110,8,8) GUICtrlSetBkColor ($Label_Switchk3, $Color_black) ;~ Router01 Global $Label_Routerk3 = GUICtrlCreateLabel ("", 120,120,8,8) GUICtrlSetBkColor ($Label_Routerk3, $Color_black) ;~ BüroPc10 Global $Label_BOFk3 = GUICtrlCreateLabel("", 170,110,8,8) GUICtrlSetBkColor ($Label_BOFk3, $Color_black) ;~ Drucker50 Global $Label_Druckerk3 = GUICtrlCreateLabel("", 170,120,8,8) GUICtrlSetBkColor ($Label_Druckerk3, $Color_black) ;~ Kasse1 Global $Label_Kasse1k3 = GUICtrlCreateLabel("", 230,108,5,5) GUICtrlSetBkColor ($Label_Kasse1k3, $Color_black) ;~ Kasse2 Global $Label_Kasse2k3 = GUICtrlCreateLabel("", 230,118,5,5) GUICtrlSetBkColor ($Label_Kasse2k3, $Color_black) ;~ Kasse3 Global $Label_Kasse3k3 = GUICtrlCreateLabel("", 230,128,5,5) GUICtrlSetBkColor ($Label_Kasse3k3, $Color_black) ;~ Switch140 Global $Label_Switchk4 = GUICtrlCreateLabel("", 120,150,8,8) GUICtrlSetBkColor ($Label_Switchk4, $Color_black) ;~ Router01 Global $Label_Routerk4 = GUICtrlCreateLabel ("", 120,160,8,8) GUICtrlSetBkColor ($Label_Routerk4, $Color_black) ;~ BüroPc10 Global $Label_BOFk4 = GUICtrlCreateLabel("", 170,150,8,8) GUICtrlSetBkColor ($Label_BOFk4, $Color_black) ;~ Drucker50 Global $Label_Druckerk4 = GUICtrlCreateLabel("", 170,160,8,8) GUICtrlSetBkColor ($Label_Druckerk4, $Color_black) ;~ Kasse1 Global $Label_Kasse1k4 = GUICtrlCreateLabel("", 230,148,5,5) GUICtrlSetBkColor ($Label_Kasse1k4, $Color_black) ;~ Kasse2 Global $Label_Kasse2k4 = GUICtrlCreateLabel("", 230,158,5,5) GUICtrlSetBkColor ($Label_Kasse2k4, $Color_black) ;~ Kasse3 Global $Label_Kasse3k4 = GUICtrlCreateLabel("", 230,168,5,5) GUICtrlSetBkColor ($Label_Kasse3k4, $Color_black) GUISetState(@SW_SHOW, $shGui) While 1 Switch GUIGetMsg() case $GUI_EVENT_CLOSE ExitLoop Case $idButton_Ping1 _ping($idInput_Notepad1) Case $idButton_Ping2 _ping($idInput_Notepad2) Case $idButton_Ping3 _ping($idInput_Notepad3) Case $idButton_Ping4 _ping($idInput_Notepad4) Case $idButton_Close _close() EndSwitch if StringLen(GUICtrlRead($idInput_Notepad1)) = 4 then _ping($idInput_Notepad1) if StringLen(GUICtrlRead($idInput_Notepad2)) = 4 then _ping($idInput_Notepad2) if StringLen(GUICtrlRead($idInput_Notepad3)) = 4 then _ping($idInput_Notepad3) if StringLen(GUICtrlRead($idInput_Notepad4)) = 4 then _ping($idInput_Notepad4) WEnd Func _ping($idButton) Local $read1 = GUICtrlRead($idButton) If Ping(StringFormat("10.%.2d.%.1d.140",StringLeft($read1,2), StringRight($read1,2)), 1000) Then GUICtrlSetBkColor($Label_Switchk1, $Color_green) Else GUICtrlSetBkColor($Label_Switchk1, $Color_red) EndIf If Ping(StringFormat("10.%.2d.%.1d.10" ,StringLeft($read1,2), StringRight($read1,2)), 1000) Then GUICtrlSetBkColor($Label_BOFk1, $Color_green) Else GUICtrlSetBkColor($Label_BOFk1, $Color_red) EndIf If Ping(StringFormat("10.%.2d.%.1d.11" ,StringLeft($read1,2), StringRight($read1,2)), 1000) Then GUICtrlSetBkColor($Label_Kasse1k1, $Color_green) Else GUICtrlSetBkColor($Label_Kasse1k1, $Color_red) EndIf If Ping(StringFormat("10.%.2d.%.1d.12" ,StringLeft($read1,2), StringRight($read1,2)), 1000) Then GUICtrlSetBkColor($Label_Kasse2k1, $Color_green) Else GUICtrlSetBkColor($Label_Kasse2k1, $Color_red) EndIf If Ping(StringFormat("10.%.2d.%.1d.13" ,StringLeft($read1,2), StringRight($read1,2)), 1000) Then GUICtrlSetBkColor($Label_Kasse3k1, $Color_green) Else GUICtrlSetBkColor($Label_Kasse3k1, $Color_red) EndIf If Ping(StringFormat("10.%.2d.%.1d.1" ,StringLeft($read1,2), StringRight($read1,2)), 1000) Then GUICtrlSetBkColor($Label_Routerk1, $Color_green) Else GUICtrlSetBkColor($Label_Routerk1, $Color_red) EndIf If Ping(StringFormat("10.%.2d.%.1d.50" ,StringLeft($read1,2), StringRight($read1,2)), 1000) Then GUICtrlSetBkColor($Label_Druckerk1, $Color_green) Else GUICtrlSetBkColor($Label_Druckerk1, $Color_red) EndIf GUICtrlSetData($idButton, '') EndFunc func _close() Exit EndFunc -
Falls es dir das ganze leichter macht, hier ein Beispiel wie ich dies (für 4 IP's) umsetzen würde (nicht komplett optimiert, da ich es zumindest ein wenig verständlich halten wollte).
Achtung: Anzahl der Eingabefelder = Anzahl der späteren IP's = Anzahl der Punkte
AutoIt
Alles anzeigenOpt('MustDeclareVars', 1) #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <Array.au3> #include <WinAPI.au3> ;GUI globals Global $aIP_Input[5], $aIP_Sign[5], $hStart, $hGUI Global Const $cRed = 0xff0000, $cGreen = 0x00ff00 _Create_MAIN_GUI() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hStart If not _Ping() then MsgBox(1, 'Error', 'Check entered data.') EndSwitch WEnd Func _Ping() Local $aIP[$aIP_Input[0] + 1] ;Get the IP's into array $aIP[0] = $aIP_Input[0] For $Input = 1 to $aIP_Input[0] $aIP[$Input] = GUICtrlRead($aIP_Input[$Input]) & '1' If (StringSplit($aIP[$Input], '.')[0] - 1) <> 3 then Return False Next ;Ping the IP's For $Destination = 1 to $aIP[0] Consolewrite('Ping ' & $aIP[$Destination] & @CRLF) Consolewrite($aIP_Sign[1] & ' : ' & $aIP_Sign[$Destination]) If Ping($aIP[$Destination], 1000) Then Consolewrite('Reached' & @CRLF) GUICtrlSetGraphic($aIP_Sign[$Destination], $GUI_GR_COLOR, $cGreen, $cGreen) GUICtrlSetGraphic($aIP_Sign[$Destination], $GUI_GR_ELLIPSE, 0, 0, 20,20) Else Consolewrite('Failed' & @CRLF) GUICtrlSetGraphic($aIP_Sign[$Destination], $GUI_GR_COLOR, $cRed, $cRed) GUICtrlSetGraphic($aIP_Sign[$Destination], $GUI_GR_ELLIPSE, 0, 0, 20,20) EndIf Next ConsoleWrite('Finished ping' & @CRLF) _WinAPI_RedrawWindow($hGUI) Return True EndFunc Func _Create_MAIN_GUI() $hGUI = GUICreate("Example", 400, 400) $hStart = GUICtrlCreateButton("Start", 310, 370, 85, 25) $aIP_Input[0] = 4 $aIP_Input[1] = GUICtrlCreateInput('', 5, 5, 100, 20);default data only for testing $aIP_Input[2] = GUICtrlCreateInput('', 5, 30, 100, 20) $aIP_Input[3] = GUICtrlCreateInput('', 5, 55, 100, 20) $aIP_Input[4] = GUICtrlCreateInput('', 5, 80, 100, 20) $aIP_Sign[0] = $aIP_Input[0] $aIP_Sign[1] = GUICtrlCreateGraphic(110, 5, 20, 20) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $cRed, $cRed) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 0, 20,20) $aIP_Sign[2] = GUICtrlCreateGraphic(110, 30, 20, 20) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $cRed, $cRed) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 0, 20,20) $aIP_Sign[3] = GUICtrlCreateGraphic(110, 55, 20, 20) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $cRed, $cRed) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 0, 20,20) $aIP_Sign[4] = GUICtrlCreateGraphic(110, 80, 20, 20) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $cRed, $cRed) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 0, 20,20) GUISetState(@SW_SHOW, $hGUI) EndFuncIm Test lief dies ziemlich fix.
-
Leider doch, es sind 6 Geräte die angepingt werden müssen. Ich hab 4 Inputs das heißt : 4 eingebbare Inputs mit jeweils 6 Geräte die angepinnt werden. Ich werde mein Code reinschicken, müsste aber etwas umändern, weil ich die Informationen die drin stehen nicht preisgeben darf.
Ouch, ich wittere Optimierungsbedarf

-
Ich hoffe deine 500 Zeilen sind nicht nur für das oben beschriebene "Problem".
Aber ohne Code, ist Hilfe nahezu unmöglich.

-
Dazu gibt es zwei Möglichkeiten:
- Du packst deinen Text via ClipPut() in die Zwischenablage und dann kannst du es per Paste (Strg+V) selber einfügen
- Du suchst dir, wie Bananajoe bereits vorgeschlagen hat, die ControlID etc. mittels Au3Info und schickst den Text direkt an das gewünschte Eingabefeld.
-
WhiteHorse : Ich denke die Displaygröße ist eher eine Frage des Geldes und des Komforts. Generell finde ich einen größeren Bildschirm angenehmer, muss aber halt auch "geschleppt" und bezahlt werden.
Beispiel: Lenovo IdeaPad bekommst du schon ab 400€ (10,5"), ein Xiamoi ab ~700€ (12,4") und bei 13 Zoll startest du schon bei knapp 1000€ (Lenovo Yoga). Die Surface sind dann nochmal gut 20-30% teurer.