AutoIt Codeschnipsel
Active Windows Skype Status Changer

Ändert denn Skype Status auf "Aktives Fenster: " und dann denn Titel des aktiven Fensters
Txt Plugin

Führt au3 Dateien in txt Format aus
File Info [Compiled only with Parameter]

Erstellt ein kleines Info Fenster über eine Datei, funktioniert mit Parametern (Datei auf die ausführbare Datei ziehen)
Block

Blockiert Tastatur und Maus für 15 Sekunden (zum reinigen)
Files

Sucht in einem Ordner nach Bildern welche größer sind als die angegebene Auflösung
File Date rename [Compiled only with Parameter]

Über ein Fileopen Dialog oder DragAndDrop eine Datei umbennen in "FILENAME-YEAR-MONTH-DAY" nach dem Erstelldatum
Perfekt für Backup Sicherungen einer Datei! Wer den alten Dateinamen behalten will muss FileCopy anstelle von FileMove nutzen

Ändert denn Skype Status auf "Aktives Fenster: " und dann denn Titel des aktiven Fensters
Code:
#Include <Misc.au3>
Global $dll32 = DllOpen("user32.dll")
AdlibRegister("_hotkey", 250)
Global $aStatus
$oSkype = ObjCreate('Skype4COM.Skype')
$oSkypeEvent = ObjEvent($oSkype,'Skype_')
$oError = ObjEvent('AutoIt.Error','MyErrFunc')
If Not $oSkype.Client.IsRunning Then
$oSkype.Client.Start()
EndIf
While 1
Sleep(250)
If $oSkype.CurrentUserStatus = $oSkype.Convert.TextToUserStatus('ONLINE') Then
ExitLoop
Else
$oSkype.ChangeUserStatus($oSkype.Convert.TextToUserStatus('ONLINE'))
EndIf
WEnd
$oSkype.Attach()
;~ $oSkype.ChangeUserStatus($oSkype.Convert.TextToUserStatus('BUSY'))
While 1
$status = "Aktives Fenster: " & WinGetTitle("[ACTIVE]")
If $status = "Aktives Fenster: VLC Media Player" Then
$status = "Anime schauen"
$oSkype.ChangeUserStatus($oSkype.Convert.TextToUserStatus('BUSY'))
EndIf
If $status <> "Aktives Fenster: " Then $oSkype.SendCommand($oSkype.Command(0, 'SET PROFILE RICH_MOOD_TEXT ' & $status))
Sleep (1000)
WEnd
Func Skype_AttachmentStatus($aStatus)
TrayTip("Active Status", 'Attachment status ' & $oSkype.Convert.AttachmentStatusToText($aStatus), 5, 1)
If $aStatus = $oSkype.Convert.TextToAttachmentStatus('AVAILABLE') Then
$oSkype.Attach()
EndIf
EndFunc
Func MyErrFunc()
ConsoleWrite('Skype4COM Error !' & @CRLF)
EndFunc
Func _hotkey()
If _IsPressed("1B", $dll32) Then Exit
Sleep (100)
EndFunc
Txt Plugin

