- Offizieller Beitrag
Hier sind ein Paar von Mir (bis auf GuiCtrlCreateLine, das ist von Pastl) selbst geschriebende UDF's:
Code
#include-once
;===============================================================================
;
; Description: :Flash lights on Key
; Parameter(s): :Times
; Requirement: :-
; Return Value(s): :-
; User CallTip: :-
; Author(s): :GtaSpider
; Note(s): :-
;
;===============================================================================
Func _FlashKey($times)
$scripttimes = 0
AutoItSetOption("SendCapslockMode", 0)
Send("{Numlock on}{Capslock on}{Scrolllock on}")
While 1
$scripttimes = $scripttimes + 1
Send("{Numlock toggle}")
Sleep(100)
Send("{Capslock toggle}")
Sleep(100)
Send("{Scrolllock toggle}")
Sleep(100)
If $scripttimes = $times Then ExitLoop
WEnd
Send("{Numlock on}{Capslock off}{Scrolllock off}")
EndFunc ;==>_FlashKey
;===============================================================================
;
; Description: :Send a Email
; Parameter(s): :$tAdrr,$fAdrr,$uSubj,$mMess,[$emailexe=@ScriptDir&"\sendEmail.exe"[$sServer="post.strato.de",[$aFile=0]]
; Requirement: :sendEmail.exe
; Return Value(s): :-
; User CallTip: :-
; Author(s): :GtaSpider
; Note(s): :
;
;===============================================================================
Func _sendEmail($tAdrr, $fAdrr, $uSubj, $mMess, $sServer = "post.strato.de", $aFile = 0, $emailexe = "")
If $emailexe = "" Then $emailexe = @ScriptDir & "\sendEmail.exe"
If $aFile = 0 Then
$aFile = ""
Else
$aFile = " -a """ & $aFile & ""
EndIf
$fAdrr = " -f """ & $fAdrr & '" '
$tAdrr = " -t """ & $tAdrr & '" '
$uSubj = " -u """ & $uSubj & '" '
$mMess = " -m """ & $mMess & '" '
$sServer = " -s " & $sServer
RunWait($emailexe & $fAdrr & $tAdrr & $sServer & $uSubj & $mMess & $aFile, "", @SW_HIDE)
EndFunc ;==>_sendEmail
;===============================================================================
;
; Description: :Print a Text into a Cmd box
; Parameter(s): :$fTitle,$fEcho,[$fSet="",[$fSetexp="",[$fSetexpElse=""]]]
; Requirement: :-
; Return Value(s): :-
; User CallTip: :-
; Author(s): :GtaSpider
; Note(s): :it will create a file: @TempDir&"\Dos~.bat
;
;===============================================================================
Func Printf($fTitle, $fEcho, $fSet = "", $fSetexp = "", $fSetexpElse = "")
Global $d = "", $e = 0
$fEcho = StringSplit($fEcho, @CRLF)
For $c = 1 To $fEcho[0]
$d = $d & "echo " & $fEcho[$c]
$e = $e + 1
Next
If FileExists(@TempDir & "\Dos~.bat") Then FileDelete(@TempDir & "\Dos~.bat")
FileWriteLine(@TempDir & "\Dos~.bat", "")
$a = FileOpen(@TempDir & "\Dos~.bat", 1)
FileWriteLine($a, "@echo off")
FileWriteLine($a, "title " & $fTitle)
For $c = 1 To $e Step 2
FileWriteLine($a, "echo " & $fEcho[$c])
Next
If Not $fSet = "" Then
FileWriteLine($a, ":set")
FileWriteLine($a, "set /p a=")
FileWriteLine($a, "If %a% equ " & $fSet & " (goto:end) else goto:else")
FileWriteLine($a, ":end")
If Not $fSetexp = "" Then FileWriteLine($a, "echo " & $fSetexp)
FileWriteLine($a, "goto:set")
FileWriteLine($a, ":else")
If Not $fSetexpElse = "" Then FileWriteLine($a, "echo " & $fSetexpElse)
FileWriteLine($a, "goto:set")
EndIf
FileClose($a)
Run(@ComSpec & " /k " & @TempDir & "\Dos~.bat")
EndFunc ;==>Printf
;===============================================================================
;
; Description: :Create Smooth a Line
; Parameter(s): :$x1, $y1, $x2, $y2, $size, $colo
; Requirement: :-
; Return Value(s): :-
; User CallTip: :-
; Author(s): :Pastl(setup.exe)
; Note(s): :It's not from me!
;
;===============================================================================
Func GUICtrlCreateLine($x1, $y1, $x2, $y2, $size, $color)
If $x1 <> $x2 Then
$coeff_line = ($y2 - $y1) / ($x2 - $x1)
$p = $y2 - ($coeff_line * $x2)
For $a = $x1 To $x2 Step $size
GUICtrlSetBkColor(GUICtrlCreateLabel("", $a, ($a * $coeff_line) + $p, $size, $size), $color)
Sleep(10)
Next
Else
For $a = $y1 To $y2 Step $size
GUICtrlSetBkColor(GUICtrlCreateLabel("", $x1, $a, $size, $size), $color)
Sleep(10)
Next
EndIf
EndFunc ;==>GUICtrlCreateLine
;===============================================================================
;
; Description: :Download a File
; Parameter(s): :$site,$punkt
; Requirement: :-
; Return Value(s): :-
; User CallTip: :-
; Author(s): :GtaSpider
; Note(s): :-
;
;===============================================================================
Func _FileDownload($site, $punkt)
$orisize = InetGetSize($site)
InetGet($site, $punkt, 1, 1)
ProgressOn("Download", "")
Do
$size1 = FileGetSize($punkt)
$MBsize1 = FileGetSize($punkt)
$Prozent = (100 * @InetGetBytesRead) / $orisize
$decimalplace = Round($Prozent)
$decimalplaceMBsize1 = Round(@InetGetBytesRead / 1024)
If $decimalplace = "1.#QNAN" Then
Return SetError(1)
EndIf
ProgressSet($Prozent, $decimalplace & "% " & "(" & $decimalplaceMBsize1 & ") Kb has been Downloaded.")
Until $Prozent = 100
ProgressOff()
Run("explorer.exe """ & $punkt)
EndFunc ;==>_FileDownload
;===============================================================================
;
; Description: :Run a Internet Explorer with a Site
; Parameter(s): :$site
; Requirement: :-
; Return Value(s): :-
; User CallTip: :-
; Author(s): :GtaSpider
; Note(s): :It will open the IEplore.exe
;
;===============================================================================
Func _URL($site)
$oIE = ObjCreate("InternetExplorer.Application.1")
$SinkObject = ObjEvent($oIE, "IEEvent_", "DWebBrowserEvents2")
$oIE.Visible = 1
$oIE.RegisterAsDropTarget = 1
$oIE.RegisterAsBrowser = 1
$oIE.Navigate ($site)
EndFunc ;==>_URL
;===============================================================================
;
; Description: :Speach a Text in English
; Parameter(s): :$sText
; Requirement: :-
; Return Value(s): :-
; User CallTip: :-
; Author(s): :GtaSpider
; Note(s): :-
;
;===============================================================================
Func _Speach($sText)
$sprache = ObjCreate("SAPI.SpVoice")
$sprache.Speak ($sText)
EndFunc ;==>_Speach
;===============================================================================
;
; Description: :Get the Revision Number!
; Parameter(s): :-
; Requirement: :-
; Return Value(s): :Revision Number of CPU
; User CallTip: :-
; Author(s): :GtaSpider
; Note(s): :-
;
;===============================================================================
Func _GetRevision()
$run = Run(@ComSpec & " /c echo %PROCESSOR_REVISION%", "", @SW_HIDE, 6)
$stdoutread = StdoutRead($run)
If Not @error = -1 Then $outread = $stdoutread
$stderrRead = StderrRead($run)
If Not @error = -1 Then $outread = $stderrRead
Return StringTrimLeft($outread, 1)
EndFunc ;==>_GetRevision
Alles anzeigen
P.S.: kleiner bug gefunden: wenn man auf erweitender Modus geht und dann auf Code drückt kommt so wie es soll {CODE} wenn ich dann später noch mal auf code drücke, kommt aber nicht [/CODE], sonst ein Super forum :UP: