So, ich veröffentliche hier mein neustes Script, dass ich in Zusammenarbeit mit zOioN geschrieben habe:
Es handelt sich um einen sehr praktischen Download, mit ähnlichen Funktionen wie "JDownloader".
Er kann z.B. Herunterladen, Entpacken, Öffnen und so weiter.
Außerdem wird ein Protokoll mitgeschrieben, indem aufgelistet ist was passiert und wo der Fehler liegt, falls einer auftritt.
In einem "Eventsystem" können "Events" zu einer Liste hinzugefügt werden, die diese Events der Reihe nach abarbeitet.
Außerdem gibt es einen Afk-Modus, der verhindert das das System automatisch herunterfährt, da keine Benutzereingaben mehr kommen.
Features:
-Eventsystem
-Leichte Bedienung
-Downloadinformationen
-GDIPlus Ladebalken (Download und Gesamtdauer)
-Downloadzeitberechnung
-Überprüfung, ob Internetverbindung besteht
-Beepen, wenn Event abgeschlossen
-Afk-Modus
-Einstellungsmenü
Events:
-Download
-Öffnen
-Warten
-Entpacken
-Protokoll speichern
-Protokoll drucken
-Herunterfahren
-Standby
-Neustart
-Abmelden
Dank
Danken möchte ich hier "Bugfix", von dem ich die Entpackfunktion für zip-Files habe.
Auch Dank an alle autoit.de Mitglieder, die mir bei Fragen im Forum sowie der Shoutbox geholfen haben.
Aber vor allem "zOioN", der mir die Grafiken gemacht hat und geholfen hat, das Script weiterzuentwickeln und zu verbessern.
Dem Tester "RavensGate", der schon einige Bugs ausfindig gemacht hat.
Und "Fabian" und "Ineluku", dafür, dass sie Bugs ausfindig gemacht und gemeldet haben.
To-Do
YoutubeDownloadFunktion
Neue Events
Script
War leider zu groß für hier, daher hier der Download:
Versionen:
-V1.1 (alt, nicht mehr zum Download verfügbar)
-V1.2 (alt, nicht mehr zum Download verfügbar)
-V1.3 (alt, nicht mehr zum Download verfügbar)
-V2.0 (alt, nicht mehr zum Download verfügbar)
-V2.1 (neu. zum Download verfügbar)###Neue Version!###
Download V2.1
gerändert von V1.1 auf V1.2 und auf V1.3 und V2.0 und V2.1 hat sich:
Spoiler anzeigen
-größeres Protokollauszugsfenster
-Tip bei "Stop" geändert
-Nach dem minimieren bleibt Grafik erhalten
-Kein Fehler mehr bei DeleteFunktion
-InputBox bei Download geändert
-Bei About kein Spash sondern MsgBox
-Beep bei EventlistEnde eingefügt
-beim Downloadzielordner: Standart ist @ScriptDir, als angezeigtes Verzeichnis wird das zuletzt gewählte Ziel genommen
-Soundfunktion beim Ende eines Events hinzugefügt
-Fehlerrückgabe funktioniert nun beim Downloadzielpfad korrekt
-Abfrage falls Datei bereits existiert und Frage an den Benutzern bzl. ersetzen
-Default bei InputBox gesetzt
-keine Endung mehr bei InputBox "Dateiname" mehr benöigt
-Downloadziel Pfadeingabe Benutzerfreundlicher gemacht (FileSaveDialog statt FileSelectFolder und InputBox) mit Default
-Columbreite geändert
-Einstellungsmenü hinzugefügt
-Afk-Modus ergänzt
-Download Funktion korrigiert (von "Fabian")
Code:
Code
#AutoIt3Wrapper_Icon=\pic\star.ico
#AutoIt3Wrapper_Outfile=Royalloader.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Description=Royalloader
#AutoIt3Wrapper_Res_Fileversion=1.2.0.0
#AutoIt3Wrapper_Res_LegalCopyright=stayawayknight
; Das oben sind Befehle falls man ne Exe draus macht
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <IE.au3>
#include <WinApi.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <GuiImageList.au3>
#include <EditConstants.au3>
#include <File.au3>
#include <Array.au3>
#include <Inet.au3>
#include <GuiComboBoxEx.au3>
#include 'data/GUICtrlOnHover.au3'
#include <GUIListBox.au3>
#include <Misc.au3>
#include <Sound.au3>
#include <GUISlider.au3>
;Royalloader
;Script by stayawaynight
;Grafiken by zOioN
;Betatest by RavensGate und staywayknight
;für http://www.autoit.de // [email='stayawayknight@autoit.de'][/email], [email='zoion@autoit.de'][/email], [email='RavensGate@autoit.de'][/email]
;für http://www.nowpix.square7.ch
;Bugs und Verbesserungsvorschläge gemeldet von "Fabian" ([email='Fabian@autoit.de'][/email])
;###To Do Start
;Events hinzugefügt: Download, YoutubeDownload*, Öffnen, Warten, Entpacken, Heurnterfahren, Standby, Neustarten, Abmelden, Protokoll speichern, Protokoll drucken
;Funktionen testen
;*Nicht gemacht/nicht fertig
;Afk-Mausbewegung simulieren, damit nicht "autobeenden"
;###To Do Ende
;###ChangeLog Start
;größeres Protokollauszugsfenster
;Tip bei "Stop" geändert
;Nach dem minimieren bleibt Grafik erhalten
;Kein Fehler mehr bei DeleteFunktion
;InputBox bei Download geändert
;Bei About kein Spash sondern MsgBox
;Beep bei EventlistEnde eingefügt
;beim Downloadzielordner: Standart ist @ScriptDir, als angezeigtes Verzeichnis wird das zuletzt gewählte Ziel genommen
;Soundfunktion beim Ende eines Events hinzugefügt
;Fehlerrückgabe funktioniert nun beim Downloadzielpfad korrekt
;Abfrage falls Datei bereits existiert und Frage an den Benutzern bzl. ersetzen
;Default bei InputBox gesetzt
;keine Endung mehr bei InputBox "Dateiname" mehr benöigt
;DOwnloadziel Pfadeingabe Benutzerfreundlicher gemacht (FileSaveDialog statt FileSelectFolder und InputBox) mit Default
;Columbreite geändert
;Einstellungsmenü hinzugefügt
;Afk-Modus ergänzt
;Download Funktion korrigiert ([email='Fabian@autoit.de'][/email])
;###Changelog Ende
;###Variablen und Konstanten Start
Global $CONTINUE = 0
$title = "Royalloader - by stayawayknight und zoion (http://www.autoit.de)"
$titleconfig = "Royalloader - Einstellungsmenü"
$guiwidth = 625
$guiheight = 416
$guix = 363
$guiy = 134
$picpath = @ScriptDir & "\pic\"
$inipath = @ScriptDir & "\data\todo.ini"
$dllpath1 = @ScriptDir & "\data\icon.dll"
$dllpath2 = @ScriptDir & "\data\inetcpl.cpl"
$protocolpath = @ScriptDir & "\protocol\protocol.ini"
$configpath = @ScriptDir & "\data\config.ini"
$soundpath = @ScriptDir & "\sound\"
$balkenlen = 358
$LOADSTATE = 0
$FULLSTATE = 0
$brushdownloadcolor = IniRead($configpath, "config", "downloadcolor", "")
$brushprogresscolor = IniRead($configpath, "config", "progresscolor", "")
$LASTPATH = @HomeDrive
$configgui = 0
$ChooseDownloadColor = 0
$ChooseProgressColor = 0
$ChooseFrequenz = 0
$done = 0
$close = 0
$nextdownloadcolor = IniRead($configpath, "config", "downloadcolor", "")
$nextprogresscolor = IniRead($configpath, "config", "progresscolor", "")
$AfkMode = 0
;###Variablen und Konstanten Ende
;###Settings Start
Opt("TrayAutoPause", 0)
Opt("TraymenuMode", 1)
Opt("MouseCoordMode", 0)
TraySetIcon($picpath & "star.ico")
;###Settings Ende
;###Check for Inet Start
checkinet()
;###Check for Inet Ende
;###Gui Start
$main = GUICreate($title, $guiwidth, $guiheight, $guix, $guiy)
GUISetBkColor(0x000000)
GUISetState(@SW_SHOW)
GUISetIcon($picpath & "star.ico")
Opt("TrayOnEventMode", 1)
Opt("GuiOnEventMode", 1)
Opt("GuiCloseOnEsc", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "ende", WinGetHandle($title))
$IconUp = GUICtrlCreateIcon($picpath & "up.ico", "", 235, 290, 30, 30)
GUICtrlSetOnEvent(-1, "up")
_GuiCtrl_OnHoverRegister(-1, "Hover", "Leave")
GUICtrlSetTip(-1, "Hoch")
$IconDown = GUICtrlCreateIcon($picpath & "down.ico", "", 235, 320, 30, 30)
GUICtrlSetOnEvent(-1, "down")
_GuiCtrl_OnHoverRegister(-1, "Hover", "Leave")
GUICtrlSetTip(-1, "Runter")
$IconAdd = GUICtrlCreateIcon($picpath & "add.ico", "", 225, 230, 50, 50)
GUICtrlSetOnEvent(-1, "add")
_GuiCtrl_OnHoverRegister(-1, "Hover", "Leave")
GUICtrlSetTip(-1, "Event aus Box links hinzufügen")
$IconDelete = GUICtrlCreateIcon($picpath & "delete.ico", "", 225, 360, 50, 50)
GUICtrlSetOnEvent(-1, "delete")
_GuiCtrl_OnHoverRegister(-1, "Hover", "Leave")
GUICtrlSetTip(-1, "Event aus Eventliste Löschen")
$IconStart = GUICtrlCreateIcon($picpath & "go.ico", "", 170, 230, 50, 50)
GUICtrlSetOnEvent(-1, "startall")
_GuiCtrl_OnHoverRegister(-1, "Hover", "Leave")
GUICtrlSetTip(-1, "Eventliste ausführen")
$IconStop = GUICtrlCreateIcon($picpath & "stop.ico", "", 170, 295, 50, 50)
GUICtrlSetOnEvent(-1, "stop")
_GuiCtrl_OnHoverRegister(-1, "Hover", "Leave")
GUICtrlSetTip(-1, "Nächstes Event abbrechen")
$IconConfig = GUICtrlCreateIcon($picpath & "config.ico", "", 170, 360, 50, 50)
GUICtrlSetOnEvent(-1, "config")
_GuiCtrl_OnHoverRegister(-1, "Hover", "Leave")
GUICtrlSetTip(-1, "Einstellungen")
;###Gui Ende
;###GDIPlus Start
_GDIPlus_Startup()
$graphics = _GDIPlus_GraphicsCreateFromHWND($main)
$bk = _GDIPlus_ImageLoadFromFile($picpath & "bk.jpg")
_GDIPlus_GraphicsDrawImageRect($graphics, $bk, 0, 0, $guiwidth, $guiheight)
Global $brushdownload = _GDIPlus_BrushCreateSolid($brushdownloadcolor)
Global $brushprogress = _GDIPlus_BrushCreateSolid($brushprogresscolor)
Global $brushdelete = _GDIPlus_BrushCreateSolid(0xFF7C7C7C)
Global $brushdelete2 = _GDIPlus_BrushCreateSolid(0xFF7C7C7C)
GUIRegisterMsg($WM_MOVE, "refreshall")
GUIRegisterMsg($WM_ACTIVATE, "refreshall")
AdlibRegister("refreshall", 30000)
;###GDIPlus Ende
;###Controls Start
$EventCombo = GUICtrlCreateCombo("Events:", 0, 235, 127, 500)
GUICtrlSetData($EventCombo, "Download|YoutubeDownload|Öffnen|Entpacken|Warten|Herunterfahren|Standby|Neustart|Abmelden|Protokoll-speichern|Protokoll-drucken")
GUICtrlSetBkColor($EventCombo, 0x000000)
GUICtrlSetColor($EventCombo, 0xFFFFFF)
$infolist = GUICtrlCreateList("Downloadinformationen:", 0, 260, 127, 500, BitOR($WS_BORDER, $WS_VSCROLL))
GUICtrlSetBkColor($infolist, 0x000000)
GUICtrlSetColor($infolist, 0xFFFFFF)
$eventlist = GUICtrlCreateListView("", 282, 235, 342, 182, $WS_BORDER, $LVS_EX_CHECKBOXES)
GUICtrlSetBkColor($eventlist, 0x000000)
GUICtrlSetColor($eventlist, 0xFFFFFF)
$imagelist = _GUIImageList_Create(16, 16, 5, 3)
_GUIImageList_AddIcon($imagelist, $dllpath1, 17) ;Download 0
_GUIImageList_AddIcon($imagelist, $dllpath2, 7) ;Youtube Download 1
_GUIImageList_AddIcon($imagelist, $dllpath1, 261) ;Öffnen 2
_GUIImageList_AddIcon($imagelist, $dllpath1, 42) ;Entpacken 3
_GUIImageList_AddIcon($imagelist, $dllpath1, 239) ;Warten 4
_GUIImageList_AddIcon($imagelist, $dllpath1, 215) ;Herunterfahren 5
_GUIImageList_AddIcon($imagelist, $dllpath1, 217) ;Standby 6
_GUIImageList_AddIcon($imagelist, $dllpath1, 176) ;Neustart 7
_GUIImageList_AddIcon($imagelist, $dllpath1, 211) ;Abmelden 8
_GUIImageList_AddIcon($imagelist, $dllpath1, 132) ;Protokoll speichern 9
_GUIImageList_AddIcon($imagelist, $dllpath1, 225) ;Protokoll drucken 10
_GUIImageList_AddIcon($imagelist, $dllpath1, 144) ;Done 11
_GUIImageList_AddIcon($imagelist, $dllpath1, 109) ;Failed 12
_GUIImageList_AddIcon($imagelist, $dllpath1, 137) ;is doing 13
_GUICtrlListView_SetImageList($eventlist, $imagelist, 1)
_GUICtrlListView_AddColumn($eventlist, "Sound? / Nr.", 80)
_GUICtrlListView_AddColumn($eventlist, "Event", 260)
GUICtrlSetState($eventlist, $GUI_ENABLE)
GUICtrlSetState($EventCombo, $GUI_ENABLE)
GUICtrlSetState($IconUp, $GUI_ENABLE)
GUICtrlSetState($IconDown, $GUI_ENABLE)
GUICtrlSetState($IconAdd, $GUI_ENABLE)
GUICtrlSetState($IconDelete, $GUI_ENABLE)
GUICtrlSetState($IconStart, $GUI_ENABLE)
GUICtrlSetState($IconStop, $GUI_ENABLE)
GUICtrlSetState($IconConfig, $GUI_ENABLE)
refreshdata()
;###Controls Ende
While 1
[/autoit] [autoit][/autoit] [autoit]$state = WinGetState($title)
[/autoit] [autoit][/autoit] [autoit]If BitAND($state, 16) Then
Do
$state = WinGetState($title)
Sleep(100)
Until BitAND($state, 16)
refreshall()
EndIf
WEnd
Func Hover($CtrlID)
Switch $CtrlID
Case $IconUp
GUICtrlSetImage($IconUp, $picpath & "up1.ico")
Case $IconDown
GUICtrlSetImage($IconDown, $picpath & "down1.ico")
Case $IconAdd
GUICtrlSetImage($IconAdd, $picpath & "add1.ico")
Case $IconDelete
GUICtrlSetImage($IconDelete, $picpath & "delete1.ico")
Case $IconStart
GUICtrlSetImage($IconStart, $picpath & "go1.ico")
Case $IconStop
GUICtrlSetImage($IconStop, $picpath & "stop1.ico")
Case $IconConfig
GUICtrlSetImage($IconConfig, $picpath & "config1.ico")
Case $close
GUICtrlSetImage($close, $picpath & "close1.ico")
Case $done
GUICtrlSetImage($done, $picpath & "go1.ico")
EndSwitch
EndFunc ;==>Hover
Func Leave($CtrlID)
Switch $CtrlID
Case $IconUp
GUICtrlSetImage($IconUp, $picpath & "up.ico")
Case $IconDown
GUICtrlSetImage($IconDown, $picpath & "down.ico")
Case $IconAdd
GUICtrlSetImage($IconAdd, $picpath & "add.ico")
Case $IconDelete
GUICtrlSetImage($IconDelete, $picpath & "delete.ico")
Case $IconStart
GUICtrlSetImage($IconStart, $picpath & "go.ico")
Case $IconStop
GUICtrlSetImage($IconStop, $picpath & "stop.ico")
Case $IconConfig
GUICtrlSetImage($IconConfig, $picpath & "config.ico")
Case $close
GUICtrlSetImage($close, $picpath & "close.ico")
Case $done
GUICtrlSetImage($done, $picpath & "go.ico")
EndSwitch
EndFunc ;==>Leave
Func startall()
[/autoit] [autoit][/autoit] [autoit]If FileExists($protocolpath) Then
FileDelete($protocolpath)
EndIf
$FULLSIZE = 0
$LOADEDSOFAR = 0
$sizedoneold = 0
For $a = 1 To _FileCountLines($inipath) - 1 ;vorbereitung für die Gesamtdauert - Bekomme gesamtgröße
$commandx = IniRead($inipath, "ToDo", $a, "")
$commandx = StringSplit($commandx, "|")
Switch 1
Case StringRegExp($commandx[1], "download")
$FULLSIZE += InetGetSize($commandx[2])
EndSwitch
Next
FileWrite($protocolpath, "_____Royalloader - by stayawayknight und zoion (http://www.autoit.de)_______" & @CRLF & "-----------------Protokoll-----------------" & @CRLF)
FileWrite($protocolpath, "Startdatum:" & @MDAY & ". " & @MON & ". " & @YEAR & @CRLF)
FileWrite($protocolpath, "Startzeit: " & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF & @CRLF)
For $a = 1 To _FileCountLines($inipath) - 1 ;beginne
$command = IniRead($inipath, "ToDo", $a, "")
$command = StringSplit($command, "|")
$command = $command[1]
GUICtrlSetData($infolist, "")
[/autoit] [autoit][/autoit] [autoit]If $CONTINUE = False Then
$CONTINUE = True
Return 1
EndIf
Switch 1
Case StringRegExp($command, "download")
Do
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
Sleep(100)
MsgBox(0, "hi", "Lade Download....", 1)
Until _GUICtrlListView_GetItemImage($infolist, $a - 1) = 0
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$url = $splitted[2]
$dest = $splitted[3]
$sizefile = InetGetSize($url)
$download = InetGet($url, $dest, 1, 1)
$downloadtimer = TimerInit()
FileWrite($protocolpath, @CRLF & @CRLF & "Download von " & $url & " nach " & $dest)
If $dest = "" Or StringInStr($dest, "\") = 0 Or StringInStr($dest, ".") = 0 Then ;Ziel ist nur schrott
FileWrite($protocolpath, " <= Error / ungültiges Ziel")
EndIf
FileWrite($protocolpath, @CRLF & ".....Größe: " & $sizefile & " Bytes")
GUICtrlSetData($infolist, "Geladen: 0/" & Round(($sizefile / 1024) / 1024, 1) & " MB")
GUICtrlSetData($infolist, "Dauer: 0/'rechne' Min")
If $sizefile = 0 Then ;Fehler Datei im Internet hat keine Größe
FileWrite($protocolpath, " <= Error / ungültige URL")
EndIf
FileWrite($protocolpath, @CRLF & ".....Download Start: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
If $sizefile = 0 Or $dest = "" Or StringInStr($dest, "\") = 0 Or StringInStr($dest, ".") = 0 Then ;fehlerrückgabe
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 12) ;Setze Fehler
FileWrite($protocolpath, @CRLF & ".....Download Ende: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
Else
Do
$sizedone = InetGetInfo($download, 0)
$LOADEDSOFAR += ($sizedone - $sizedoneold) ;erstelle die bisher geladenen Bytes
$sizedoneold = $sizedone ;abrschift der alten bytes um differenz addieren zu könenn
$percent = (100 / $sizefile) * $sizedone
$percentduring = (100 / $FULLSIZE) * $LOADEDSOFAR
GUICtrlSetData($infolist, "")
GUICtrlSetData($infolist, "Downloadinformationen:")
GUICtrlSetData($infolist, "Geladen: " & Round(($sizedone / 1024) / 1024, 1) & "/" & Round(($sizefile / 1024) / 1024, 1) & " MB")
$timedone = Round((TimerDiff($downloadtimer) / 1000) / 60, 1)
$timefull = Round(((100 / $percent) * ((TimerDiff($downloadtimer) / 1000) / 60)), 1)
GUICtrlSetData($infolist, "Dauer: " & $timedone & "/" & $timefull & " Min")
_setdownload($percent)
_setduring($percentduring)
Sleep(100)
Until $percent >= 100
$LOADEDSOFAR += $sizedone ;Addiere zu den LoadedSofar die komplette Größe des letzten Downloads
InetClose($download)
ToolTip("Download abgeschlossen!")
FileWrite($protocolpath, ".....Download Ende: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
Sleep(2000)
ToolTip("")
;a- 1 ist index
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
EndIf
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
Case StringRegExp($command, "youtube") ;MUSS Noch GEMACHT WERDEN
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
;NOTHING DONE
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
Case StringRegExp($command, "offnen")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$path = $splitted[2]
FileWrite($protocolpath, @CRLF & @CRLF & "Öffnen von " & $path)
If FileExists($path) Then
ShellExecute($path)
FileWrite($protocolpath, @CRLF & "Geöffnet um: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
ToolTip("Öffnen von " & $path & " abgeschlossen!")
Sleep(2000)
ToolTip("")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
Else
FileWrite($protocolpath, " <= Error / File existiert nicht")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 12)
EndIf
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
Case StringRegExp($command, "entpacken")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$path = $splitted[2]
$dest = $splitted[3]
FileWrite($protocolpath, @CRLF & @CRLF & "Entpacken von " & $path & " nach " & $dest)
[/autoit] [autoit][/autoit] [autoit]_enzip($path, $dest, True, 1, True)
[/autoit] [autoit][/autoit] [autoit]If FileExists($path) And Not @error Then
ToolTip("Entpacken von " & $path & " nach" & $dest & " abgeschlossen!")
FileWrite($protocolpath, ".....Datei entpackt um: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
Sleep(2000)
ToolTip("")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
Else
If @error = 2 Then
FileWrite($protocolpath, " <= Error / Datei endet nicht auf '.zip'")
ElseIf Not FileExists($path) Then
FileWrite($protocolpath, " <= Error / Datei nicht vorhanden")
EndIf
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 12)
EndIf
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
Case StringRegExp($command, "warten")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$wait = $splitted[2]
FileWrite($protocolpath, @CRLF & @CRLF & $wait & " Millisekunden warten")
If $wait <= 0 Or $wait = "" Then
FileWrite($protocolpath, " <= Error / Kein Wert oder ungültiger Wert eingegeben")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 12)
Else
FileWrite($protocolpath, @CRLF & ".....Gewartet ab: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
For $z = 1 To $wait / 1000
Sleep(1000)
ToolTip($z * 1000 & " ms")
Next
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
ToolTip("")
FileWrite($protocolpath, ".....Gewartet bis: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
EndIf
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
Case StringRegExp($command, "shutdown")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
FileWrite($protocolpath, @CRLF & @CRLF & "Herunterfahren")
FileWrite($protocolpath, @CRLF & @CRLF & ".....Herunterfahrenbefehl ausgelöst um: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
Shutdown(1)
Case StringRegExp($command, "standby")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
FileWrite($protocolpath, @CRLF & @CRLF & "Standby-Modus")
FileWrite($protocolpath, @CRLF & @CRLF & ".....Standbybefehl ausgelöst um: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
Shutdown(8)
Case StringRegExp($command, "neustart")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
FileWrite($protocolpath, @CRLF & @CRLF & "Neustart")
FileWrite($protocolpath, @CRLF & @CRLF & ".....Neustartbefehl ausgelöst um: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
Shutdown(2)
Case StringRegExp($command, "abmelden")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
FileWrite($protocolpath, @CRLF & @CRLF & "Abmelden")
FileWrite($protocolpath, @CRLF & @CRLF & ".....Abmeldebefehl ausgelöst um: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
Shutdown(0)
Case StringRegExp($command, "saveprotocol")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$path = $splitted[2]
FileWrite($protocolpath, @CRLF & @CRLF & "Abmelden")
FileWrite($protocolpath, @CRLF & @CRLF & ".....Gespeichert nach " & $path & "\protocoll" & @HOUR & @MIN & @SEC & ".txt um : " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
FileMove($protocolpath, $path & "\protocoll" & @HOUR & @MIN & @SEC & ".txt")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
Case StringRegExp($command, "printprotocol")
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 13)
FileWrite($protocolpath, @CRLF & @CRLF & "Protokoll drucken")
FileWrite($protocolpath, @CRLF & @CRLF & ".....Druckbefehl ausgeführt um: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
_FilePrint($protocolpath)
_GUICtrlListView_SetItemImage($eventlist, $a - 1, 11)
If _GUICtrlListView_GetItemChecked($eventlist, $a - 1) = True Then
Beep(IniRead($configpath, "config", "beepfr", ""), 5000)
EndIf
EndSwitch
Next
SplashTextOn($title, "Die Eventliste wurde abgeschlossen!" & @CRLF & "Auszug aus dem Protokoll:" & @CRLF & FileRead($protocolpath), 800, 500)
Sleep(6000)
SplashOff()
FileWrite($protocolpath, @CRLF & @CRLF & "- Ende des Protokolls - um: " & @HOUR & ":" & @MIN & ":" & @SEC & " (" & @MDAY & ". " & @MON & ". " & @YEAR & ")" & @CRLF)
_FileWriteToLine($protocolpath, 5, "Endzeit: " & @HOUR & ":" & @MIN & ":" & @SEC)
EndFunc ;==>startall
Func add()
[/autoit] [autoit][/autoit] [autoit]If FileExists($inipath) Then
$key = IniReadSection($inipath, "ToDo")
$nr = $key[0][0] + 1
Else
$nr = 1
EndIf
Switch GUICtrlRead($EventCombo)
[/autoit] [autoit][/autoit] [autoit]Case "Download" ;Danke an [email='Fabian@autoit.de'][/email] fürs verbessern
$url = InputBox("URL", "Gib die zu herunterladene URL-Adresse ein! Falls ein Passwort benötigt wird, benutze diese Form: 'http://nutzer:passwort@http://www.eine-seite.de/pfad/seite.html'")
If Not @error Then
Dim $urldrive, $urldir, $urlfilename, $urlendung
$pathsplit = _PathSplit($url, $urldrive, $urldir, $urlfilename, $urlendung)
$urlendung = StringLeft($urlendung,4) ;Nur 4 Zeichen der Endung nehmen z.B. .zip
$dest = FileSaveDialog("Gib das Speicherziel ein!", $LASTPATH, "(*" & $urlendung & ")", 0, $urlfilename)
If Not @error = True Then
IniWrite($inipath, "ToDo", $nr, "download|" & $url & "|" & $dest)
$dest = $dest & $urlendung ;Neu hier rein verschoben
EndIf
EndIf
Case "YoutubeDownload"
[/autoit] [autoit][/autoit] [autoit]MsgBox(16, "Fehler", "Dieses Element wurde noch nicht inplentimiert!")
#cs
$url = InputBox("URL", "Gib die zu herunterladene URL-Adresse ein!")
If Not @error Then
$dest = FileSelectFolder("Gib den Speicherort an!", @HomeDrive)
$name = InputBox("Name", "Gib den Wunschnamen der fertigen Datei ein!Falls bereits vorhanden, wird die alte Datei überschrieben! Keine Endung angeben!")
If Not @error Then
IniWrite($inipath, "ToDo", $nr, "youtube|" & $url & "|" & $dest & "|" & $name)
EndIf
EndIf
#ce
Case "Öffnen"
$path = InputBox("Pfad", "Gib den Weg zum Pfad der zu öffnenden Datei an!")
If Not @error Then
IniWrite($inipath, "ToDo", $nr, "offnen|" & $path)
EndIf
Case "Entpacken"
$path = InputBox("Pfad", "Gib den Weg zum Pfad der zu entpackenden Datei an!")
If Not @error Then
$dest = FileSelectFolder("Gib den Speicherort an!", $LASTPATH)
IniWrite($inipath, "ToDo", $nr, "entpacken|" & $path & "|" & $dest)
EndIf
Case "Warten"
$time = InputBox("Zeit", "Gib die Zeit (in Millisekunden) ein, die gewartet werden soll!")
If Not @error Then
IniWrite($inipath, "ToDo", $nr, "warten|" & $time)
EndIf
Case "Herunterfahren"
IniWrite($inipath, "ToDo", $nr, "shutdown")
Case "Standby"
IniWrite($inipath, "ToDo", $nr, "standby")
Case "Neustart"
IniWrite($inipath, "ToDo", $nr, "neustart")
Case "Abmelden"
IniWrite($inipath, "ToDo", $nr, "abmelden")
Case "Protokoll-speichern"
$path = FileSelectFolder("Gib den Speicherort an!", $LASTPATH)
If Not $path = "" Then
IniWrite($inipath, "ToDo", $nr, "saveprotocol|" & $path)
EndIf
Case "Protokoll-drucken"
IniWrite($inipath, "ToDo", $nr, "printprotocol")
EndSwitch
[/autoit] [autoit][/autoit] [autoit]refreshdata()
[/autoit] [autoit][/autoit] [autoit]EndFunc ;==>add
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func refreshdata()
If FileExists($inipath) Then
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($eventlist))
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]For $a = 1 To _FileCountLines($inipath) - 1
$command = IniRead($inipath, "ToDo", $a, "")
$command = StringSplit($command, "|")
$command = $command[1]
Switch 1
Case StringRegExp($command, "download")
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$url = $splitted[2]
$dest = $splitted[3]
_GUICtrlListView_AddItem($eventlist, $a, 0)
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Download von " & $url & " nach " & $dest, 1) ;letze Zahl ist das nach rechts und links, erste hoch und runter
Case StringRegExp($command, "youtube")
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$url = $splitted[2]
$dest = $splitted[3]
$name = $splitted[4]
_GUICtrlListView_AddItem($eventlist, $a, 1)
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Youtube-Download von " & $url & " nach " & $dest & "\" & $name & ".mp4", 1)
Case StringRegExp($command, "offnen")
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$path = $splitted[2]
_GUICtrlListView_AddItem($eventlist, $a, 2)
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Öffnen der Datei " & $path, 1)
Case StringRegExp($command, "entpacken")
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$path = $splitted[2]
$dest = $splitted[3]
_GUICtrlListView_AddItem($eventlist, $a, 3)
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Entpacken der Datei " & $path & " nach " & $dest, 1)
Case StringRegExp($command, "warten")
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$wait = $splitted[2]
_GUICtrlListView_AddItem($eventlist, $a, 4)
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Warten(" & $wait & " Millisekunden)", 1)
Case StringRegExp($command, "shutdown")
_GUICtrlListView_AddItem($eventlist, $a, 5)
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Herunterfahren", 1)
Case StringRegExp($command, "standby")
_GUICtrlListView_AddItem($eventlist, $a, 6)
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Standby-Modus", 1)
Case StringRegExp($command, "neustart")
_GUICtrlListView_AddItem($eventlist, $a, 7)
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Neustart", 1)
Case StringRegExp($command, "abmelden")
_GUICtrlListView_AddItem($eventlist, $a,
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Abmelden", 1)
Case StringRegExp($command, "saveprotocol")
$splitted = StringSplit(IniRead($inipath, "ToDo", $a, ""), "|")
$path = $splitted[2]
_GUICtrlListView_AddItem($eventlist, $a, 9)
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Protokoll speichern nach " & $path, 1)
Case StringRegExp($command, "printprotocol")
_GUICtrlListView_AddItem($eventlist, $a, 10)
_GUICtrlListView_AddSubItem($eventlist, $a - 1, "Protokoll drucken", 1)
EndSwitch
Next
EndIf
EndFunc ;==>refreshdata
Func stop()
$CONTINUE = False
EndFunc ;==>stop
Func delete()
[/autoit] [autoit][/autoit] [autoit]GUICtrlSetState($IconDelete, $GUI_DISABLE)
If FileExists($inipath) And _GUICtrlListView_GetSelectedIndices($eventlist, True) >= 0 And (_GUICtrlListView_GetSelectedIndices($eventlist)) <> "" Then
$item = _GUICtrlListView_GetSelectedIndices($eventlist, True) ;Gibt bei $item[1] den ItemIndex zurück (hoch und runter)
If IsArray($item) Then
$item = $item[1] + 1 ;Korrektur
IniDelete($inipath, "ToDo", $item)
$sectioncontent = IniReadSection($inipath, "ToDo")
If IsArray($sectioncontent) Then ;Ini-Datei neu ordnen (da nummerierung falsch ist)
IniDelete($inipath, "ToDo")
For $z = 1 To $sectioncontent[0][0]
IniWrite($inipath, "ToDo", $z, $sectioncontent[$z][1])
Next
Else
FileDelete($inipath)
EndIf
_GUICtrlListView_DeleteItemsSelected(GUICtrlGetHandle($eventlist))
refreshdata()
EndIf
EndIf
GUICtrlSetState($IconDelete, $GUI_ENABLE)
EndFunc ;==>delete
Func config()
$configgui = GUICreate($titleconfig, 600, 400)
GUISetOnEvent($GUI_EVENT_CLOSE, "endeconfig", WinGetHandle($titleconfig))
GUISetIcon($picpath & "config1.ico")
GUISetBkColor(0x000000)
$Label1 = GUICtrlCreateLabel("Download-Ladebalken:", 60, 40, 159, 23)
GUICtrlSetFont($Label1, 12, 800, 0, "Times New Roman")
GUICtrlSetColor($Label1, 0xFFFFFF)
GUICtrlSetBkColor($Label1, 0x000000)
$Label2 = GUICtrlCreateLabel("Fortschritt-Ladebalken:", 60, 80, 159, 23)
GUICtrlSetFont($Label2, 12, 800, 0, "Times New Roman")
GUICtrlSetColor($Label2, 0xFFFFFF)
GUICtrlSetBkColor($Label2, 0x000000)
$Label3 = GUICtrlCreateLabel("Sound-Frequenz: 250", 60, 120, 159, 23)
GUICtrlSetFont($Label3, 12, 800, 0, "Times New Roman")
GUICtrlSetColor($Label3, 0xFFFFFF)
GUICtrlSetBkColor($Label3, 0x000000)
$Label4 = GUICtrlCreateLabel("3000", 454, 120, 159, 23)
GUICtrlSetFont($Label4, 12, 800, 0, "Times New Roman")
GUICtrlSetColor($Label4, 0xFFFFFF)
GUICtrlSetBkColor($Label4, 0x000000)
$Label5 = GUICtrlCreateLabel("Afk-Modus:", 60, 160, 75, 23)
GUICtrlSetFont($Label5, 12, 800, 0, "Times New Roman")
GUICtrlSetColor($Label5, 0xFFFFFF)
GUICtrlSetBkColor($Label5, 0x000000)
$Label6 = GUICtrlCreateLabel("Script: stayawayknight" & @CRLF & "Grafiken: zOioN" & @CRLF & "Betatester: RavensGate & stayawayknight" & @CRLF & @CRLF & "Produkt erstellt für" & @CRLF & "www.nowpix.square7.ch" & @CRLF & "und" & @CRLF & "www.autoit.de", 60, 200, 200, 200)
GUICtrlSetFont($Label6, 12, 800, 0, "Times New Roman")
GUICtrlSetColor($Label6, 0xFFFFFF)
GUICtrlSetBkColor($Label6, 0x000000)
$ChooseDownloadColor = GUICtrlCreateButton("Wählen", 232, 40, 81, 25)
GUICtrlSetOnEvent($ChooseDownloadColor, "choosecolordownload")
GUICtrlSetBkColor($ChooseDownloadColor, StringReplace(IniRead($configpath, "config", "downloadcolor", ""), "FF", "", 1))
$ChooseProgressColor = GUICtrlCreateButton("Wählen", 232, 80, 81, 25)
GUICtrlSetOnEvent($ChooseProgressColor, "choosecolorprogress")
GUICtrlSetBkColor($ChooseProgressColor, StringReplace(IniRead($configpath, "config", "progresscolor", ""), "FF", "", 1))
$ChooseFrequenz = GUICtrlCreateSlider(232, 120, 200, 25)
GUICtrlSetBkColor($ChooseFrequenz, 0x000000)
GUICtrlSetOnEvent($ChooseFrequenz, "beeper")
GUICtrlSetLimit($ChooseFrequenz, 3000, 250)
GUICtrlSetData($ChooseFrequenz, IniRead($configpath, "config", "beepfr", ""))
_GUICtrlSlider_ClearTics($ChooseFrequenz)
$AfkMode = GUICtrlCreateCheckbox("", 200, 160, 81, 25)
GUICtrlSetTip($AfkMode, "Afk-Modus" & @CRLF & "Wird beim Start der Eventliste aktiviert und nach der Beendigung der Liste wieder ausgeschaltet." & @CRLF & "Sorgt dafür, dass keine Einstellungen (z.B. Autobeenden wennn lange Zeit nichts gemacht wird) aktiv werden." & @CRLF & "Dadurch wird alle 30 Sekunden ein Tastensignal gesendet um dies zu verhindern." & @CRLF & "Diese Funktion sollte z.B. benutzt werden, wenn der Download stattfindet, ohne das dabei jemand am Rechner sitzt.")
GUICtrlSetBkColor($AfkMode, 0x000000)
GUICtrlSetColor($AfkMode, 0xFFFFFF)
If IniRead($configpath, "config", "afk", "") = "True" Then
GUICtrlSetState($AfkMode, $GUI_CHECKED)
EndIf
$done = GUICtrlCreateIcon($picpath & "go.ico", "", 300, 200, 50, 50)
GUICtrlSetOnEvent($done, "doneandsave")
_GuiCtrl_OnHoverRegister(-1, "Hover", "Leave")
$close = GUICtrlCreateIcon($picpath & "close.ico", "", 300, 250, 50, 50)
GUICtrlSetOnEvent($close, "endeconfig")
_GuiCtrl_OnHoverRegister(-1, "Hover", "Leave")
GUISetState(@SW_SHOW)
EndFunc ;==>config
Func doneandsave()
IniWrite($configpath, "config", "downloadcolor", $nextdownloadcolor)
IniWrite($configpath, "config", "progresscolor", $nextprogresscolor)
$brushdownload = _GDIPlus_BrushCreateSolid($nextdownloadcolor)
$brushprogress = _GDIPlus_BrushCreateSolid($nextprogresscolor)
IniWrite($configpath, "config", "beepfr", GUICtrlRead($ChooseFrequenz))
If GUICtrlRead($AfkMode) = $GUI_CHECKED Then
IniWrite($configpath, "config", "afk", "True")
Else
IniWrite($configpath, "config", "afk", "False")
EndIf
GUIDelete($configgui)
EndFunc ;==>doneandsave
;BitOR(_ChooseColor(1), 0xff000000))
Func choosecolordownload()
$choosencolor = _ChooseColor(2) ;FEHLER
If Not @error Then
$choosencolorsplit = StringSplit($choosencolor, "x") ;Wandle rgb in Argb
Else
Return
EndIf
If IsArray($choosencolorsplit) And Not @error Then
$nextdownloadcolor = $choosencolorsplit[1] & "xFF" & $choosencolorsplit[2]
EndIf
GUICtrlSetBkColor($ChooseDownloadColor, StringReplace($nextdownloadcolor, "FF", "", 1))
EndFunc ;==>choosecolordownload
Func beeper()
Beep(GUICtrlRead($ChooseFrequenz), 1000)
EndFunc ;==>beeper
Func choosecolorprogress()
$choosencolor = _ChooseColor(2)
If Not @error Then
$choosencolorsplit = StringSplit($choosencolor, "x") ;Wandle rgb in Argb
Else
Return
EndIf
If IsArray($choosencolorsplit) And Not @error Then
$nextprogresscolor = $choosencolorsplit[1] & "xFF" & $choosencolorsplit[2]
EndIf
GUICtrlSetBkColor($ChooseProgressColor, StringReplace($nextprogresscolor, "FF", "", 1)) ;rückwandeln
EndFunc ;==>choosecolorprogress
Func endeconfig()
GUIDelete($configgui)
EndFunc ;==>endeconfig
Func up()
_GUICtrlListView_SetItemSelected($eventlist, _GUICtrlListView_GetSelectedIndices($eventlist) - 1)
EndFunc ;==>up
Func down()
_GUICtrlListView_SetItemSelected($eventlist, _GUICtrlListView_GetSelectedIndices($eventlist) + 1)
EndFunc ;==>down
Func _setdownload($value)
If $value > 100 Then ;Setze Limit
$value = 100
ElseIf $value < 0 Then
$value = 0
EndIf
_GDIPlus_GraphicsFillRect($graphics, 151, 117, ($balkenlen / 100) * 100, 25, $brushdelete) ;buffer
_GDIPlus_GraphicsFillRect($graphics, 151, 117, ($balkenlen / 100) * $value, 25, $brushdownload)
_GDIPlus_GraphicsFillRect($graphics, 530, 117, 75, 25, $brushdelete2);buffer
_GDIPlus_GraphicsDrawString($graphics, Round($value, 2) & "%", 550, 123, "Tahoma")
$LOADSTATE = $value
EndFunc ;==>_setdownload
Func _setduring($value)
If $value > 100 Then ;Setze Limit
$value = 100
ElseIf $value < 0 Then
$value = 0
EndIf
_GDIPlus_GraphicsFillRect($graphics, 151, 171, ($balkenlen / 100) * 100, 25, $brushdelete) ;buffer
_GDIPlus_GraphicsFillRect($graphics, 151, 171, ($balkenlen / 100) * $value, 25, $brushprogress)
_GDIPlus_GraphicsFillRect($graphics, 531, 170, 75, 25, $brushdelete2);buffer
_GDIPlus_GraphicsDrawString($graphics, Round($value, 2) & "%", 550, 171, "Tahoma")
$FULLSTATE = $value
EndFunc ;==>_setduring
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func refreshall()
_GDIPlus_GraphicsDrawImageRect($graphics, $bk, 0, 0, $guiwidth, $guiheight)
GUICtrlSetState($eventlist, $GUI_ENABLE)
GUICtrlSetState($EventCombo, $GUI_ENABLE)
GUICtrlSetState($infolist, $GUI_ENABLE)
GUICtrlSetState($IconUp, $GUI_ENABLE)
GUICtrlSetState($IconDown, $GUI_ENABLE)
GUICtrlSetState($IconAdd, $GUI_ENABLE)
GUICtrlSetState($IconDelete, $GUI_ENABLE)
GUICtrlSetState($IconStart, $GUI_ENABLE)
GUICtrlSetState($IconStop, $GUI_ENABLE)
GUICtrlSetState($IconConfig, $GUI_ENABLE)
_setdownload($LOADSTATE)
_setduring($FULLSTATE)
If IniRead($configpath, "config", "afk", "") = "True" Then
Send("{!}")
EndIf
EndFunc ;==>refreshall
Func _enzip($sPath, $s_a_ToZip, $fUnZip = True, $iIndexBase = 1, $fOverwrite = True) ;Funktion erstellt von BugFix (http://www.autoit.de) /Danke!
Local $fh, $sNul = '', $sZIPHeader, $objShell = ObjCreate("Shell.Application"), $objZipOrdner, $err = 0
$sPath = FileGetLongName($sPath, 1)
If $fUnZip Then
Local $temp, $objZip
If Not FileExists($s_a_ToZip) Then DirCreate($s_a_ToZip)
$temp = $objShell.Namespace($s_a_ToZip)
$objZip = $objShell.Namespace($sPath)
$temp.CopyHere($objZip.Items)
Return 1
EndIf
If (Not $fOverwrite) And FileExists($sPath) Then Return SetError(1, 0, 0)
If StringRight($sPath, 4) <> '.zip' Then Return SetError(2, 0, 0)
For $i = 1 To 18
$sNul &= Chr(0)
Next
$sZIPHeader = Chr(80) & Chr(75) & Chr(5) & Chr(6) & $sNul
$fh = FileOpen($sPath, 10)
FileWrite($fh, $sZIPHeader)
FileClose($fh)
$objZipOrdner = $objShell.Namespace($sPath)
If Not IsArray($s_a_ToZip) Then
If Not FileExists($s_a_ToZip) Then Return SetError(3, 1, 0)
$objZipOrdner.CopyHere($s_a_ToZip)
Sleep(1000)
Return 1
EndIf
For $i = $iIndexBase To UBound($s_a_ToZip) - 1
If Not FileExists($s_a_ToZip[$i]) Then
$err += 1
ContinueLoop
EndIf
$objZipOrdner.CopyHere($s_a_ToZip[$i])
Sleep(1000)
Next
If $err Then Return SetError(3, $err, 0)
Return 1
EndFunc ;==>_enzip
Func checkinet()
SplashImageOn($title, $picpath & "load.jpg", 500, 400, @DesktopWidth / 3, 200)
Sleep(3000)
While 1
If Ping("www.google.de") >= 5 Then
SplashOff()
ExitLoop
[/autoit] [autoit][/autoit] [autoit]Else
HotKeySet("{ESC}", "ende2")
SplashOff()
MsgBox(16, "Keine Internetverbindung", "Es wurde keine Internetverbindung gefunden. Es wird nun alle 30 Sekunden nach einer Verbindung gesucht. Falls du beenden willst, drücke ESC.")
Do
Sleep(30000)
Until Ping("www.google.de") >= 5 Or Ping("www.amazon.de") >= 5
ExitLoop
EndIf
WEnd
EndFunc ;==>checkinet
Func ende2()
Exit
EndFunc ;==>ende2
Func ende()
_GDIPlus_GraphicsDispose($graphics)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>ende