Vielen Dank
Beiträge von Jonathan
-
-
Hat den keiner ne Idee, oder kann mir sagen, wieso sich das nicht aktualisiert?












-
Das habe ich ja, ich habe alles leer deklariert und die Liste sogar gelöscht und neu erstellt. aber es läuft trotzdem leider nicht
*siehe unten*Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit][/autoit]
GUICtrlDelete($liste) ; Liste wird gelöscht
_FTPClose($connection)
_FTPUnInit()
$open = "";----------|
$connection = "";---------|Hier wird alles leerdeklariert
$filelist = "";---------|
$i = "";----------------|
$open = _FTPOpen("dateishare");wie du auch sagtest
$connection = _FTPConnect($open,$serveradresse,$username,$passwort)
$filelist = _FTPFilesListTo2DArray ($connection);files "theoretisch" neu auslesen
$liste = GUICtrlCreateList("",20,30,200,450); die liste wird neu gemacht
For $i = 1 to UBound ($filelist) -1
GUICtrlSetData ($liste, $filelist [$i][0]&"|")
Next -
Würde nciht auch einfach zweimal case $Button1 gehen
bin mir da nicht sicher!
also so:Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button1
$aktion1 = "tue dies"
case $Button1
$aktion2 = "tue was anderes"EndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]
WEnd
Wie gesagt, bin mir nciht sicher! aber warum machst du es nciht gleich so:Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button1
GUICtrlSetData($2, @HOUR & ":" & @MIN & ":" & @SEC)
GUICtrlSetData($1, @MDAY & "." & @MON & "." & @YEAR)EndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit]
WEnd
Oder habe ich das total falsch verstanden, und bin auf dem totalen Holzweg?
-
hallo, Ich habe auf dem Gerüst von PokerFace einen mini FTP Client gemacht, um etwas mit der FTP_Ex zu üben, und weil mir Langweilig war
nun will aber die Refresh Funktion nicht so wirklich das machen, was Sie soll, und ich kann und kann den Fehler nicht finden
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#RequireAdmin
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <FTP_Ex.au3>$serveradresse = "##########"
[/autoit] [autoit][/autoit] [autoit]
$username = "##########"
$passwort = "##########"$open = _FTPOpen("dateishare")
[/autoit] [autoit][/autoit] [autoit]
$connection = _FTPConnect($open,$serveradresse,$username,$passwort)
$filelist = _FTPFilesListTo2DArray ($connection);GUI CODE STARTET HIER;
[/autoit] [autoit][/autoit] [autoit]
$Gui = GUICreate("Dateishare",310,500)
$header = GUICtrlCreateLabel("Datei auswählen",65,10)
$liste = GUICtrlCreateList("",20,30,200,450)
$downloadbutton = GUICtrlCreateButton("Download",235,30,55,50)
$uploadbutton = GUICtrlCreateButton("Upload",235,100,55,50)
$filedel = GUICtrlCreateButton("Delete",235,170,55,50)
$refresh = GUICtrlCreateButton("Refresh",235,240,55,50)
$rename = GUICtrlCreateButton("Rename",235,310,55,50)For $i = 1 to UBound ($filelist) -1
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetData ($liste, $filelist [$i][0]&"|")
NextGUISetState(@SW_SHOW)
[/autoit] [autoit][/autoit] [autoit]
;GUI CODE ENDET HIER;while 1
[/autoit] [autoit][/autoit] [autoit]
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
_FTPClose($connection)
_FTPUnInit()
Exit
Case $DownloadButton
$DownFile = GUICtrlRead ($liste)
If $DownFile = "" Then
MsgBox (16, "STOP", "Du musst erst eine Datei auswählen")
Else
DirCreate (@ScriptDir&"\Download")
_FTP_DownloadProgress($connection, @ScriptDir&"\Download\"&$DownFile, "/"&$DownFile)
EndIf
Case $uploadbutton
$UploadPfad = FileOpenDialog("Auswählen",@ScriptDir,"Alle (*.*)")
If $UploadPfad = "" Then
MsgBox (0, "Achtung!", "Erst eine Datei auswählen!")
Else
$dateinamensplit = StringSplit($UploadPfad,"\")
$teile = $dateinamensplit[0]
Global $UploadVorgang = _FTP_UploadProgress($connection, $UploadPfad, "/"&$dateinamensplit[$teile])
If $UploadVorgang = 1 Then
MsgBox (64, "Okay", "hochladen erfolgreich")
Else
MsgBox (16, "Error", "Aufgrund eines Fehlers wird das Programm beendet!")
Exit
EndIf
EndIfCase $filedel
[/autoit] [autoit][/autoit] [autoit]
$s_RemoteFile = GUICtrlRead($liste)
_FTPDelFile($connection, $s_RemoteFile)
MsgBox(64,"ok","Ok, Die Datei wurde erfolgreich gelöscht")Case $refresh
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
GUICtrlDelete($liste)
_FTPClose($connection)
_FTPUnInit()
$open = ""
$connection = ""
$filelist = ""
$i = ""
$open = _FTPOpen("Homeworker by Alex")
$connection = _FTPConnect($open,$serveradresse,$username,$passwort)
$filelist = _FTPFilesListTo2DArray ($connection)
$liste = GUICtrlCreateList("",20,30,200,450)
For $i = 1 to UBound ($filelist) -1
GUICtrlSetData ($liste, $filelist [$i][0]&"|")
NextCase $rename
[/autoit] [autoit][/autoit] [autoit]
$s_Existing = GUICtrlRead($liste)
$s_New = InputBox("Rename","in welchen Namen soll die Datei umbenannt werden?",$s_Existing)
if Not @error then
_FTPRenameFile($connection, $s_Existing, $s_New)
MsgBox(0,"ok","Die Datei wurde umbeannt")
Else
MsgBox(64,"oioi","Aktion abgebrochen!")
EndIfEndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit]
WEnd
Falls sie jemand nciht hat, habe ich die FTP_Ex.au3 angehängt -
-
Hi, Ich wolltemir *zum üben* einen kleinen FTP Client machen, und habe mir als Vorlage den von PokerFace ins Auge gefasst.
FTP Dateiablage (FTP Client)
Allerdings kann man dort keinen unterordner öffnen, weil er Die Dateien mit GUICtrlCreateList anzeigt. Wie kann ich es so machen, das ich auch Unterordner öffnen kann? -
Hallo, Ich habe mal mit DjDominik einen Radiostreamer geschreiben. kannste dir ja mal ansehen
Die adressen sind in der sender.urls gespeichert, kannst sie einfach mit einem editor öffnen und neue hinzufügen.
Vielleicht hilft es dir
-
habe das schon vor längerer zeit mal ins auge gefasst, will aber nciht mitmachen, weil ich weder zeit habe noch die Aufgaben richtig verstehe

-
Hi,
auf der anderen Seite ist AutoIt auch eine Scriptsprache und das soll ja eigentlich heissen ... schnelle und wiederkerende Prozesse ausführen.
Für komplexere Sachen bietet sich eigentlich C++ an, da es schneller ist wie Autoit.
Ich kann aber kein C++ un deshalb nutze ich auch für alles AutoIt.
MfG
Der_DocWürde mcih ja schon reizen C++ oder C# oder etwas in der Richtung zu lernen. habe aber leider ncoh kein Forum wie dieses(Aktiv + Deutsch) dafür gefunden.

-
hm, das hatte ich auch im Kopf, hatte aber gehofft, das das auch anders geht. :wacko:
-
Hallo, Ich habe einen Quadcore von Intel, und ich finde es Schade, das AutoIT nur einen der 4 Kerne nutzt. Kann Ich AutoIT irgendwie "überreden" Alle Kerne zu nutzen?

-
Find ich cool. Ich kenne das bereits als Schaf, wo über den Bildschirm läuft. vielleicht als tipp: Das der Teddy auch auf Fenstern läuft, die nciht im Vordergrund sind.
Find ich trotzdem Cool! -
Wenn ich dich richtig verstehe suchst du so etwas:
[autoit]
[/autoit]
$date = @MON & @MDAY
Kannst das ja dann in ein Label oder so reinschreiben -
Ich wollte mail il.de haben. aber nur wegen der email adresse. weil dann hätte ich mir e-m@il.de eingerichtet. aber da gabs das ncoh nciht:(
-
habe hier mal ein komplettes Script^^ der sleep ist zur Prozessorentlastung
[autoit]
[/autoit]
while 1
if PixelGetColor(70, 10) = 0xFFC100 then beep(500,1000)
sleep(20)
wend
ungetestet -
wäre eventuel besser, das script in einen spoiler zu setzten.

-
hallo,
kann man mit AutoIT Laufwerksbuchstaben ändern?mfg. Jonathan
-
Hallo, endlich ist das Script für die Schule fertig. habt ihr verbesserungsvorschläge, und was haltet ihr von dem script? Angehängt sind benötigte zusatzdateien für das Lehrer prog.
führ lehrer:Spoiler anzeigen
[autoit],
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
;~ Includes
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3> ;<- Für Combolist
#include <inet.au3> ;<- zum prüfen ob PChostname die endung le hat
#include <Misc.au3> ;<- zum prüfen, ob Programm bereits läüft
;testen, ob Programm bereits läuft.Wenn ja: Hinweis darauf und beenden
If _Singleton("Skript", 1) = 0 Then
MsgBox(64, "MasterControl", "MasterControl läuft bereits", 5)
Exit
EndIf
; teste, ob Programm auf Lehrer PC ausgeführt wird. Wenn nicht: Meldung + Beenden
TCPStartup()
$hostname = _TCPIpToName(@IPAddress1)
$hostnametest = StringSplit($hostname, "-")If $hostnametest[0] = 3 Then ;wenn im hostname 3 - vorhanden sind dann
[/autoit] [autoit][/autoit] [autoit]If $hostnametest[3] <> "le" Then
[/autoit] [autoit][/autoit] [autoit]
MsgBox(64, "MasterControl", "Dieses Programm darf nur auf Lehrerrechnern ausgeführt werden")
Exit
EndIf
If $hostnametest[3] <> "LE" Then
MsgBox(64, "MasterControl", "Dieses Programm darf nur auf Lehrerrechnern ausgeführt werden")
Exit
EndIf
Else ; wenn im hostname keine 2 - vorhanden sind
MsgBox(64, "MasterControl", "Dieses Programm sollte auf einem Lehrerrechner der Schule ausgeführt werden")
EndIfTCPShutdown()
[/autoit] [autoit][/autoit] [autoit]
$pcsinraum = IniRead(@ScriptDir & "\einstellungen.ini", "infos", "pcs", "0")
$raumnummer = IniRead(@ScriptDir & "\einstellungen.ini", "infos", "raum", "0")
;~ Hier startet der GUI-Code
$Gui = GUICreate("MasterControl 1.0 BETA", 350, 320); <-- Erstelle die GUI
GUICtrlCreateLabel("Auswahl der PCs", 10, 20)
; checkboxen zum PCs auswählen
Dim $pc[$pcsinraum + 1]
Dim $pcip[$pcsinraum + 1]
Dim $verbindung[$pcsinraum + 1]
Dim $datenpcfenster[$pcsinraum + 1]For $i = 1 To $pcsinraum
[/autoit] [autoit][/autoit] [autoit]
$pc[$i] = GUICtrlCreateCheckbox($i, 10 + ((($i > 10) + ($i > 20)) * 40), 30 + ($i - (($i > (($i > 20) + 1) * 10) * (($i > 20) + 1) * 10)) * 20)
Next$prozentproschritt = 100 / $pcsinraum
[/autoit] [autoit][/autoit] [autoit]GUISetState(@SW_SHOW)
[/autoit] [autoit][/autoit] [autoit];copyright
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateLabel("© Copyright Alexander Imka", 120, 295);Icon setzten
[/autoit] [autoit][/autoit] [autoit]
If FileExists(@ScriptDir & "\icon.ico") Then
GUISetIcon(@ScriptDir & "\icon.ico")
Else
MsgBox(48, "Icon fehlt", "Das Icon wurde nicht gefunden. Das Programm wird ohne das Icon weiter ausgeführt!")
EndIf;trennlinie
[/autoit] [autoit][/autoit] [autoit]
If $pcsinraum < 21 Then GUICtrlCreatePic("linie.jpg", 100, 5, 2, 310)
$Buttonuebernehmen = GUICtrlCreateButton("Übernehmen", 5, 295, 90, 25, $WS_GROUP)
$Buttonalle = GUICtrlCreateButton("alle", 55, 265, 40, 25, $WS_GROUP)
$buttonkeinen = GUICtrlCreateButton("keinen", 5, 265, 40, 25, $WS_GROUP);Combolist
[/autoit] [autoit][/autoit] [autoit]
$combo = GUICtrlCreateCombo("", 120, 10, 145, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Reboot|Sperren|Fenster|MsgBox")
$combobutton = GUICtrlCreateButton("wechseln", 270, 10, 65, 20, $WS_GROUP)
; --- --- --- --- Funktionenen --- --- --- ---
;Reboot
$neustart = GUICtrlCreateButton("Neustarten", 120, 100, 100, 50, $WS_GROUP)
$herunterfahren = GUICtrlCreateButton("Herunterfahren", 120, 150, 100, 50, $WS_GROUP)
$abmelden = GUICtrlCreateButton("Abmelden", 230, 100, 100, 50, $WS_GROUP)
$standby = GUICtrlCreateButton("Standby", 230, 150, 100, 50, $WS_GROUP)
GUICtrlSetState($neustart, $GUI_HIDE)
GUICtrlSetState($herunterfahren, $GUI_HIDE)
GUICtrlSetState($abmelden, $GUI_HIDE)
GUICtrlSetState($standby, $GUI_HIDE);MsgBox
[/autoit] [autoit][/autoit] [autoit]
$msgboxicon1 = GUICtrlCreateIcon("shell32.dll", 263, 120, 70)
$msgboxicon2 = GUICtrlCreateIcon("shell32.dll", 240, 170, 70)
GUICtrlSetState($msgboxicon1, $GUI_HIDE)
GUICtrlSetState($msgboxicon2, $GUI_HIDE)$msgboxlabel1 = GUICtrlCreateLabel("1", 151, 72)
[/autoit] [autoit][/autoit] [autoit]
$msgboxlabel2 = GUICtrlCreateLabel("2", 210, 72)
$msgboxlabel3 = GUICtrlCreateLabel("Icon wählen:", 120, 40)
$msgboxlabel4 = GUICtrlCreateLabel("Text eingeben:", 120, 120)
GUICtrlSetState($msgboxlabel1, $GUI_HIDE)
GUICtrlSetState($msgboxlabel2, $GUI_HIDE)
GUICtrlSetState($msgboxlabel3, $GUI_HIDE)
GUICtrlSetState($msgboxlabel4, $GUI_HIDE)$msgboxinhalt = GUICtrlCreateInput("", 112, 150, 228)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($msgboxinhalt, $GUI_HIDE)$iconwahl1 = GUICtrlCreateRadio("Icon1", 230, 70)
[/autoit] [autoit][/autoit] [autoit]
$iconwahl2 = GUICtrlCreateRadio("Icon2", 230, 90)
GUICtrlSetState($iconwahl1, $GUI_HIDE)
GUICtrlSetState($iconwahl2, $GUI_HIDE)$msgboxsenden = GUICtrlCreateButton("Senden", 174, 200, 100, 50)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($msgboxsenden, $GUI_HIDE)For $i = 1 To $pcsinraum
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$pcip[$i] = "10.20.0.254"
Next;hostnames zu ips
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
If $hostnametest[0] = 3 Then
ProgressOn("IP ermitteln", "Die IP's werden ermittelt")
TCPStartup()For $i = 1 To $pcsinraum
[/autoit] [autoit][/autoit] [autoit]
$r = StringFormat("_%02u%", $i)
ProgressSet($prozentproschritt * $i, "Rechner " & $i & " / " & $pcsinraum, "Die IP's werden ermittelt")
If Ping("wks-" & $raumnummer & "-" & $r, 50) Then $pcip[$i] = TCPNameToIP("wks-" & $raumnummer & "-" & $r)Next
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]TCPShutdown()
[/autoit] [autoit][/autoit] [autoit]
ProgressOff()
EndIf;sperren
[/autoit] [autoit][/autoit] [autoit]
$sperreneingabe = GUICtrlCreateButton("Eingabe sperren", 120, 100, 100, 50, $WS_GROUP)
$sperrenbildschirm = GUICtrlCreateButton("Bildschirm sperren", 120, 150, 100, 50, $WS_GROUP)
$entsperreneingabe = GUICtrlCreateButton("Eingabe freigeben", 230, 100, 100, 50, $WS_GROUP)
$entsperrenbildschirm = GUICtrlCreateButton("Bildschirm freigeben", 230, 150, 100, 50, $WS_GROUP)
GUICtrlSetState($sperreneingabe, $GUI_HIDE)
GUICtrlSetState($sperrenbildschirm, $GUI_HIDE)
GUICtrlSetState($entsperreneingabe, $GUI_HIDE)
GUICtrlSetState($entsperrenbildschirm, $GUI_HIDE); Fenster
[/autoit] [autoit][/autoit] [autoit]$aktualisieren = GUICtrlCreateButton("Aktualisieren", 120, 35, 230, 20, $WS_GROUP)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($aktualisieren, $GUI_HIDE); --- --- --- ---Ende Funktionen --- --- --- ---
[/autoit] [autoit][/autoit] [autoit];starticon
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$starticon = GUICtrlCreateIcon("shell32.dll", 19, 200, 150);starticon
GUISetState($starticon, $GUI_HIDE)UDPStartup()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]While 1 ; <-- Endlosschleife anfangen
[/autoit] [autoit][/autoit] [autoit]$nMsg = GUIGetMsg(); <-- Fange die Button-Events ab
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Switch $nMsg ;<-- Unterscheide die Events
Case $GUI_EVENT_CLOSE ; <-- Wenn GUI geschlossen wird dann
UDPShutdown()
Exit ; <-- Skript beendenCase $Buttonuebernehmen
[/autoit] [autoit][/autoit] [autoit]
ProgressOn("Bitte warten...", "Verbindungen werden hergestellt")For $i = 1 To $pcsinraum
[/autoit] [autoit][/autoit] [autoit]If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
[/autoit] [autoit][/autoit] [autoit]
If Ping($pcip[$i]) Then
$verbindung[$i] = UDPBind($pcip[$i], 2000)
Else
ToolTip("PC " & $i & " ist nicht erreichbar")
Sleep(1000)
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
EndIf
EndIf
ProgressSet($prozentproschritt * $i, $i & "/" & $pcsinraum)Sleep(200)
[/autoit] [autoit][/autoit] [autoit]
NextToolTip("")
[/autoit] [autoit][/autoit] [autoit]
ProgressOff()Case $Buttonalle
[/autoit] [autoit][/autoit] [autoit]
For $i = 1 To $pcsinraum
GUICtrlSetState($pc[$i], $GUI_CHECKED)
Next
Case $buttonkeinen
For $i = 1 To $pcsinraum
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
Next
Case $combobuttonIf GUICtrlRead($combo) = "Reboot" Then
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($neustart, $GUI_SHOW)
GUICtrlSetState($herunterfahren, $GUI_SHOW)
GUICtrlSetState($abmelden, $GUI_SHOW)
GUICtrlSetState($standby, $GUI_SHOW)Else
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($neustart, $GUI_HIDE)
GUICtrlSetState($herunterfahren, $GUI_HIDE)
GUICtrlSetState($abmelden, $GUI_HIDE)
GUICtrlSetState($standby, $GUI_HIDE)EndIf
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
If GUICtrlRead($combo) = "" Then
GUICtrlSetState($starticon, $GUI_SHOW)
Else
GUICtrlSetState($starticon, $GUI_HIDE)EndIf
[/autoit] [autoit][/autoit] [autoit]If GUICtrlRead($combo) = "MsgBox" Then
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($msgboxicon1, $GUI_SHOW)
GUICtrlSetState($msgboxicon2, $GUI_SHOW)
GUICtrlSetState($msgboxlabel1, $GUI_SHOW)
GUICtrlSetState($msgboxlabel2, $GUI_SHOW)
GUICtrlSetState($iconwahl1, $GUI_SHOW)
GUICtrlSetState($iconwahl2, $GUI_SHOW)
GUICtrlSetState($msgboxlabel3, $GUI_SHOW)
GUICtrlSetState($msgboxlabel4, $GUI_SHOW)
GUICtrlSetState($msgboxinhalt, $GUI_SHOW)
GUICtrlSetState($msgboxsenden, $GUI_SHOW)Else
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($msgboxicon1, $GUI_HIDE)
GUICtrlSetState($msgboxicon2, $GUI_HIDE)
GUICtrlSetState($msgboxlabel1, $GUI_HIDE)
GUICtrlSetState($msgboxlabel2, $GUI_HIDE)
GUICtrlSetState($iconwahl1, $GUI_HIDE)
GUICtrlSetState($iconwahl2, $GUI_HIDE)
GUICtrlSetState($msgboxlabel3, $GUI_HIDE)
GUICtrlSetState($msgboxlabel4, $GUI_HIDE)
GUICtrlSetState($msgboxinhalt, $GUI_HIDE)
GUICtrlSetState($msgboxsenden, $GUI_HIDE)EndIf
[/autoit] [autoit][/autoit] [autoit]If GUICtrlRead($combo) = "Sperren" Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($sperreneingabe, $GUI_SHOW)
GUICtrlSetState($sperrenbildschirm, $GUI_SHOW)
GUICtrlSetState($entsperreneingabe, $GUI_SHOW)
GUICtrlSetState($entsperrenbildschirm, $GUI_SHOW)
Else
GUICtrlSetState($sperreneingabe, $GUI_HIDE)
GUICtrlSetState($sperrenbildschirm, $GUI_HIDE)
GUICtrlSetState($entsperreneingabe, $GUI_HIDE)
GUICtrlSetState($entsperrenbildschirm, $GUI_HIDE)EndIf
[/autoit] [autoit][/autoit] [autoit]If GUICtrlRead($combo) = "Fenster" Then
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetState($aktualisieren, $GUI_SHOW)
Else
GUICtrlSetState($aktualisieren, $GUI_HIDE)EndIf
[/autoit] [autoit][/autoit] [autoit]
;;; Winlist ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case $aktualisieren
$standartheight = 50
ProgressOn("Bitte warten...", "Infos werden abgerufen")
For $i = 1 To $pcsinraum
If Ping($pcip[$i]) Then
If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
UDPSend($verbindung[$i], "ip#" & @IPAddress1)
Sleep(50)
UDPSend($verbindung[$i], "fensteranfrage")
While 1
$datenpcfenster[$i] = UDPRecv($verbindung[$i], 50000)
If $datenpcfenster[$i] <> "" Then ExitLoop
ToolTip("warte auf PC " & $i)
WEnd
ToolTip("")
$pcfenster1 = StringSplit($datenpcfenster[$i], "#")
For $x = 2 To $pcfenster1[0]
GUICtrlCreateLabel($pcfenster1, 120, $standartheight)
$standartheight += 10
Next
EndIf
EndIf
ProgressSet($prozentproschritt * $i, "")
NextProgressOff()
[/autoit] [autoit][/autoit] [autoit]
;;; Reboot ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case $neustart
ProgressOn("bitte warten...", "Aktion wird ausgeführt")
For $i = 1 To $pcsinraum
If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
If Ping($pcip[$i]) Then
UDPSend($verbindung[$i], "neustart")
ProgressSet($prozentproschritt * $i, "")
Else
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
EndIf
EndIf
Next
ProgressOff()
Case $abmelden
ProgressOn("bitte warten...", "Aktion wird ausgeführt")
For $i = 1 To $pcsinraum
If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
If Ping($pcip[$i]) Then
UDPSend($verbindung[$i], "abmelden")
ProgressSet($prozentproschritt * $i, "")
Else
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
EndIf
EndIf
Next
ProgressOff()
Case $herunterfahren
ProgressOn("bitte warten...", "Aktion wird ausgeführt")
For $i = 1 To $pcsinraum
If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
If Ping($pcip[$i]) Then
UDPSend($verbindung[$i], "herunterfahren")
ProgressSet($prozentproschritt * $i, "")
Else
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
EndIf
EndIf
Next
ProgressOff()
Case $standby
ProgressOn("bitte warten...", "Aktion wird ausgeführt")
For $i = 1 To $pcsinraum
If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
If Ping($pcip[$i]) Then
UDPSend($verbindung[$i], "standby")
ProgressSet($prozentproschritt * $i, "")
Else
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
EndIf
EndIf
Next
ProgressOff();;;sperren;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[/autoit] [autoit][/autoit] [autoit]Case $sperreneingabe
[/autoit] [autoit][/autoit] [autoit]
ProgressOn("bitte warten...", "Aktion wird ausgeführt")
For $i = 1 To $pcsinraum
If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
If Ping($pcip[$i]) Then
UDPSend($verbindung[$i], "sperreneingabe")
ProgressSet($prozentproschritt * $i, "")
Else
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
EndIf
EndIf
Next
ProgressOff()Case $sperrenbildschirm
[/autoit] [autoit][/autoit] [autoit]
ProgressOn("bitte warten...", "Aktion wird ausgeführt")
For $i = 1 To $pcsinraum
If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
If Ping($pcip[$i]) Then
UDPSend($verbindung[$i], "sperrenbildschirm")
ProgressSet($prozentproschritt * $i, "")
Else
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
EndIf
EndIf
Next
ProgressOff()Case $entsperreneingabe
[/autoit] [autoit][/autoit] [autoit]
ProgressOn("bitte warten...", "Aktion wird ausgeführt")
For $i = 1 To $pcsinraum
If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
If Ping($pcip[$i]) Then
UDPSend($verbindung[$i], "entsperreneingabe")
ProgressSet($prozentproschritt * $i, "")
Else
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
EndIf
EndIf
Next
ProgressOff()Case $entsperrenbildschirm
[/autoit] [autoit][/autoit] [autoit]
ProgressOn("bitte warten...", "Aktion wird ausgeführt")
For $i = 1 To $pcsinraum
If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
If Ping($pcip[$i]) Then
UDPSend($verbindung[$i], "entsperrenbildschirm")
ProgressSet($prozentproschritt * $i, "")
Else
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
EndIf
EndIf
Next
ProgressOff();;;MsgBox;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[/autoit] [autoit][/autoit] [autoit]Case $msgboxsenden
[/autoit] [autoit][/autoit] [autoit]
If $msgboxinhalt <> "" Then
ProgressOn("bitte warten...", "Aktion wird ausgeführt")
For $i = 1 To $pcsinraum
If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
If Ping($pcip[$i]) Then
If $iconwahl1 = $GUI_CHECKED Then
$icon = 64
Else
If $iconwahl2 = $GUI_CHECKED Then
$icon = 16
Else
$icon = 0
EndIf
EndIfUDPSend($verbindung[$i], "msgbox#" & $icon & "#" & $msgboxinhalt)
[/autoit] [autoit][/autoit] [autoit]
ProgressSet($prozentproschritt * $i, "")
Else
GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
EndIf
EndIf
Next
ProgressOff()
Else
MsgBox(48, "", "Bitte Text eingeben")
EndIf
EndSwitchWEnd ; <-- Beginne Schleife von Vorne;### Tidy Error -> while is never closed in your script.
[/autoit]
für Clients:Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
;feststellen des Scriptpfadt
$scriptpfad = @ScriptDir & "\" & @ScriptName;setzen der Testvariable
[/autoit] [autoit][/autoit] [autoit]
$regtest = 0; überprüfen ob Schlüssel besteht und gegebenenfalls schreiben
[/autoit] [autoit][/autoit] [autoit]
RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","MasterControl")
if not @error then $regtest = 1if $regtest = 0 Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","MasterControl","REG_SZ",$scriptpfad)
[/autoit] [autoit][/autoit] [autoit]
if @error Then MsgBox(48,"Fehler","Felher beim Schreiben in die Regitery");TCP und UDP Starten
[/autoit] [autoit][/autoit] [autoit]
UDPStartup;verbindungen zulassen
[/autoit] [autoit][/autoit] [autoit]
$lehrer = UDPBind(@IPAddress1,2000);infos über pc standort abfragen, um winlist an lehrer zu schiken
[/autoit] [autoit][/autoit] [autoit]
$lehrerip = "10.20.0.254"
;Schleife um auf befehle zu warten
while 1
Sleep(10)
$ankommenderbefehl = UDPRecv($lehrer,1000)
$befehl = StringSplit($ankommenderbefehl,"#")
if $befehl[0] = 3 Then MsgBox($befehl[2],"Merke auf:",$befehl[3])
if $befehl[0] = 2 Then $lehrerip = $befehl[2]
if $befehl[1] = "herunterfahren" Then Shutdown (17)
if $befehl[1] = "neustart" Then Shutdown(6)
if $befehl[1] = "abmelden" Then Shutdown(16)
if $befehl[1] = "standby" Then Shutdown(48)
if $befehl[1] = "sperreneingabe" Then $eingabesperren = 1
if $befehl[1] = "sperrenbildschirm" Then $bildschirmsperren = 1
if $befehl[1] = "entsperreneingabe" Then $eingabesperren = 0
if $befehl[1] = "entsperrenbildschirm" Then $bildschirmsperren = 0
if $befehl[1] = "fensteranfrage" ThenEndIf
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]
WEnd -
Ich halte das ganze sowieso für reine Panikmache. Das ist das selbe wie mit der Vogelgrippe.
Da kann ich nur zustimmen. da hieß es ja auch: seuche und so... Wer weiß, vielleicht singt Sweety ja bald einen Schweinegrippesong (war bei Vogelgrippe ja auch)