Öffne doch einfach eine CMD Box und gibt Zeile 1 / 5 ein...
Gruß,
UEZ
Öffne doch einfach eine CMD Box und gibt Zeile 1 / 5 ein...
Gruß,
UEZ
Ich habe letztens ein Tool für die Firma programmiert, wo ich eine MySQL Datenbank ausgelesen habe und mich wunderte, warum das Tool so unterschiedlich lange benötigt, bis es startet.
Grund war eben immer der Download der DLL.
Hier der Code aus SQLite.au3
[autoit]
Func __SQLite_Download_SQLite3File(ByRef $sFilePath, $sFileName, $sVersion, $sFileExt, $bDownload = False, $iScripLineNumber = @ScriptLineNumber)
Local $sRetFile = $sFileName & $sVersion & $sFileExt
Local $sTempfile = $sFilePath & $sRetFile
If $bDownload And FileExists($sTempfile) Then Return $sTempfile
Local $sURL = "http://www.autoitscript.com/autoit3/files/beta/autoit/archive/sqlite/"
Local $iInetRet = InetGet($sURL & $sRetFile, $sTempfile, $INET_FORCERELOAD)
Local $iError = @error
If @error And StringInStr($sTempfile, @SystemDir) Then
$sFilePath = @TempDir & "\"
$sTempfile = _TempFile(@TempDir, "~", ".dll")
_ArrayAdd($__g_aTempFiles_SQLite, $sTempfile)
OnAutoItExitRegister("_SQLite_Shutdown") ; in case the script exit without calling _SQLite_Shutdown()
$iInetRet = InetGet($sURL & $sRetFile, $sTempfile, $INET_FORCERELOAD)
$iError = @error
Local $iPos = StringInStr($sTempfile, "\", 0, -1)
$sRetFile = StringTrimLeft($sTempFile, $iPos)
EndIf
If $iError Then __SQLite_Print('@@ Debug(' & $iScripLineNumber & ') : __SQLite_Download_SQLite3File : $URL = ' & $sURL & $sFileName & $sFileExt & @CRLF & @TAB & '$sTempfile = ' & $sTempfile & @CRLF & '>Error: ' & $iError & @CRLF)
Local $sModifiedTime = Call('__SQLite_Inline_Modified')
If Not @error Then FileSetTime($sTempfile, $sModifiedTime, 0) ; update filetime if defined
Return SetError($iError, $iInetRet, $sRetFile)
EndFunc ;==>__SQLite_Download_SQLite3File
Am Besten die DLL in das Skript integrieren...
Gruß,
UEZ
@UEZ, woher kommt der Codegenerator?
Guckst du hier: File to Base64 String Code Generator v1.20 Build 2015-01-20
Gruß,
UEZ
Hier die SQLite3.dll als Binärstring:
Gruß,
UEZ
Probiere es mal damit:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <StaticConstants.au3>
#include <Array.au3>
#include <IE.au3>
$Haus1 = 1
$Haus2 = 1
$Haus3 = 1
$Haus4 = 1
$Baum1 = 1
$Baums1 = 1
Global $MAP
func _map_kulsav()
$MAP = GUICtrlCreatePic("kulsav.bmp", 0, 0, 850, 600) ; Map
$Haus1 = GUICtrlCreatePic("Haus1_wiese.bmp", 640, 35, 116, 156) ; Oben rechts
$Haus2 = GUICtrlCreatePic("Haus1_wiese.bmp", 99, 60, 116, 156) ; Oben Links
$Haus3 = GUICtrlCreatePic("Haus1_wiese.bmp", 99, 322, 116, 156) ; Unten Links
$Haus4 = GUICtrlCreatePic("Haus1_wiese.bmp", 640, 322, 116, 156) ; Unten Rechts
$Baum1 = GUICtrlCreatePic("Baum_wiese.bmp", 272, 216, 108, 124) ; Baum 1
GUICtrlSetState($MAP, $GUI_DISABLE)
EndFunc
Func _baum1()
GUICtrlDelete($Baum1)
GUICtrlSetState($MAP, $GUI_ENABLE)
$Baums1 = GUICtrlCreatePic("Baumstamm_wiese.bmp", 296, 304, 52, 36) ; Baumstamm 1
GUICtrlSetState($MAP, $GUI_DISABLE)
EndFunc
$TG = GUICreate("The Cold", 850, 600, -1, -1, BitOR($WS_MAXIMIZEBOX,$WS_SYSMENU,$WS_POPUP,$WS_TABSTOP))
GUISetBkColor(0x000000)
$Start = GUICtrlCreateButton("Start", 350, 16, 163, 57)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlSetColor(-1,0xff0000)
$Profil = GUICtrlCreateButton("Profil", 350, 88, 163, 57)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlSetColor(-1,0xff0000)
$Exit = GUICtrlCreateButton("Exit", 350, 160, 163, 57)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlSetColor(-1,0xff0000)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $Exit
Exit
;;;;;;;;;;;;;;;;;;;;;;;; START ;;;;;;;;;;;;;;;;;;;;
Case $start
GUICtrlDelete($Start)
GUICtrlDelete($Profil)
GUICtrlDelete($Exit)
_map_kulsav()
$Exit = GUICtrlCreateButton("X", 808, 0, 27, 25)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlSetColor(-1,0xff0000)
Case $Haus1
MsgBox(0,"x","x1")
Case $Haus2
MsgBox(0,"x","x2")
Case $Haus3
MsgBox(0,"x","x3")
Case $Haus4
MsgBox(0,"x","x4")
Case $Baum1
_baum1()
EndSwitch
WEnd
Gruß,
UEZ
Bitte sehr wakillon.
Merci.
Gruß,
UEZ
Funzt auch bei mir auf meiner Fritz!Box 7362 SL.
Gruß,
UEZ
@UEZ
Gute Umsetzung.
Nur was ist, wenn eine Zeile zwei mal vorhanden ist, dann wird nur der erste Treffer ersetzt.Die Nachtmaus im Nachtmodus
_ArraySearch findet leider nur den ersten Eintrag, aber man kann die Funktion ZeileSuchenUndErsetzen() solange aufrufen, bis nichts mehr gefunden wird.
Gruß,
UEZ ![]()
Dann probiere mal dies aus:
[autoit]#include <Array.au3>
$sTest = "Zeile1" & @CRLF & _
"Zeile2" & @CRLF & _
"Zeile3" & @CRLF & _
"Zeile4" & @CRLF & _
"Zeile5" & @CRLF & _
"Zeile6"
$hFile = FileOpen(@ScriptDir & "\Settings.txt", 2)
FileWrite($hFile, $sTest)
FileClose($hFile)
ZeileSuchenUndErsetzen(@ScriptDir & "\Settings.txt", "Zeile4", "Zeile444")
[/autoit][autoit][/autoit][autoit]Func ZeileSuchenUndErsetzen($sDatei, $sZeileSuchen, $sErsetzen, $bUeberschreiben = True)
Local $aZeilen = FileReadToArray($sDatei)
If Not IsArray($aZeilen) Or UBound($aZeilen) < 2 Then Return SetError(1, 0, "")
Local $iPos = _ArraySearch($aZeilen, $sZeileSuchen)
If Not $iPos Then Return SetError(2, 0, "")
$aZeilen[$iPos] = $sErsetzen
Local $sNeu = _ArrayToString($aZeilen, @CRLF)
If $bUeberschreiben Then
Local $hFile = FileOpen($sDatei, 2)
If @error Then Return SetError(3, 0, "")
FileWrite($hFile, $sNeu)
FileClose($hFile)
EndIf
Return $sNeu
EndFunc
_FileWriteToLine macht im Prinzip das Gleiche...
Gruß,
UEZ
Probiere mal
[autoit]Runas ("Benutzername", "Domäne", "Kennwort", 0, '"C:\Program Files\WinRAR\WinRAR.exe"')
[/autoit]Gruß,
UEZ
FileReadLine
FileWriteLine
könnten dir helfen.
Gruß,
UEZ
Probiere mal dies aus: Network Interface Info, Statistics, and Traffic oder Traffic Metter
Gruß,
UEZ
Es kommt auf die Anwendung an. Z.B. kannst du _ArrayDisplay in einer WM Funktion vergessen, wenn du ein Array debuggen willst.
Oder du könntest den Output in eine Datei "pumpen", etc.
Du könntest auch die Ausgabe mit $iItemLimit limitieren, wobei momentan nicht ein Bereich angegeben werden kann.
64D erinnert mich an Analysis über den R^n Raum...arbeite daran. ![]()
Gruß,
UEZ
Freut mich, dass euch die UDF gefallen hat.
Manchmal sehr nützlich...
Gruß,
UEZ
Hier eine kleine UDF, um ein Array in der Console auszugeben.
_ArrayDisplayConsole:
#include-once
#include <String.au3>
; #FUNCTION# ====================================================================================================================
; Name ..........: _ArrayDisplayConsole
; Description ...: Displays given 1D or 2D array in the console only
; Syntax ........: _ArrayDisplayConsole($avArray[, $iColumnWidth = 24[, $iItemLimit = -1[, $bDisplayCRNo = True[,
; $bDisplayValueBorders = False[, $sValueBorderChar = "*"[, $bShowBorder = False[, $sBorderChar = "|"[,
; $bCenter = False]]]]]]]])
; Parameters ....: $avArray - Array to display
; $iColumnWidth - [optional] String length of each cell
; $iItemLimit - [optional] Maximum number of lines (rows) to show
; $bDisplayCRNo - [optional] Display column / row numbers
; $bDisplayValueBorders - [optional] Display border around the array value to see any white space
; $sValueBorderChar - [optional] value border character
; $bShowBorder - [optional] show the border of the cell
; $sBorderChar - [optional] border of the cell
; $bCenter - [optional] center the text in the columns
; Return values .: Success - 1
; Failure - 0, sets @error:
; | 1 - $avArray is not an array
; | 2 - $avArray has too many dimensions (only up to 2D supported)
; Author ........: UEZ
; Version .......: 0.92 build 2015-01-25 beta
; Modified ......:
; Remarks .......: If an array is found within the array it will be displayed as [ARRAY PTR]
; Related .......: UBound, IsArray, StringFormat, StringLeft, StringLen, ConsoleWrite
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func _ArrayDisplayConsole($avArray, $iColumnWidth = 24, $iItemLimit = -1, $bDisplayCRNo = True, $bDisplayValueBorders = False, $sValueBorderChar = "*", $bShowBorder = False, $sBorderChar = "|", $bCenter = False)
If Not IsArray($avArray) Then Return SetError(1, 0, 0)
Local $iDimension = UBound($avArray, 0), $iUBound = UBound($avArray, 1) - 1, $iSubMax = UBound($avArray, 2) - 1
If $iDimension > 2 Then Return SetError(2, 0, 0)
If $iColumnWidth < 1 Or $iColumnWidth = Default Then $iColumnWidth = 24
Local $iH, $iW, $iLenUBound = StringLen($iUBound), $sText, $iBorder = 1, $sArray = "[ARRAY PTR]"
If $bShowBorder Then
$iBorder = 0
Else
$sBorderChar = ""
EndIf
If $bDisplayCRNo And $iSubMax > -1 Then
ConsoleWrite(StringFormat("%-" & $iLenUBound + 2 & "s", " "))
For $iW = 0 To $iSubMax
$sText = "[" & StringLeft($iW, $iColumnWidth) & "]"
Switch $bCenter
Case True
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", _StringRepeat(" ", $iColumnWidth / 2 - 1) & $sText) & $sBorderChar )
Case False
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", $sText) & $sBorderChar)
EndSwitch
Next
ConsoleWrite(@CRLF)
EndIf
If $iItemLimit > 0 Then $iUBound = $iItemLimit - 1
Switch $iDimension
Case 1
For $iH = 0 To $iUBound
If $bDisplayCRNo Then ConsoleWrite(StringFormat("[%0" & $iLenUBound & "s] ", StringLeft($iH, $iColumnWidth)))
If $bDisplayValueBorders Then
Switch IsArray($avArray[$iH])
Case False
$sText = $sValueBorderChar & StringLeft($avArray[$iH], $iColumnWidth) & $sValueBorderChar
Case True
$sText = StringLeft($sArray, $iColumnWidth) & $sValueBorderChar
EndSwitch
Switch $bCenter
Case True
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", _StringRepeat(" ", ($iColumnWidth - StringLen($sText) + $sBorderChar) / 2) & $sText) & $sBorderChar)
Case False
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", $sText) & $sBorderChar)
EndSwitch
Else
Switch IsArray($avArray[$iH])
Case False
$sText = StringLeft($avArray[$iH], $iColumnWidth)
Case True
$sText = StringLeft($sArray, $iColumnWidth)
EndSwitch
Switch $bCenter
Case True
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", _StringRepeat(" ", ($iColumnWidth - StringLen($sText) + $sBorderChar) / 2) & $sText) & $sBorderChar)
Case False
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", $sText) & $sBorderChar)
EndSwitch
EndIf
ConsoleWrite(@CRLF)
Next
Case 2
For $iH = 0 To $iUBound
If $bDisplayCRNo Then ConsoleWrite(StringFormat("[%0" & $iLenUBound & "s]", StringLeft($iH, $iColumnWidth)))
For $iW = 0 To $iSubMax
If $bDisplayValueBorders Then
Switch IsArray($avArray[$iH][$iW])
Case False
$sText = $sValueBorderChar & StringLeft($avArray[$iH][$iW], $iColumnWidth) & $sValueBorderChar
Case True
$sText = $sValueBorderChar & StringLeft($sArray, $iColumnWidth) & $sValueBorderChar
EndSwitch
Switch $bCenter
Case True
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", _StringRepeat(" ", ($iColumnWidth - StringLen($sText) + 1) / 2) & $sText) & $sBorderChar)
Case False
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", $sText) & $sBorderChar)
EndSwitch
Else
Switch IsArray($avArray[$iH][$iW])
Case False
$sText = StringLeft($avArray[$iH][$iW], $iColumnWidth)
Case True
$sText = StringLeft($sArray, $iColumnWidth)
EndSwitch
Switch $bCenter
Case True
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", _StringRepeat(" ", ($iColumnWidth - StringLen($sText) + 1) / 2) & $sText) & $sBorderChar)
Case False
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", $sText) & $sBorderChar)
EndSwitch
EndIf
Next
ConsoleWrite(@CRLF)
Next
EndSwitch
ConsoleWrite(@CRLF)
Return 1
EndFunc
Beispiel:
[autoit]
#include "_ArrayDisplayConsole.au3"
Global $avArray0[1] = ["Test"]
[/autoit][autoit][/autoit][autoit]Global $avArray1[3][5] = [["Andy", "Eukalyptus", "BugFix", "Oscar", "minx"], _
["Tweaky", "AsperinJunkie", "pee", "", $avArray0], _
["water", "Sprenger120", "chesstiger", "GunFood", "Techmix"]]
_ArrayDisplayConsole($avArray1, 28, -1, True, False, "*", True, "|", True)
[/autoit][autoit][/autoit][autoit]ConsoleWrite(@CRLF)
[/autoit][autoit][/autoit][autoit]Global $avArray2[6] = ["Cheater Dieter", "Mars", $avArray0, "funkey", "name22", "Raupi"]
_ArrayDisplayConsole($avArray2, 15)
Global $avArray3 = StringSplit(WinGetClassList("", ""), @LF)
_ArrayDisplayConsole($avArray3, 20)
Gruß,
UEZ
Habe leider keinen Full HD Monitor... ![]()
Gruß,
UEZ
Das Ganze ein bissl bunt:
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
#include <GDIPlus.au3>
#include <GUIConstants.au3>
Opt('GUIOnEventMode', 1)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]; > Hier kannst du herumspielen! ![]()
Global Const $iWidth = 1024
Global Const $iHeight = 768
Global Const $fA = -70
Global Const $fB = 100
Global Const $fC = -100
Global Const $iNum = 100000
Func Term($fA, $fB, $fC, $fX, $fY)
Return $fY - SIGN($fX) * Abs($fB * $fX - $fC) ^ 0.5
EndFunc
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]Global Const $fU = $iWidth / 2
Global Const $fV = $iHeight / 2
Global $hGUI, $hGraphics, $i, $fX, $fY, $fX2, $fY2, $iR, $iG, $iB
[/autoit] [autoit][/autoit] [autoit]; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate('Hüpfer [Make-Grafik]', $iWidth, $iHeight)
GUISetOnEvent($GUI_EVENT_CLOSE, GUI_EVENT_CLOSE)
GUISetState()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBrush = _GDIPlus_BrushCreateSolid(0)
_GDIPlus_GraphicsClear($hGraphics, 0xFF181818)
[/autoit] [autoit][/autoit] [autoit]; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]For $i = 1 To $iNum
_GDIPlus_GraphicsFillRect($hGraphics, $fU + $fX, $fV + $fY, 1, 1, $hBrush)
$fX2 = Term($fA, $fB, $fC, $fX, $fY)
$fY2 = $fA - $fX
$fX = $fX2
$fY = $fY2
$iR = 0x10000 * Int(Abs($fY) > 0xFF ? 0xFF : Abs($fY))
$iG = 0x100 * Int(Abs($fY2) > 0xFF ? 0xFF : Abs($fY2))
$iB = Int(Abs($fX) > 0xFF ? 0xFF : Abs($fX))
_GDIPlus_BrushSetSolidColor($hBrush, 0x80000000 + $iR + $iG + $iB)
Next
ConsoleWrite('! Finish' & @CRLF)
[/autoit] [autoit][/autoit] [autoit]While Sleep(1000)
WEnd
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]Func SIGN($fValue)
Return ($fValue < 0 ? -1 : ($fValue > 0) ? 1 : 0)
EndFunc
Func GUI_EVENT_CLOSE()
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_Shutdown()
Exit
EndFunc
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit]Danke für's Teilen!
Gruß,
UEZ
Schaue dir doch mal in der Hilfedatei _WinAPI_ShellExtractIcon an.
Gruß,
UEZ
Ich will meine Version einfach auch mal posten:
[autoit]
Global $aZahlen = FillArray()
Global $iSumme = 0
For $i = 0 To UBound($aZahlen) - 1
ConsoleWrite($aZahlen[$i] & @CRLF)
$iSumme += $aZahlen[$i]
Next
ConsoleWrite("Summe = " & $iSumme & @CRLF)
Func FillArray($iZahlen = 8, $iMax = 50)
Local $aZahlen[$iZahlen], $iSumme = Random(1, Int(($iMax - $iZahlen) / $iZahlen), 1), $i = 1
$aZahlen[0] = $iSumme
Do
$r = Random(1, Int(($iMax - $iSumme - $i) / 2) < 2 ? 2 : Int(($iMax - $iSumme - $i) / 2), 1)
If $r + $iSumme < $iMax Then
$iSumme += $r
$aZahlen[$i] = $r
$i += 1
EndIf
Until $i = $iZahlen
If $iMax - $iSumme Then $aZahlen[Random(0, $iZahlen - 1, 1)] += $iMax - $iSumme
Return $aZahlen
EndFunc
Keine Ahnung wie die Normalverteilung aussieht.
Gruß,
UEZ
Update auf v0.98 build 2015-01-15 beta:
Gruß,
UEZ