Führt au3 Dateien in txt Format aus
Code:
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponlyincludes
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <File.au3>
$pluginpath = @ScriptDir & "\plugins\"
ConsoleWrite("Starte Tool ..." & @CRLF)
$plugins = _FileListToArray($pluginpath, "*.txt", 1)
If IsArray($plugins) Then
ConsoleWrite($plugins[0] & " Plugins wurden gefunden!" & @CRLF)
For $i = 1 To $plugins[0]
Run(StringFormat('"%s" /AutoIt3ExecuteScript "%s"', @AutoItExe, $pluginpath & '\' & $plugins[$i]))
ConsoleWrite("Plugin " & StringReplace($plugins[$i], ".txt", "") & " wurde geladen!" & @CRLF)
Next
Else
ConsoleWrite("Keine Plugins gefunden!" & @CRLF)
EndIf
While 1
Sleep (100)
WEnd
File Info [Compiled only with Parameter]

Erstellt ein kleines Info Fenster über eine Datei, funktioniert mit Parametern (Datei auf die ausführbare Datei ziehen)
Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponlyincludes
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Crypt.au3>
Global Const $GUI_EVENT_CLOSE = -3
Global Const $ES_READONLY = 2048
If NOT @Compiled Or $CmdLine[1] = "" Then
$file = FileOpenDialog("File Info", @DesktopDir & "\", "Alle (*.*)", 1)
Else
$file = $CmdLine[1]
EndIf
Global $szDrive, $szDir, $szFName, $szExt
$iFile = FileOpen($file, 16)
$filename = _PathSplit($file, $szDrive, $szDir, $szFName, $szExt)
$date = FileGetTime($file, 1)
$date2 = FileGetTime($file, 0)
$md5 = _Crypt_HashFile($file, $CALG_MD5)
$md5 = StringReplace($md5, "0x", "")
$sha1 = _Crypt_HashFile($file, $CALG_SHA1)
$sha1 = StringReplace($sha1, "0x", "")
$size = Round((FileGetSize($file) / 1024)) & " Kilobyte"
$size2 = Round((FileGetSize($file) / 1048576), 2) & " Megabyte"
$bin = StringToBinary(FileRead($iFile,FileGetSize($file)))
FileClose($File)
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("[File Info]" & $filename[3] & $filename[4] & " - " & StringLower($md5), 449, 169, 349, 130)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
$Label1 = GUICtrlCreateLabel("Dateiname:", 8, 16, 58, 17)
$Input1 = GUICtrlCreateInput($filename[3] & $filename[4], 104, 13, 329, 21, $ES_READONLY)
$Label2 = GUICtrlCreateLabel("Erstellt am:", 8, 40, 55, 17)
$Input2 = GUICtrlCreateInput($date[3] & ":" & $date[4] & ":" & $date[5] & " " & $date[2] & "." & $date[1] & "." & $date[0], 104, 37, 329, 21, $ES_READONLY)
$Label2 = GUICtrlCreateLabel("Verändert am:", 8, 64, 55, 17)
$Input2 = GUICtrlCreateInput($date2[3] & ":" & $date2[4] & ":" & $date2[5] & " " & $date2[2] & "." & $date2[1] & "." & $date2[0], 104, 61, 329, 21, $ES_READONLY)
$Label2 = GUICtrlCreateLabel("Größe:", 8, 88, 55, 17)
$Input2 = GUICtrlCreateInput($size & " | " & $size2, 104, 85, 329, 21, $ES_READONLY)
$Label2 = GUICtrlCreateLabel("md5 hash:", 8, 112, 55, 17)
$Input2 = GUICtrlCreateInput(StringLower($md5), 104, 109, 329, 21, $ES_READONLY)
$Label2 = GUICtrlCreateLabel("sha1 hash:", 8, 136, 55, 17)
$Input2 = GUICtrlCreateInput(StringLower($sha1), 104, 133, 329, 21, $ES_READONLY)
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func _PathSplit($szPath, ByRef $szDrive, ByRef $szDir, ByRef $szFName, ByRef $szExt)
; Set local strings to null (We use local strings in case one of the arguments is the same variable)
Local $drive = ""
Local $dir = ""
Local $fname = ""
Local $ext = ""
Local $pos
; Create an array which will be filled and returned later
Local $array[5]
$array[0] = $szPath; $szPath can get destroyed, so it needs set now
; Get drive letter if present (Can be a UNC server)
If StringMid($szPath, 2, 1) = ":" Then
$drive = StringLeft($szPath, 2)
$szPath = StringTrimLeft($szPath, 2)
ElseIf StringLeft($szPath, 2) = "\\" Then
$szPath = StringTrimLeft($szPath, 2) ; Trim the \\
$pos = StringInStr($szPath, "\")
If $pos = 0 Then $pos = StringInStr($szPath, "/")
If $pos = 0 Then
$drive = "\\" & $szPath; Prepend the \\ we stripped earlier
$szPath = ""; Set to null because the whole path was just the UNC server name
Else
$drive = "\\" & StringLeft($szPath, $pos - 1) ; Prepend the \\ we stripped earlier
$szPath = StringTrimLeft($szPath, $pos - 1)
EndIf
EndIf
; Set the directory and file name if present
Local $nPosForward = StringInStr($szPath, "/", 0, -1)
Local $nPosBackward = StringInStr($szPath, "\", 0, -1)
If $nPosForward >= $nPosBackward Then
$pos = $nPosForward
Else
$pos = $nPosBackward
EndIf
$dir = StringLeft($szPath, $pos)
$fname = StringRight($szPath, StringLen($szPath) - $pos)
; If $szDir wasn't set, then the whole path must just be a file, so set the filename
If StringLen($dir) = 0 Then $fname = $szPath
$pos = StringInStr($fname, ".", 0, -1)
If $pos Then
$ext = StringRight($fname, StringLen($fname) - ($pos - 1))
$fname = StringLeft($fname, $pos - 1)
EndIf
; Set the strings and array to what we found
$szDrive = $drive
$szDir = $dir
$szFName = $fname
$szExt = $ext
$array[1] = $drive
$array[2] = $dir
$array[3] = $fname
$array[4] = $ext
Return $array
EndFunc ;==>_PathSplit
Func _Exit()
Exit
EndFunc
Block

Blockiert Tastatur und Maus für 15 Sekunden (zum reinigen)
Code:
#RequireAdmin ; Wird benötigt da sonst BlockInput() nicht funktioniert
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1) ; Aktiviert den GuiOnEventMode
HotKeySet("{ENTER}", "_Start")
$Form1 = GUICreate("Block", 1281, 733)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") ; Startet Funktion _Exit() sobald auf das X rechts oben geklickt wird
$Label1 = GUICtrlCreateLabel("...", 206, 26, 860, 749, $SS_CENTER) ; Erstellt einen Text der mittig steht
GUICtrlSetFont(-1, 500) ; Vergrößert den Text
GUICtrlSetColor(-1, 0xFF0000) ; Ändert die Farbe des Textes
$Button1 = GUICtrlCreateButton("Start!", 8, 688, 1265, 33)
GUICtrlSetOnEvent(-1, "_Start") ; Funktion _Start() wird ausgeführt sobald auf den Button gedrückt wird
GUISetState(@SW_SHOW)
While 1
Sleep (100) ; Wird benötigt damit sich das GUI nicht schließt
WEnd
Func _Start()
BlockInput(1) ; Blockiert Maus- und Tastatureingaben
For $i = 15 To 1 Step -1 ; Zählt von 15 runter
GUICtrlSetData($Label1, $i) ; Ändert den Text im GUI
Sleep (1000)
Next
BlockInput(0)
_Exit()
EndFunc
Func _Exit()
Exit
EndFunc
#cs
MsgBox(64, "Block", "Block wird gestartet!")
BlockInput(1)
For $i = 15 To 1 Step -1
MsgBox(64, "Block", "Noch " & $i & " Sekunden", 1)
Next
BlockInput(0)
#ce
Files

Sucht in einem Ordner nach Bildern welche größer sind als die angegebene Auflösung
Code:
#Include <File.au3>
#Include <Array.au3>
#Include <GDIPlus.au3>
#include <WinAPI.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
Opt("GUIOnEventMode", 1)
Global $path, $i, $file, $count, $count2
_GDIPlus_Startup()
$scriptpath = @ScriptDir & "\output\"
$count = 1
$wait = 0
$s = 0
$Form1 = GUICreate("iMac Wallpaper sucher", 488, 110)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
$Input1 = GUICtrlCreateInput("C:\Users\Eduard\Pictures\", 16, 16, 281, 21)
$Button1 = GUICtrlCreateButton("Durchsuchen ...", 304, 14, 89, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Durchsuchen")
$Button2 = GUICtrlCreateButton("Überprüfen!", 400, 14, 73, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "image")
GUICtrlCreateLabel("Nach Auflösung suchen:", 16, 50)
$Input2 = GUICtrlCreateInput("2560", 26, 70, 35)
GUICtrlCreateLabel("x", 70, 72)
$Input3 = GUICtrlCreateInput("1440", 86, 70, 35)
$Label1 = GUICtrlCreateLabel("Warte auf Überprüfung ...", 180, 72, 200, 30, $SS_CENTER)
GUISetState(@SW_SHOW)
While 1
Sleep (100)
WEnd
Func Durchsuchen()
$path = FileSelectFolder("Wählen sie einen Ordner aus", @UserProfileDir, 4, @UserProfileDir & "\Pictures")
If $path = "" Then
Sleep (1)
Else
GUICtrlSetData($Input1, $path & "\")
EndIf
EndFunc
Func image()
$path = GUICtrlRead($Input1)
$file1=_FileListToArray($path, "*", 2)
$count3 = 1
Do
$file = _FileListToArray($path & $file1[$count3] & "\")
_ArrayDisplay($file)
$count2 = 0
DirCreate($scriptpath)
Do
GUICtrlSetData ($Label1, "Überprüfe " & $file[$count])
$image = _GDIPlus_ImageLoadFromFile($path & $file[$count])
$hoehe = _GDIPlus_ImageGetHeight($image)
$breite = _GDIPlus_ImageGetWidth($image)
$hoehesuchen = GUICtrlRead($Input3) - 1
$breitesuchen = GUICtrlRead($Input2) - 1
If $hoehesuchen < $hoehe And $breitesuchen < $breite Then
GUICtrlSetData ($Label1, "Kopiere " & $file[$count])
FileCopy($path & $file[$count], $scriptpath)
$count2 = $count2 + 1
EndIf
$count = $count + 1
Until $count = $file[0]
$count3 = $count3 + 1
Until $count3 = $file1[0]
GUICtrlSetData ($Label1, $file[0] & " Bilder überprüft!")
MsgBox(64, "iMac Wallpaper Sucher", "Es wurden " & $count2 & " Bilder gefunden und nach " & $scriptpath & " kopiert!", 10)
Sleep (1000)
GUICtrlSetData ($Label1, "Warte auf Überprüfung ...")
EndFunc
Func _Exit()
Exit
EndFunc
File Date rename [Compiled only with Parameter]

Über ein Fileopen Dialog oder DragAndDrop eine Datei umbennen in "FILENAME-YEAR-MONTH-DAY" nach dem Erstelldatum
Perfekt für Backup Sicherungen einer Datei! Wer den alten Dateinamen behalten will muss FileCopy anstelle von FileMove nutzen
[code}#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
If NOT @Compiled Or $CmdLine[1] = "" Then
$file = FileOpenDialog("File Date rename", @DesktopDir & "\", "Alle (*.*)", 1)
Else
$file = $CmdLine[1]
EndIf
Global $szDrive, $szDir, $szFName, $szExt, $date
$date = FileGetTime($file, 1)
$filename = _PathSplit($file, $szDrive, $szDir, $szFName, $szExt)
FileMove($file, @ScriptDir & "\" & $filename[3] & "-" & $date[0] & "-" & $date[1] & "-" & $date[2] & ".img")
ConsoleWrite("Changed " & $file & " to " & $filename[3] & "-" & $date[0] & "-" & $date[1] & "-" & $date[2] & ".img")
Func _PathSplit($szPath, ByRef $szDrive, ByRef $szDir, ByRef $szFName, ByRef $szExt)
; Set local strings to null (We use local strings in case one of the arguments is the same variable)
Local $drive = ""
Local $dir = ""
Local $fname = ""
Local $ext = ""
Local $pos
; Create an array which will be filled and returned later
Local $array[5]
$array[0] = $szPath; $szPath can get destroyed, so it needs set now
; Get drive letter if present (Can be a UNC server)
If StringMid($szPath, 2, 1) = ":" Then
$drive = StringLeft($szPath, 2)
$szPath = StringTrimLeft($szPath, 2)
ElseIf StringLeft($szPath, 2) = "\\" Then
$szPath = StringTrimLeft($szPath, 2) ; Trim the \\
$pos = StringInStr($szPath, "\")
If $pos = 0 Then $pos = StringInStr($szPath, "/")
If $pos = 0 Then
$drive = "\\" & $szPath; Prepend the \\ we stripped earlier
$szPath = ""; Set to null because the whole path was just the UNC server name
Else
$drive = "\\" & StringLeft($szPath, $pos - 1) ; Prepend the \\ we stripped earlier
$szPath = StringTrimLeft($szPath, $pos - 1)
EndIf
EndIf
; Set the directory and file name if present
Local $nPosForward = StringInStr($szPath, "/", 0, -1)
Local $nPosBackward = StringInStr($szPath, "\", 0, -1)
If $nPosForward >= $nPosBackward Then
$pos = $nPosForward
Else
$pos = $nPosBackward
EndIf
$dir = StringLeft($szPath, $pos)
$fname = StringRight($szPath, StringLen($szPath) - $pos)
; If $szDir wasn't set, then the whole path must just be a file, so set the filename
If StringLen($dir) = 0 Then $fname = $szPath
$pos = StringInStr($fname, ".", 0, -1)
If $pos Then
$ext = StringRight($fname, StringLen($fname) - ($pos - 1))
$fname = StringLeft($fname, $pos - 1)
EndIf
; Set the strings and array to what we found
$szDrive = $drive
$szDir = $dir
$szFName = $fname
$szExt = $ext
$array[1] = $drive
$array[2] = $dir
$array[3] = $fname
$array[4] = $ext
Return $array
EndFunc ;==>_PathSplit[/code]
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
If NOT @Compiled Or $CmdLine[1] = "" Then
$file = FileOpenDialog("File Date rename", @DesktopDir & "\", "Alle (*.*)", 1)
Else
$file = $CmdLine[1]
EndIf
Global $szDrive, $szDir, $szFName, $szExt, $date
$date = FileGetTime($file, 1)
$filename = _PathSplit($file, $szDrive, $szDir, $szFName, $szExt)
FileMove($file, @ScriptDir & "\" & $filename[3] & "-" & $date[0] & "-" & $date[1] & "-" & $date[2] & ".img")
ConsoleWrite("Changed " & $file & " to " & $filename[3] & "-" & $date[0] & "-" & $date[1] & "-" & $date[2] & ".img")
Func _PathSplit($szPath, ByRef $szDrive, ByRef $szDir, ByRef $szFName, ByRef $szExt)
; Set local strings to null (We use local strings in case one of the arguments is the same variable)
Local $drive = ""
Local $dir = ""
Local $fname = ""
Local $ext = ""
Local $pos
; Create an array which will be filled and returned later
Local $array[5]
$array[0] = $szPath; $szPath can get destroyed, so it needs set now
; Get drive letter if present (Can be a UNC server)
If StringMid($szPath, 2, 1) = ":" Then
$drive = StringLeft($szPath, 2)
$szPath = StringTrimLeft($szPath, 2)
ElseIf StringLeft($szPath, 2) = "\\" Then
$szPath = StringTrimLeft($szPath, 2) ; Trim the \\
$pos = StringInStr($szPath, "\")
If $pos = 0 Then $pos = StringInStr($szPath, "/")
If $pos = 0 Then
$drive = "\\" & $szPath; Prepend the \\ we stripped earlier
$szPath = ""; Set to null because the whole path was just the UNC server name
Else
$drive = "\\" & StringLeft($szPath, $pos - 1) ; Prepend the \\ we stripped earlier
$szPath = StringTrimLeft($szPath, $pos - 1)
EndIf
EndIf
; Set the directory and file name if present
Local $nPosForward = StringInStr($szPath, "/", 0, -1)
Local $nPosBackward = StringInStr($szPath, "\", 0, -1)
If $nPosForward >= $nPosBackward Then
$pos = $nPosForward
Else
$pos = $nPosBackward
EndIf
$dir = StringLeft($szPath, $pos)
$fname = StringRight($szPath, StringLen($szPath) - $pos)
; If $szDir wasn't set, then the whole path must just be a file, so set the filename
If StringLen($dir) = 0 Then $fname = $szPath
$pos = StringInStr($fname, ".", 0, -1)
If $pos Then
$ext = StringRight($fname, StringLen($fname) - ($pos - 1))
$fname = StringLeft($fname, $pos - 1)
EndIf
; Set the strings and array to what we found
$szDrive = $drive
$szDir = $dir
$szFName = $fname
$szExt = $ext
$array[1] = $drive
$array[2] = $dir
$array[3] = $fname
$array[4] = $ext
Return $array
EndFunc ;==>_PathSplit[/code]
Total Comments 0
Comments
| vBulletin Message | |
| Cancel Changes | |






