1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. UEZ

Beiträge von UEZ

  • Netzwerk Adapter Informationen nach Adapthername

    • UEZ
    • 6. August 2013 um 13:08

    Probiere es mal damit:

    [autoit]


    #include <Array.au3>
    #include <Constants.au3>

    [/autoit][autoit][/autoit][autoit]

    $aResult = ParseIPConfig("Wireless Network Connection") ;hier den Namen des Netzwerkadapters eintragen
    _ArrayDisplay($aResult)

    [/autoit][autoit][/autoit][autoit]

    Func ParseIPConfig($sAdaptername, $bAll = True) ;coded by UEZ 2013
    Local $sLines, $sAll = "/all"
    If Not $bAll Then $sAll = ""
    Local $iPID = Run(@ComSpec & " /c ipconfig.exe " & $sAll, @SystemDir, @SW_HIDE, $STDERR_MERGED)
    While True
    $sLines &= StdoutRead($iPID)
    If @error Then ExitLoop
    WEnd
    If Not $sLines Then Return SetError(1, 0, 0)
    Local $i = 1, $a, $aa, $aResult[100][2]
    $a = StringRegExp($sLines, "(?m)" & $sAdaptername & ":\s*(\v.*){0}", 3)
    If @error Then Return SetError(2, 0, 0)
    $aResult[0][0] = StringStripWS($a[0], 7)
    Do
    $a = StringRegExp($sLines, "(?m)" & $sAdaptername & ":\s*(\v.*){" & $i & "}", 3)
    $aa = StringRegExp($a[0], "(?i)\s*(.*\w).*\s*:\s(.*)", 3)
    If @error then ExitLoop
    $aResult[$i][0] = StringStripWS($aa[0], 7)
    $aResult[$i][1] = StringStripWS($aa[1], 7)
    $i += 1
    Until False
    ReDim $aResult[$i][2]
    Return $aResult
    EndFunc

    [/autoit]

    Getested auf WinXP Ger und Win7 US.

    Gruß,
    UEZ

  • GUIRegisterMsg($WM_KEYDOWN, ...) funktioniert nicht. KEYUP geht.

    • UEZ
    • 4. August 2013 um 02:29

    Probiere es mal mit Subclassing:

    [autoit]


    #include <Constants.au3>
    #include <GUIConstants.au3>
    #include <WindowsConstants.au3>
    #include <WinAPI.au3>

    [/autoit][autoit][/autoit][autoit]

    Opt("GUIOnEventMode", 1)

    [/autoit][autoit][/autoit][autoit]

    $GUI = GUICreate("GUI", 960, 540, Default, Default)
    GUISetState(@SW_SHOW)

    [/autoit][autoit][/autoit][autoit]

    $hCallback = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
    $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hCallback), _WinAPI_GetModuleHandle(0))

    [/autoit][autoit][/autoit][autoit]

    GUISetOnEvent($GUI_EVENT_CLOSE, "Event_Close")

    [/autoit][autoit][/autoit][autoit]

    While 1
    Sleep(100)
    WEnd

    [/autoit][autoit][/autoit][autoit]

    Func _KeyProc($nCode, $wParam, $lParam) ;subclassing
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
    Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
    Switch $wparam
    Case $WM_KEYUP
    If DllStructGetData($tKEYHOOKS, "vkCode") = 0x0D Then ConsoleWrite("Enter wurde losgelassen." & @CRLF)
    Case $WM_KEYDOWN
    If DllStructGetData($tKEYHOOKS, "vkCode") = 0x0D Then ConsoleWrite("Enter wurde gedrückt." & @CRLF)
    EndSwitch
    Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func Event_Close()
    _WinAPI_UnhookWindowsHookEx($hHook)
    DllCallbackFree($hCallback)
    GUIDelete()
    Exit
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 1. August 2013 um 13:16

    Hi eukalyptus,

    warum hast du in der _BM_Struct() Funktion noch eine For/Next Schleife vor der Struct Schleife eingebaut?

    Ich habe noch Do/Until, If/Then/Else und Switch/Case hinzugefügt:
    Benchmark.au3

    Spoiler anzeigen
    [autoit]


    If $CmdLine[0] <> 1 Or $CmdLine[1] <> "1" Then Exit

    [/autoit] [autoit][/autoit] [autoit]

    Global $sPath_Ini = @ScriptDir & "\Benchmark.ini"

    [/autoit] [autoit][/autoit] [autoit]

    Global $iLoop = Number(IniRead($sPath_Ini, "Loop", "Cnt", "0"))

    [/autoit] [autoit][/autoit] [autoit]

    _BM_IfThenElse($iLoop)
    _BM_SwitchCase($iLoop)
    _BM_For($iLoop)
    _BM_While($iLoop)
    _BM_Do($iLoop)
    _BM_Array($iLoop)
    _BM_Struct($iLoop)
    _BM_Add($iLoop)
    _BM_Sqrt($iLoop)

    [/autoit] [autoit][/autoit] [autoit]

    Func _BM_SwitchCase($iLoop)
    Local $iTimer, $fTime, $iI, $a = 10, $b = 20, $r
    $iI = 1
    $iTimer = TimerInit()
    Do
    Switch $a * $b
    Case 1 To 10
    $r = True
    Case 11 to 100
    $r = False
    Case Else
    $r = -1
    EndSwitch
    $iI += 1
    Until $iI > $iLoop
    $fTime = TimerDiff($iTimer)
    IniWrite($sPath_Ini, "SwitchCase", @AutoItVersion, $fTime)
    EndFunc ;==>_BM_SwitchCase

    [/autoit] [autoit][/autoit] [autoit]

    Func _BM_IfThenElse($iLoop)
    Local $iTimer, $fTime, $iI, $a = 1, $b = 2, $c = -3, $r
    $iI = 1
    $iTimer = TimerInit()
    Do
    If $a > $b Then
    $r = True
    ElseIf $a > $c Then
    $r = False
    Else
    $r = -1
    EndIf
    $iI += 1
    Until $iI > $iLoop
    $fTime = TimerDiff($iTimer)
    IniWrite($sPath_Ini, "IfThenElse", @AutoItVersion, $fTime)
    EndFunc ;==>_BM_IfThenElse

    [/autoit] [autoit][/autoit] [autoit]

    Func _BM_For($iLoop)
    Local $iTimer, $fTime
    $iTimer = TimerInit()
    For $i = 1 To $iLoop
    Next
    $fTime = TimerDiff($iTimer)
    IniWrite($sPath_Ini, "For", @AutoItVersion, $fTime)
    EndFunc ;==>_BM_For

    [/autoit] [autoit][/autoit] [autoit]

    Func _BM_While($iLoop)
    Local $iTimer, $fTime, $iI
    $iI = 1
    $iTimer = TimerInit()
    While $iI <= $iLoop
    $iI += 1
    WEnd
    $fTime = TimerDiff($iTimer)
    IniWrite($sPath_Ini, "While", @AutoItVersion, $fTime)
    EndFunc ;==>_BM_While

    [/autoit] [autoit][/autoit] [autoit]

    Func _BM_Do($iLoop)
    Local $iTimer, $fTime, $iI
    $iI = 1
    $iTimer = TimerInit()
    Do
    $iI += 1
    Until $iI > $iLoop
    $fTime = TimerDiff($iTimer)
    IniWrite($sPath_Ini, "Do", @AutoItVersion, $fTime)
    EndFunc ;==>_BM_Do

    [/autoit] [autoit][/autoit] [autoit]

    Func _BM_Struct($iLoop)
    Local $iTimer, $fTime, $fTime_Loop
    Local $tStruct = DllStructCreate("float[" & $iLoop & "]; float[" & $iLoop & "];")
    Local $fVal = 12345.6789
    $iTimer = TimerInit()
    For $i = 1 To $iLoop
    DllStructSetData($tStruct, 1, 123.45, $i)
    DllStructSetData($tStruct, 2, $fVal, $i)
    $fVal = DllStructGetData($tStruct, 1, $i)
    $fVal = DllStructGetData($tStruct, 2, $i)
    Next
    $fTime = TimerDiff($iTimer)
    IniWrite($sPath_Ini, "Struct", @AutoItVersion, $fTime)
    EndFunc ;==>_BM_Struct

    [/autoit] [autoit][/autoit] [autoit]

    Func _BM_Array($iCnt)
    Local $iTimer, $fTime, $fTime_Loop
    Local $aArray[$iCnt + 1][2]
    Local $iVal = 123456
    $iTimer = TimerInit()
    For $i = 1 To $iCnt
    Next
    $fTime_Loop = TimerDiff($iTimer)
    $iTimer = TimerInit()
    For $i = 1 To $iCnt
    $aArray[$i][0] = 1234
    $aArray[$i][1] = $iVal
    $iVal = $aArray[$i][0]
    $iVal = $aArray[$i][1]
    Next
    $fTime = TimerDiff($iTimer) - $fTime_Loop
    IniWrite($sPath_Ini, "Array", @AutoItVersion, $fTime)
    EndFunc ;==>_BM_Array

    [/autoit] [autoit][/autoit] [autoit]

    Func _BM_Add($iCnt)
    Local $iTimer, $fTime, $fTime_Loop
    Local $iVal = 1
    $iTimer = TimerInit()
    For $i = 1 To $iCnt
    Next
    $fTime_Loop = TimerDiff($iTimer)
    $iTimer = TimerInit()
    For $i = 1 To $iCnt
    $iVal += 1
    Next
    $fTime = TimerDiff($iTimer) - $fTime_Loop
    IniWrite($sPath_Ini, "Add", @AutoItVersion, $fTime)
    EndFunc ;==>_BM_Add

    [/autoit] [autoit][/autoit] [autoit]

    Func _BM_Sqrt($iCnt)
    Local $iTimer, $fTime, $fTime_Loop
    Local $iVal = 1
    $iTimer = TimerInit()
    For $i = 1 To $iCnt
    Next
    $fTime_Loop = TimerDiff($iTimer)
    $iTimer = TimerInit()
    For $i = 1 To $iCnt
    $iVal = Sqrt($i)
    Next
    $fTime = TimerDiff($iTimer) - $fTime_Loop
    IniWrite($sPath_Ini, "Sqrt", @AutoItVersion, $fTime)
    EndFunc ;==>_BM_Sqrt

    [/autoit]

    Stable_vs_Beta.au3

    Spoiler anzeigen
    [autoit]


    Global $sRegKey = "HKEY_LOCAL_MACHINE64\SOFTWARE\"
    If @OSArch <> "X86" Then $sRegKey &= "Wow6432Node\"
    Global $sPath_Stable = RegRead($sRegKey & "AutoIt v3\AutoIt", "InstallDir")
    Global $sVersion_Stable = StringTrimLeft(RegRead($sRegKey & "AutoIt v3\AutoIt", "Version"), 1)
    Global $sPath_Beta = RegRead($sRegKey & "AutoIt v3\AutoIt", "betaInstallDir")
    Global $sVersion_Beta = StringTrimLeft(RegRead($sRegKey & "AutoIt v3\AutoIt", "betaVersion"), 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global $sPath_Ini = @ScriptDir & "\Benchmark.ini"
    If FileExists($sPath_Ini) Then FileDelete($sPath_Ini)

    [/autoit] [autoit][/autoit] [autoit]

    IniWrite($sPath_Ini, "Version", "Stable", $sVersion_Stable)
    IniWrite($sPath_Ini, "Version", "Beta", $sVersion_Beta)

    [/autoit] [autoit][/autoit] [autoit]

    IniWrite($sPath_Ini, "Loop", "Cnt", 300000)

    [/autoit] [autoit][/autoit] [autoit]

    RunWait($sPath_Stable & '\AutoIt3.exe "' & @ScriptDir & '\Benchmark.au3" "1"')
    RunWait($sPath_Beta & '\AutoIt3.exe "' & @ScriptDir & '\Benchmark.au3" "1"')

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _Compare("IfThenElse")
    _Compare("SwitchCase")
    _Compare("For")
    _Compare("While")
    _Compare("Do")
    _Compare("Array")
    _Compare("Struct")
    _Compare("Add")
    _Compare("Sqrt")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Compare($sBM = "Array")
    Local $fTime_Stable = IniRead($sPath_Ini, $sBM, $sVersion_Stable, "0")
    Local $fTime_Beta = IniRead($sPath_Ini, $sBM, $sVersion_Beta, "0")
    ConsoleWrite("! " & StringFormat("%-10s: %.2f%% (%.2fms : %.2fms)\n", $sBM, $fTime_Beta * 100 / $fTime_Stable, $fTime_Stable, $fTime_Beta))
    EndFunc ;==>_Compare

    [/autoit]


    Meine Ergebnisse:

    3.3.8.1

    Code
    ! IfThenElse: 103.34%   (611.97ms : 632.43ms)
    ! SwitchCase: 106.36%   (651.39ms : 692.79ms)
    ! For       : 170.99%   (14.12ms : 24.15ms)
    ! While     : 107.04%   (184.22ms : 197.20ms)
    ! Do        : 111.15%   (185.96ms : 206.68ms)
    ! Array     : 124.89%   (933.42ms : 1165.77ms)
    ! Struct    : 107.02%   (2071.65ms : 2217.10ms)
    ! Add       : 115.99%   (53.15ms : 61.65ms)
    ! Sqrt      : 111.28%   (171.91ms : 191.29ms)

    3.3.9.13:

    Code
    ! IfThenElse: 100.18%   (621.49ms : 622.60ms)
    ! SwitchCase: 107.36%   (644.95ms : 692.42ms)
    ! For       : 180.21%   (13.54ms : 24.39ms)
    ! While     : 106.94%   (182.92ms : 195.62ms)
    ! Do        : 103.35%   (186.43ms : 192.67ms)
    ! Array     : 131.40%   (887.30ms : 1165.89ms)
    ! Struct    : 146.73%   (2065.47ms : 3030.73ms)
    ! Add       : 109.88%   (55.39ms : 60.86ms)
    ! Sqrt      : 175.79%   (175.75ms : 308.95ms)


    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 31. Juli 2013 um 16:03

    Meine Rede im Post#53.

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 31. Juli 2013 um 14:09

    Good catch eukalyptus!


    Ich habe den Benchmark oben in do/until umgewandelt und es sieht so aus, als ob dann die Beta auch "gleich" schnell läuft.

    [autoit]


    $j = 0
    $iMax = 50000000
    $t = TimerInit()
    For $i = 0 To $iMax
    $j += 1
    Next
    $fEnd = TimerDiff($t) / 1000
    ConsoleWrite(StringFormat("%.2f seconds.", $fEnd) & @LF)

    [/autoit]

    3.3.8.1: 10.85 seconds.
    3.3.9.13: 13.17 seconds.

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 24. Juli 2013 um 15:08

    Ich war so frei und habe deine AutoIt-only 3D Engine genommen und ein Benchmark Mode hinzugefügt.

    Es werden 3000 Frames gerendert.

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_Compile_Both=y
    #AutoIt3Wrapper_UseUpx=n

    [/autoit] [autoit][/autoit] [autoit]

    #include <Date.au3>
    #include <File.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUIOnEventMode", 1)
    HotKeySet("{ESC}", "quit")

    [/autoit] [autoit][/autoit] [autoit]

    StartUp(800, 600, False, 0, 0, 0, 0, 0, 0, 900, 999, 0.5, 1)

    [/autoit] [autoit][/autoit] [autoit]

    $sModel = "Cylinder.3DA"
    LoadModel()

    [/autoit] [autoit][/autoit] [autoit]

    CalculateShadingFactors()
    AdlibRegister("FPS", 1000)

    [/autoit] [autoit][/autoit] [autoit]

    $bBenchmark = True
    $ZoomAnimator = 0.1
    #forcedef $hGraphics, $Width, $Height, $RotX, $RotY, $RotZ, $TransX, $TransY, $TransZ, $Zm, $iFPS, $VerNum, $LineNum
    $iFramesRendered = 0
    $iMaxFrames = 2999
    $iTimer = TimerInit()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $hBuffer = $hGraphics
    $hGraphics = GUICtrlCreateGraphic(0, 0, $Width, $Height)
    $RotX += 1
    $RotY += 1
    $RotZ += 1
    $Zm += $ZoomAnimator
    If $RotX > 360 Then $RotX = -355
    If $RotY > 360 Then $RotY = -355
    If $RotZ > 360 Then $RotZ = -355
    If $Zm > 960 Or $Zm < 900 Then $ZoomAnimator *= -1
    CreateVertexArray() ; Create a safe-to-edit copy of all vertices
    Translate($TransX, $TransY, $TransZ) ; Change the postion of all vertices
    Rotate($RotX, $RotY, $RotZ) ; Rotate all vertices
    Zoom($Zm) ; Zoom!
    ApplyPerpective() ; Well...
    BackfaceCulling() ; Leave behind what is behind!
    DrawToBuffer() ; Display it
    $iFPS += 1
    GUICtrlDelete($hBuffer)
    $iFramesRendered += 1
    If $iFramesRendered > $iMaxFrames And $bBenchmark Then
    $sResult = Round($iFramesRendered / (TimerDiff($iTimer) / 1000), 2) & " fps in ø. Rendered frames: " & $iFramesRendered & ". Render time: " & Round((TimerDiff($iTimer) / 1000), 2) & " seconds"
    $sAU3Arch = "X86"
    $bAU3Arch = @AutoItX64
    $aMemStats = MemGetStats()
    If $bAU3Arch Then $sAU3Arch = "X64"
    $tChkAero = DllStructCreate("int;")
    DllCall("dwmapi.dll", "int", "DwmIsCompositionEnabled", "struct*", $tChkAero)
    $bAero = DllStructGetData($tChkAero, 1)
    $sFile = @ScriptDir & "\Benchmark_Results.txt"
    $hFile = FileOpen($sFile, 1)
    FileWrite($hFile, "Date:" & @TAB & @TAB & @TAB & _Now() & @CRLF & _
    "AutoIt Version:" & @TAB & @TAB & @AutoItVersion & @CRLF & _
    "AutoIt Exe Arch.:" & @TAB & $sAU3Arch & @CRLF & _
    "OS Version:" & @TAB & @TAB & @OSVersion & @CRLF & _
    "OS Arch.:" & @TAB & @TAB & @OSArch & @CRLF & _
    "Aero enabled:" & @TAB & @TAB & $bAero & @CRLF & _
    "CPU Model:" & @TAB & @TAB & WMI_GetCPUModel() & @CRLF & _
    "Video Model:" & @TAB & @TAB & WMI_GetVideoModel() & @CRLF & _
    "Physical Mem:" & @TAB & @TAB & Ceiling($aMemStats[1] / 1024^2) & " GB" & @CRLF & _
    "3D Model used:" & @TAB & @TAB & StringRegExpReplace($sModel, "\.\\(.*)", "$1") & " -> Contains: " & $VerNum + 1 & " vertices and " & $LineNum + 1 & " faces" & @CRLF & _
    "Result:" & @TAB & @TAB & @TAB & $sResult & @CRLF & @CRLF & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    FileClose($hFile)
    ShellExecute($sFile)
    Exit
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func StartUp($wi = 800, $he = 600, $Fs = False, $x = 0, $y = 0, $z = 0, $rx = 0, $ry = 0, $rz = 0, $zoom = 900, $dis = 1000, $shade = 0.5, $borders = True)
    If $Fs Then
    Global $Width = @DesktopWidth, $Height = @DesktopHeight
    $Style = 0x80000000
    $ExStyle = 34078736
    Else
    Global $Width = $wi, $Height = $he
    $Style = -1
    $ExStyle = 34078728
    EndIf
    Global $hGUI = GUICreate("", $Width, $Height, -1, -1, $Style, $ExStyle)
    GUISetOnEvent(-3, "quit")
    Global $hGraphics = GUICtrlCreateGraphic(0, 0, $Width, $Height)
    GUISetBkColor(0x404040)
    GUISetState()
    Global $PIover180 = ((ATan(1) * 4) / 180), $Ver[5000][3], $TempV[5000][3], $TempZ[5000], $TempLin[5000], $Lin[5000][24], $Zcol[5000]
    Global $Zcent1, $Zcent2, $TempNum, $LineNum, $VerNum, $Xa, $Ya, $Za, $iFPS, $Sa = $shade, $TransX = $x, $TransY = $y, $TransZ = $z, $RotX = $rx, $RotY = $ry, $RotZ = $rz, $Zm = $zoom, $ViewDis = $dis, $XOrigin = $Width / 2, $YOrigin = $Height / 2, $bLines = $borders
    EndFunc ;==>StartUp

    [/autoit] [autoit][/autoit] [autoit]

    Func DrawToBuffer()
    For $a = 0 To $TempNum
    $Zmin = $TempV[$Lin[$TempLin[$a]][1]][2]
    $Zmax = $TempV[$Lin[$TempLin[$a]][1]][2]
    For $t = 1 To $Lin[$TempLin[$a]][0]
    If $Zmin > $TempV[$Lin[$TempLin[$a]][$t]][2] Then $Zmin = $TempV[$Lin[$TempLin[$a]][$t]][2]
    If $Zmax < $TempV[$Lin[$TempLin[$a]][$t]][2] Then $Zmax = $TempV[$Lin[$TempLin[$a]][$t]][2]
    Next
    $z = $Zmax - $Zmin
    If $z > $Zcol[$a] Then $z = $Zcol[$a]
    $Col = ("0x" & Hex(Int($Lin[$TempLin[$a]][21] - ((($Lin[$TempLin[$a]][21] * $Sa) / $Zcol[$a]) * $z)), 2) & Hex(Int($Lin[$TempLin[$a]][22] - ((($Lin[$TempLin[$a]][22] * $Sa) / $Zcol[$a]) * $z)), 2) & Hex(Int($Lin[$TempLin[$a]][23] - ((($Lin[$TempLin[$a]][23] * $Sa) / $Zcol[$a]) * $z)), 2))
    If $bLines Then
    GUICtrlSetGraphic($hGraphics, 8, 0x000040, $Col)
    Else
    GUICtrlSetGraphic($hGraphics, 8, $Col, $Col)
    EndIf
    For $t = 1 To $Lin[$TempLin[$a]][0]
    If $t = 1 Then
    GUICtrlSetGraphic($hGraphics, 6, $TempV[$Lin[$TempLin[$a]][$t]][0], $TempV[$Lin[$TempLin[$a]][$t]][1])
    Else
    GUICtrlSetGraphic($hGraphics, 2, $TempV[$Lin[$TempLin[$a]][$t]][0], $TempV[$Lin[$TempLin[$a]][$t]][1])
    EndIf
    Next
    Next
    EndFunc ;==>DrawToBuffer

    [/autoit] [autoit][/autoit] [autoit]

    Func BackfaceCulling()
    If $LineNum = 0 Then Return 0
    $TempNum = -1
    For $a = 0 To $LineNum
    $Xmin1 = $TempV[$Lin[$a][1]][0]
    $Xmax1 = $Xmin1
    $Ymin1 = $TempV[$Lin[$a][1]][1]
    $Ymax1 = $Ymin1
    $Zmin1 = $TempV[$Lin[$a][1]][2]
    $Zmax1 = $Zmin1
    For $b = 1 To $Lin[$a][0]
    If $Xmin1 > $TempV[$Lin[$a][$b]][0] Then $Xmin1 = $TempV[$Lin[$a][$b]][0]
    If $Xmax1 < $TempV[$Lin[$a][$b]][0] Then $Xmax1 = $TempV[$Lin[$a][$b]][0]
    If $Ymin1 > $TempV[$Lin[$a][$b]][1] Then $Ymin1 = $TempV[$Lin[$a][$b]][1]
    If $Ymax1 < $TempV[$Lin[$a][$b]][1] Then $Ymax1 = $TempV[$Lin[$a][$b]][1]
    If $Zmin1 > $TempV[$Lin[$a][$b]][2] Then $Zmin1 = $TempV[$Lin[$a][$b]][2]
    If $Zmax1 < $TempV[$Lin[$a][$b]][2] Then $Zmax1 = $TempV[$Lin[$a][$b]][2]
    Next
    Local $b = 0, $DotProduct = ($TempV[$Lin[$a][3]][0] * (($TempV[$Lin[$a][1]][2] * $TempV[$Lin[$a][2]][1]) - ($TempV[$Lin[$a][1]][1] * $TempV[$Lin[$a][2]][2]))) + ($TempV[$Lin[$a][3]][1] * (($TempV[$Lin[$a][1]][0] * $TempV[$Lin[$a][2]][2]) - ($TempV[$Lin[$a][1]][2] * $TempV[$Lin[$a][2]][0]))) + ($TempV[$Lin[$a][3]][2] * (($TempV[$Lin[$a][1]][1] * $TempV[$Lin[$a][2]][0]) - ($TempV[$Lin[$a][1]][0] * $TempV[$Lin[$a][2]][1])))
    If $Xmin1 < 0 And $Xmax1 < 0 Then $b += 1
    If $Xmin1 > $Width And $Xmax1 > $Width Then $b += 1
    If $Ymin1 < 0 And $Ymax1 < 0 Then $b += 1
    If $Ymin1 > $Height And $Ymax1 > $Height Then $b += 1
    If $Zmin1 > $ViewDis Then $b += 1
    If $b <> 0 Then ContinueLoop
    If $DotProduct > 0 Then
    $TempNum = $TempNum + 1
    $TempLin[$TempNum] = $a
    $TempZ[$a] = ($Zmax1 - $Zmin1) / 2 + $Zmin1
    EndIf
    Next
    If $TempNum = 0 Then Return 0
    Do
    $Sw = False
    For $a = 0 To $TempNum - 1
    If $TempZ[$TempLin[$a]] <= $TempZ[$TempLin[$a + 1]] Then ContinueLoop
    $Dummy = $TempLin[$a]
    $TempLin[$a] = $TempLin[$a + 1]
    $TempLin[$a + 1] = $Dummy
    $Sw = True
    Next
    Until $Sw = False
    EndFunc ;==>BackfaceCulling

    [/autoit] [autoit][/autoit] [autoit]

    Func ApplyPerpective()
    For $a = 0 To $VerNum
    $Xx = $TempV[$a][0]
    $Yy = $TempV[$a][1]
    $z = $TempV[$a][2]
    If $z < -999 Then $z = -999
    If $z > 999 Then $z = 999
    $TempV[$a][0] = $XOrigin + ($Xx / (1000 - $z)) * 1000
    $TempV[$a][1] = $YOrigin + ($Yy / (1000 - $z)) * 1000
    Next
    EndFunc ;==>ApplyPerpective

    [/autoit] [autoit][/autoit] [autoit]

    Func Zoom($z)
    For $a = 0 To $VerNum
    $TempV[$a][2] += $z
    Next
    EndFunc ;==>Zoom

    [/autoit] [autoit][/autoit] [autoit]

    Func Rotate($Xx, $Yy, $z)
    Local $Xn = $Xx * $PIover180, $Yn = $Yy * $PIover180, $Zn = $z * $PIover180
    For $a = 0 To $VerNum
    $Xx = $TempV[$a][0]
    $Yy = $TempV[$a][1]
    $z = $TempV[$a][2]
    Local $X1 = $Xx * Cos($Zn) - $Yy * Sin($Zn), $Y1 = $Yy * Cos($Zn) + $Xx * Sin($Zn), $Z1 = $z
    $TempV[$a][0] = $X1
    $TempV[$a][1] = $Y1
    $TempV[$a][2] = $Z1
    $Xx = $TempV[$a][0]
    $Yy = $TempV[$a][1]
    $z = $TempV[$a][2]
    Local $Z1 = $z * Cos($Yn) - $Xx * Sin($Yn), $X1 = $z * Sin($Yn) + $Xx * Cos($Yn), $Y1 = $Yy
    $TempV[$a][0] = $X1
    $TempV[$a][1] = $Y1
    $TempV[$a][2] = $Z1
    $Xx = $TempV[$a][0]
    $Yy = $TempV[$a][1]
    $z = $TempV[$a][2]
    Local $Y1 = $Yy * Cos($Xn) - $z * Sin($Xn), $Z1 = $Yy * Sin($Xn) + $z * Cos($Xn), $X1 = $Xx
    $TempV[$a][0] = $X1
    $TempV[$a][1] = $Y1
    $TempV[$a][2] = $Z1
    Next
    EndFunc ;==>Rotate

    [/autoit] [autoit][/autoit] [autoit]

    Func Translate($x, $y, $z)
    For $a = 0 To $VerNum
    $TempV[$a][0] += $x
    $TempV[$a][1] += $y
    $TempV[$a][2] += $z
    Next
    EndFunc ;==>Translate

    [/autoit] [autoit][/autoit] [autoit]

    Func Sca($S)
    For $a = 0 To $VerNum
    For $b = 0 To 2
    $TempV[$a][$b] *= $S
    Next
    Next
    EndFunc ;==>Sca

    [/autoit] [autoit][/autoit] [autoit]

    Func CreateVertexArray()
    For $a = 0 To $VerNum
    For $b = 0 To 2
    $TempV[$a][$b] = $Ver[$a][$b]
    Next
    Next
    EndFunc ;==>CreateVertexArray

    [/autoit] [autoit][/autoit] [autoit]

    Func CalculateShadingFactors()
    For $a = 0 To $LineNum
    $Xmin1 = $Ver[$Lin[$a][1]][0]
    $Xmax1 = $Xmin1
    $Ymin1 = $Ver[$Lin[$a][1]][1]
    $Ymax1 = $Ymin1
    $Zmin1 = $Ver[$Lin[$a][1]][2]
    $Zmax1 = $Zmin1
    For $b = 1 To $Lin[$a][0]
    $Xmin2 = $Ver[$Lin[$a][$b]][0]
    $Ymin2 = $Ver[$Lin[$a][$b]][1]
    $Zmin2 = $Ver[$Lin[$a][$b]][2]
    If $Xmin1 > $Xmin2 Then $Xmin1 = $Xmin2
    If $Xmax1 < $Xmin2 Then $Xmax1 = $Xmin2
    If $Ymin1 > $Ymin2 Then $Ymin1 = $Ymin2
    If $Ymax1 < $Ymin2 Then $Ymax1 = $Ymin2
    If $Zmin1 > $Zmin2 Then $Zmin1 = $Zmin2
    If $Zmax1 < $Zmin2 Then $Zmax1 = $Zmin2
    Next
    $X1 = Abs($Xmax1 - $Xmin1)
    $Y1 = Abs($Ymax1 - $Ymin1)
    $Z1 = Abs($Zmax1 - $Zmin1)
    If $X1 >= $Y1 And $X1 >= $Z1 Then $Zcol[$a] = $X1
    If $Y1 >= $X1 And $Y1 >= $Z1 Then $Zcol[$a] = $Y1
    If $Z1 >= $X1 And $Z1 >= $Y1 Then $Zcol[$a] = $Z1
    Next
    EndFunc ;==>CalculateShadingFactors

    [/autoit] [autoit][/autoit] [autoit]

    Func LoadModel()
    Local $aLines[41] = [ "Cylinder.3DA", _
    "23", _
    "v -2.5 -4.33012701892219 -10", _
    "v 0 -5 -10", _
    "v 2.5 -4.33012701892219 -10", _
    "v 4.33012701892219 -2.5 -10", _
    "v 5 -3.06151588455594e-016 -10", _
    "v 4.33012701892219 2.5 -10", _
    "v 2.5 4.33012701892219 -10", _
    "v 6.12303176911189e-016 5 -10", _
    "v -2.5 4.33012701892219 -10", _
    "v -4.33012701892219 2.5 -10", _
    "v -5 9.18454765366783e-016 -10", _
    "v -4.33012701892219 -2.5 -10", _
    "v -2.5 -4.33012701892219 10", _
    "v 0 -5 10", _
    "v 2.5 -4.33012701892219 10", _
    "v 4.33012701892219 -2.5 10", _
    "v 5 -3.06151588455594e-016 10", _
    "v 4.33012701892219 2.5 10", _
    "v 2.5 4.33012701892219 10", _
    "v 6.12303176911189e-016 5 10", _
    "v -2.5 4.33012701892219 10", _
    "v -4.33012701892219 2.5 10", _
    "v -5 9.18454765366783e-016 10", _
    "v -4.33012701892219 -2.5 10", _
    "13", _
    "f 4 1 0 12 13 0 100 200", _
    "f 4 2 1 13 14 0 100 200", _
    "f 4 3 2 14 15 0 100 200", _
    "f 4 4 3 15 16 0 100 200", _
    "f 4 5 4 16 17 0 100 200", _
    "f 4 6 5 17 18 0 100 200", _
    "f 4 7 6 18 19 0 100 200", _
    "f 4 8 7 19 20 0 100 200", _
    "f 4 9 8 20 21 0 100 200", _
    "f 4 10 9 21 22 0 100 200", _
    "f 4 11 10 22 23 0 100 200", _
    "f 4 0 11 23 12 0 100 200", _
    "f 12 0 1 2 3 4 5 6 7 8 9 10 11 0 100 200", _
    "f 12 23 22 21 20 19 18 17 16 15 14 13 12 0 100 200"]
    $Lines = UBound($aLines)
    $VerNum = $aLines[1]
    For $i = 2 To $VerNum + 2
    $sRead = $aLines[$i]
    $aTemp = StringSplit(StringTrimLeft($sRead, 2), " ", 3)
    For $n = 0 To 2
    $Ver[$i - 2][$n] = $aTemp[$n]
    Next
    Next
    $LineN = $VerNum + 3
    $LineNum = $aLines[$LineN]
    For $i = $VerNum + 4 To $VerNum + 4 + $LineNum
    $sRead = $aLines[$i]
    $PCount = StringMid($sRead, 3, 1)
    If StringMid($sRead, 4, 1) <> " " Then $PCount = StringMid($sRead, 3, 2)
    $Cut = 4
    If StringMid($sRead, 4, 1) <> " " Then $Cut = 5
    $aTemp = StringSplit(StringTrimLeft($sRead, $Cut), " ", 3)
    $Lin[$i - ($VerNum + 4)][0] = $PCount
    For $n = 1 To $PCount
    $Lin[$i - ($VerNum + 4)][$n] = $aTemp[$n - 1]
    Next
    For $n = 21 To 23
    If Number($aTemp[$PCount + ($n - 21)]) <> 0 Then $Lin[$i - ($VerNum + 4)][$n] = Number($aTemp[$PCount + ($n - 21)])
    Next
    Next
    EndFunc ;==>LoadModel

    [/autoit] [autoit][/autoit] [autoit]

    Func FPS()
    WinSetTitle("", "", "minx' AutoIt-only 3D Engine | Flat Shading Mode | FPS: " & $iFPS & " (ø fps " & StringFormat("%.2f", $iFramesRendered / (TimerDiff($iTimer) / 1000)) & ", # frames: " & $iFramesRendered & ")")
    $iFPS = 0
    EndFunc ;==>FPS

    [/autoit] [autoit][/autoit] [autoit]

    Func quit()
    Exit
    EndFunc ;==>quit

    [/autoit] [autoit][/autoit] [autoit]

    Func WMI_GetCPUModel($sHost = @ComputerName)
    Local $objItem
    Local $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & $sHost & "\root\cimv2")
    Local $oColItems = $objWMIService.ExecQuery("SELECT Name FROM Win32_Processor", "WQL", 0x30)
    If IsObj($oColItems) Then
    For $objItem In $oColItems
    Return StringStripWS($objItem.Name, 7)
    Next
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func WMI_GetVideoModel($sHost = @ComputerName)
    Local $objItem
    Local $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & $sHost & "\root\cimv2")
    Local $oColItems = $objWMIService.ExecQuery("SELECT AdapterRAM, CurrentRefreshRate, Description, VideoProcessor FROM Win32_VideoController", "WQL", 0x30)
    If IsObj($oColItems) Then
    For $objItem In $oColItems
    Return $objItem.Description & ", " & $objItem.VideoProcessor & ", " & StringFormat("%.2f", ("0x" & Hex($objItem.AdapterRAM)) / 1024^2) & " MB RAM, @" & $objItem.CurrentRefreshRate & " Hz"
    Next
    EndIf
    EndFunc

    [/autoit]

    Das Resultat wird in der Datei @ScriptDir & "\Benchmark_Results.txt" gespeichert.

    Wenn es bereits eine modifizierte Version gibt, dann gibt es jetzt eine weitere. ;)

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 24. Juli 2013 um 01:34

    Ok, ein Missverständnis meinerseits. :whistling:

    Ich bin, warum auch immer, von dem OpenGL Benchmark ausgegangen. Das Ding hatte ich komplett vergessen - liegt wohl am Alter. ;)

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 24. Juli 2013 um 00:30

    minx: Basiert nicht dein CityMark Benchmark auf OpenGL?

    Br,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 23. Juli 2013 um 19:49
    Zitat von name22

    Etwas in der Art hat Mars doch gemacht, wenn ich mich nicht irre? Und bei Mars, Andy und mir sind die Betas mehr als schlecht abgeschnitten... Bei einigen Tests brauchen die doppelt so lange wie die Stable.
    Die meisten finden es wohl "enttäuschend" nach so langer Zeit ohne offiziellen Fortschritt.. :S


    Ich habe mir nicht im Detail die anderen Bms angesehen. Wenn dem so ist, dann vergesst meine Aussage.

    Es gibt leider keinen aktiven Entwickler mehr, um AutoIt weiter innovativ voranzutreiben. Jon musste ständig das Jammern der Leute anhören, bis es sich entschloss neue "Bugfixed" Versionen herauszubringen. Der größte Teil ist von Valik und trancexx.

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 23. Juli 2013 um 19:05

    Nach meiner Meinung sind die Benchmarks hier inkl. meinem und deren Ergebnisse nicht repräsentativ genug, um die Geschwindigkeit von AutoIt zu messen.

    Imho wäre es korrekt nur AutoIt Funktionen zu messen ohne irgend welche DLLs aufzurufen, wie z.B. Arrays, Binärstrings, etc. erstellen, sortieren, hoch zähen, runter zählen, und und und...

    Wer Zeit und Lust hat, kann sich ja was überlegen.

    Gruß,
    UEZ

  • Screenshot in PDF einfügen

    • UEZ
    • 19. Juli 2013 um 18:20

    Ja, einfach

    [autoit]


    If $bW > $bH Then
    _SetPaperSize("CUSTOM", 841.890, 595.276) ; A4 landscape
    _SetOrientation($PDF_ORIENTATION_LANDSCAPE)
    Else
    _SetPaperSize("CUSTOM", 595.276, 841.890) ; A4 portrait
    _SetOrientation($PDF_ORIENTATION_PORTRAIT)
    EndIf

    [/autoit]

    Werde auch den Screenshooter bei Gelegenheit anpassen, so dass Bilder im Querformat auch als Querformat im PDF Format gespeichert werden.

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 18. Juli 2013 um 22:31

    Habe mal Text to Bezier Intro getestet:

    3.3.8.1: 14.84 fps
    3.3.9.8 b: 14.38 fps

    Also marginaler Unterschied.

    Gruß,
    UEZ

  • Screenshot in PDF einfügen

    • UEZ
    • 18. Juli 2013 um 12:56

    Schaue dir doch mal im Windows Screenshooter die Funktion Save2PDF() an.

    Die MPDF_UDF.au3 habe ich auch leicht angepasst.

    Gruß,
    UEZ

  • Kann sich ein Script selber neu starten?

    • UEZ
    • 10. Juli 2013 um 23:01

    Geht auch so:

    [autoit]


    ;code by Yashied
    #OnAutoItStartRegister "OnAutoItStart"
    Global $__Restart = False

    [/autoit][autoit][/autoit][autoit]

    If MsgBox(4 + 64 + 262144, "Information", "Restart script now?", 30) = 6 Then _ScriptRestart()

    [/autoit][autoit][/autoit][autoit]

    Exit

    [/autoit][autoit][/autoit][autoit]

    Func _ScriptRestart($fExit = 1)
    Local $pid
    If Not $__Restart Then
    If @Compiled Then
    $pid = Run(@ScriptFullPath & ' ' & $CmdLineRaw, @ScriptDir, Default, 1)
    Else
    $pid = Run(@AutoItExe & ' "' & @ScriptFullPath & '" ' & $CmdLineRaw, @ScriptDir, Default, 1)
    EndIf
    If @error Then
    Return SetError(@error, 0, 0)
    EndIf
    StdinWrite($pid, @AutoItPID)
    EndIf
    $__Restart = 1
    If $fExit Then
    Sleep(50)
    Exit
    EndIf
    Return 1
    EndFunc ;==>_ScriptRestart

    [/autoit][autoit][/autoit][autoit]

    Func OnAutoItStart()
    Sleep(50)
    Local $pid = ConsoleRead(1)
    If @extended Then
    While ProcessExists($pid)
    Sleep(100)
    WEnd
    EndIf
    EndFunc ;==>OnAutoItStart

    [/autoit]

    Gruß,
    UEZ

  • n-Body Simulation -> 64-Bit-Assembler + MultiThread + AssembleIt2() Update Benchmark

    • UEZ
    • 7. Juli 2013 um 11:38

    Die Unterschiede zum Alten sind marginal:

    Code
    Benchmark n-Body-Simulation
    
    
    Number Particles:		30000
    Processor:		Intel(R) Core(TM) i5 CPU       M 540  @ 2.53GHz
    Number Processors(Cores):	4
    Number Threads:		4
    Overall Time:		258.08 Seconds
    Number Loops benchmarked:	387
    
    
    Average Interacts/sec:	5.59e+009
    Maximum Interacts/sec:	6.50e+009
    
    
    Average Ticks/Interact:	26.81    CAUTION! Depends on real Clockticks!
    Minimum Ticks/Interact:	24.75    CAUTION! Depends on real Clockticks!
    
    
    Average Clockticks[Mhz]:	2534    CAUTION! Clockticks may NOT match if over/underclocked! Please insert the real Clockticks!
    Maximum Clockticks[Mhz]:	2534    CAUTION! Clockticks may NOT match if over/underclocked! Please insert the real Clockticks!
    
    
    Average Looptime:		653.73 Milliseconds
    Fastest Looptime:		553.64 Milliseconds
    Alles anzeigen

    Gruß,
    UEZ

  • n-Body Simulation -> 64-Bit-Assembler + MultiThread + AssembleIt2() Update Benchmark

    • UEZ
    • 6. Juli 2013 um 23:21

    Hier meine Benchmark Werte:

    Code
    Benchmark n-Body-Simulation
    
    
    Number Particles:		30000
    Processor:		Intel(R) Core(TM) i5 CPU       M 540  @ 2.53GHz
    Number Processors(Cores):	4
    Number Threads:		4
    Overall Time:		263.82 Seconds
    Number Loops benchmarked:	431
    
    
    Average Interacts/sec:	6.03e+009
    Maximum Interacts/sec:	6.48e+009
    
    
    Average Ticks/Interact:	25.58    CAUTION! Depends on real Clockticks!
    Minimum Ticks/Interact:	24.45    CAUTION! Depends on real Clockticks!
    
    
    Average Clockticks[Mhz]:	2534    CAUTION! Clockticks may NOT match if over/underclocked! Please insert the real Clockticks!
    Maximum Clockticks[Mhz]:	2534    CAUTION! Clockticks may NOT match if over/underclocked! Please insert the real Clockticks!
    
    
    Average Looptime:		599.97 Milliseconds
    Fastest Looptime:		555.31 Milliseconds
    Alles anzeigen

    Gruß,
    UEZ

  • n-Body Simulation -> 64-Bit-Assembler + MultiThread + AssembleIt2() Update Benchmark

    • UEZ
    • 6. Juli 2013 um 14:26

    Hi Andy,

    kannst du nicht ein Benchmark Mode einbauen, so dass das Ergebnis in einer Datei landet?

    Gruß,
    UEZ

  • GUI soll maximiert werden, Taskleiste verschwindet aber...

    • UEZ
    • 5. Juli 2013 um 13:37

    Du kannst so was hier benutzen, aber wenn die Taskbar nicht unten ist, sondern wo anders, dann funktioniert das hier nicht, ohne Modifikationen (Hausaufgabe für dich ;)).

    [autoit]


    #include <WindowsConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    $aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd;INSTANCE:1]", "")
    $GUI = GuiCreate("Battlelog", @DesktopWidth, $aTaskbar[1], 0, 0, $WS_SYSMENU)
    GUISetState(@SW_SHOW)

    [/autoit][autoit][/autoit][autoit]

    Do
    Until GUIGetMsg() = -3

    [/autoit]

    Gruß,
    UEZ

  • n-Body Simulation -> 64-Bit-Assembler + MultiThread + AssembleIt2() Update Benchmark

    • UEZ
    • 2. Juli 2013 um 20:49

    Schönes Stück Arbeit Andy :thumbup:

    Jetzt müssen wir "nur" noch ASM lernen, um brotlose Kunst zu erschaffen. Motivation und Ideen gibt es ja genug -> AAAMMMMIIIIIGGGAAAA :rock:

    Ich habe bald 4 Wochen Urlaub. Mal sehen, ob ich alter Sack was mit ASM hinbekommen kann.


    Danke für's "Sharen".


    Gruß,
    UEZ

  • Autoit SysInfo Clock v0.9.9.7 build 2014-08-28 beta

    • UEZ
    • 28. Juni 2013 um 19:59

    Danke Oscar auch für dein Feedback.

    Gruß,
    UEZ

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™