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. andygo

Beiträge von andygo

  • script schneller durch 64bit compile?

    • andygo
    • 25. Juli 2015 um 04:03

    habe jetzt unnötige sachen aus der for-schleife in ne art parallele timerfunktiom gepackt die ich vor der schleife anstosse und danach beende. nun beschränkt sich die for-schleife auf die benötigten durchläufe wenn ich alles mit allem vergleichen muss:

    $totalloops = 0
    for x = 1 to array[0] - 1
    $totalloops += 1
    next


    beispiele: bei eingelesenen 6 textzeilen wären das 15 durchläufe, bei 10 eingelesenen zeilen 45 durchläufe usw...

    für eingelesene 3.000 Zeilen sind es (2.999 + 2.998 + 2.997.... + 1) durchläufe und das geht in knapp 13 sekunden.

    damit kann ich nun gut leben :)

  • script schneller durch 64bit compile?

    • andygo
    • 24. Juli 2015 um 08:28

    Hallo,

    bin unterwegs, werde aber asap (ca. 15 uhr) den scriptcode posten. da bin ich mal gespannt ob codemässig noch was herauszuholen ist.

    danke soweit für die Hinweise / Kritik.

  • script schneller durch 64bit compile?

    • andygo
    • 24. Juli 2015 um 04:19

    moin moin,

    habe ein script, das im hauptteil
    mit einer for . to . next schleife
    und arrays je nach eingabe relativ grosse datenmengen handelt.

    auf meinem 8kern-cpu lastet es mit maximal 15%.

    jetzt die frage: kann man die last irgendwie höher schrauben damit es dafür schneller arbeitet?

    würde eine 64bit kompilierung auf 64bit.betriebssystem ein unterschied zur 32bit kompilierten exe ausmachen?

  • Upload Image auf Imageshack.us

    • andygo
    • 2. Mai 2012 um 17:19

    hab hier mal n komplettscript zum bild-upload auf verschiedene hoster:

    Spoiler anzeigen
    [autoit]

    #RequireAdmin
    #RequireAdmin
    #include <StaticConstants.au3>
    #include <EditConstants.au3>
    #include <ComboConstants.au3>
    #include <GuiConstants.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>
    #Include <Misc.au3>
    #include <Constants.au3>
    #include <INet.au3>
    #Include <GuiButton.au3>
    #Include <Clipboard.au3>
    #include <GDIPlus.au3>
    #include <GDIP.au3>
    #include <file.au3>
    #include <GUIConstantsEx.au3>
    Break(0)
    Opt("TrayAutoPause",0)
    Opt("WinTitleMatchMode", 2)
    global $datei4cnt = 0, $waiting = 0, $shack, $dialog, $cprot, $c45, $newcurl, $ip, $opt3, $chars
    filedelete(@TempDir & "\_curlrc")
    FileInstall("curl.exe", @TempDir & "\curl.exe", 1)
    FileInstall("a2.jpg", @TempDir & "\a2.jpg", 1)
    _IEErrorHandlerRegister ()
    _IELoadWaitTimeout (1000)
    $oIE = _IECreateEmbedded ()
    Opt ("TrayIconHide", 1)
    Opt("GuiOnEventMode", 1)
    $maingui = GuiCreate("PicLoad", 305, 273, -1, -1, -1, $WS_EX_ACCEPTFILES)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit")
    GUIRegisterMsg(0x233, "WM_DROPFILES_FUNC")
    GUISetbkColor(0xe0e0e0)
    _ChangeWindowMessageFilterEx($maingui, 0x233, 1)
    _ChangeWindowMessageFilterEx($maingui, $WM_COPYDATA, 1)
    _ChangeWindowMessageFilterEx($maingui, 0x0049, 1)
    Func _ChangeWindowMessageFilterEx($hWnd, $iMsg, $iAction)
    Local $aCall = DllCall("user32.dll", "bool", "ChangeWindowMessageFilterEx", _
    "hwnd", $hWnd, _
    "dword", $iMsg, _
    "dword", $iAction, _
    "ptr", 0)
    If @error Or Not $aCall[0] Then Return SetError(1, 0, 0)
    Return 1
    EndFunc
    Func WM_DROPFILES_FUNC($hWnd, $msgID, $wParam, $lParam)
    Switch $hWnd
    Case $mainGUI
    Local Const $tagPOINT = "int X;int Y"
    Local $tPOINT = DllStructCreate($tagPOINT), $iX, $iY
    Local $aRET, $hCtrl, $nSize, $tFileName
    $aRET = DllCall("shell32.dll", "int", "DragQueryPoint", "hwnd", $wParam, "ptr", DllStructGetPtr($tPOINT))
    $iX = DllStructGetData($tPOINT, "X")
    $iY = DllStructGetData($tPOINT, "Y")
    If ($iX >= 157) And ($iX <= 157 + 143) And ($iY >= 5) And ($iY <= 5 + 80) Then
    $datei4pre = ""
    $aRET = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 255)
    For $i = 0 to $aRET[0] - 1
    $nSize = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0)
    $nSize = $nSize[0] + 1
    $tFileName = DllStructCreate("char[" & $nSize & "]")
    DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", DllStructGetPtr($tFileName), "int", $nSize)
    $datei4pre &= DllStructGetData($tFileName, 1) & "|"
    $tFileName = 0
    Next
    $datei4pre = StringTrimRight($datei4pre, 1)
    if StringInStr($datei4pre, "\AppData\Local\Temp\") and StringInStr($datei4pre, ":\", 0, 1, 5) < 8 then
    FileCopy($datei4pre, @TempDir & "\urldrop." & StringRight($datei4pre, 3), 1)
    $datei4pre = @TempDir & "\urldrop." & StringRight($datei4pre, 3)
    endif
    if $datei4cnt = 0 and $waiting = 0 and GUICtrlRead($shack) = "Datei" then
    if StringInStr($datei4pre, ":\", 0, 1, 5) > 8 then
    $i = StringLeft($datei4pre, StringInStr($datei4pre, "|"))
    $i = StringLeft($i, StringInStr($i, "\", 0, -1))
    $datei4pre = StringReplace($datei4pre, $i, "")
    $datei4pre = StringTrimRight($i, 1) & "|" & $datei4pre
    endif
    $datei4cnt = 1
    $4c1 = 1
    $4c2 = StringLeft ($datei4pre, stringinstr ($datei4pre, "|") - 1) & "\"
    $datei4pre = StringTrimLeft ($datei4pre, stringinstr ($datei4pre, "|"))
    _tv($shack, "Datei")
    endif
    Endif
    EndSwitch
    EndFunc

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

    $cl2 = GUICtrlCreateCombo ("abload.de", 4, 4, 121, 10, $CBS_DROPDOWNLIST)
    GUICtrlSetData(-1,"imagebanana.com|imageshack.us|img-teufel.de|directupload.net|pic-upload.de", "abload.de")
    $shack = GuiCtrlCreateButton("Datei", 3, 50, 70, 24)
    GUICtrlSetOnEvent($shack, "_shack")
    $c09 = GuiCtrlCreateLabel("• • Bereit • •", 152, 107, 150, 14, $SS_CENTER);bereit anzeige
    GUICtrlSetColor(-1, 0x0077c4)
    $oIEp = _IECreateEmbedded ()
    $c21 = GUICtrlCreateObj($oIEp, 157, 5, 143, 80)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $oIEp.navigate("about:blank")
    $c21l = GUICtrlCreateLabel("",157, 5, 143, 80)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    $c16 = GuiCtrlCreateEdit("", 0, 123, 305, 150);176)
    GUICtrlSetBkColor (-1,0xFDFBB7)
    $cprot = GUICtrlCreateLabel("", 192, 91, 60, 14, $SS_CENTER)
    GUICtrlSetFont (-1, 9, 800)
    $clh = GuiCtrlCreatebutton("Clear", 3, 100, 40, 20, $GUI_SS_DEFAULT_BUTTON)
    GUICtrlSetOnEvent($clh, "_historyclear")
    repic(@TempDir & "\a2.jpg", 144, 81, 1)
    GuiSetState(@sw_show, $maingui)

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

    func repic($rp, $rp1, $rp2, $rp3)
    if $rp = @TempDir & "\a2.jpg" then
    $oIEp.document.write("<body oncontextmenu='return false' scroll='no' style='border:0;margin-top:0px; margin-left:0px;background-image:url("&@TempDir & "\a2.jpg)'><img src ='" & @TempDir & "\a2.jpg' width='144' height='81' alt=''/></body>")
    else
    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile($rp)
    $Width = _GDIPlus_ImageGetWidth($hImage)
    $Height = _GDIPlus_ImageGetHeight($hImage)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    $i = $rp1
    $xa = $Width / $rp1
    $tip = "";$Width&" * "&$Height&" Pixel"
    while $Height / $xa > $rp2
    $i -= 1
    $xa = $Width / $i
    wend
    $Width2 = $Width
    $Height2 = $Height
    if $Width > $rp1 or $Height > $rp2 then
    $Width2 = int($Width / $xa)
    $Height2 = int($Height / $xa)
    endif
    $Width3 = 0
    $Height3 = 0
    if int(($rp1 - $Width2) / 2) > 1 then $Width3 = int(($rp1 - $Width2) / 2)
    if int(($rp2 - $Height2) / 2) > 1 then $Height3 = int(($rp2 - $Height2) / 2)
    if $rp3 = 1 then
    $oIEp.document.write("<body oncontextmenu='return false' scroll='no' style='border:0;margin-top:"&$Height3&"px; margin-left:"&$Width3&"px;background-image:url("&@TempDir & "\a2.jpg)'><img src ='" & $rp & "' width='"&$Width2&"' height='"&$Height2&"' alt='"&$tip&"'/></body>")
    endif
    endif
    $oIEp.refresh
    endfunc

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

    While 1
    sleep(20)
    If stringinstr (GUICtrlRead($shack), "Cancel") > 0 Then
    if $waiting = 0 Then
    $typ = "..jpg"
    $fehler = 0
    $quest = 0
    _dis()
    if $datei4cnt = 0 then
    $datei4pre = FileOpenDialog("Browse...", $dialog, "Images (*.jpg;*.png;*.gif;*.bmp;*.tif)", 1 + 2 + 4)
    $datei4cnt = 1
    $4c1 = 1
    $4c2 = StringLeft ($datei4pre, stringinstr ($datei4pre, "|") - 1) & "\"
    $datei4pre = StringTrimLeft ($datei4pre, stringinstr ($datei4pre, "|"))
    endif
    while $4c1 > 0
    if stringinstr ($datei4pre, "|", 0, 1, $4c1) > 0 then
    $datei4cnt += 1
    $4c1 = stringinstr ($datei4pre, "|", 0, 1, $4c1) + 1
    else
    $4c1 = 0
    endif
    wend
    if $datei4cnt = 1 then
    $datei4 = $4c2 & $datei4pre
    if stringleft ($datei4, 1) = "\" then $datei4 = stringtrimleft ($datei4, 1)
    else
    $datei4 = $4c2 & StringLeft ($datei4pre, stringinstr ($datei4pre, "|") - 1)
    $datei4pre = StringTrimLeft ($datei4pre, stringinstr ($datei4pre, "|"))
    endif
    GUICtrlSetData($shack, "Cancel")
    GUICtrlSetData($cprot, "Queue: "&$datei4cnt)
    $dialog = StringLeft($datei4, StringInStr ($datei4, "\", 0, -1))
    $typ4 = StringRight ($datei4, 3)
    If @error Then
    $fehler = 0
    elseif $datei4cnt = 0 Then
    $fehler = 1
    elseif $typ4 <> "bmp" AND $typ4 <> "tif" AND $typ4 <> "jpg" AND $typ4 <> "png" AND $typ4 <> "gif" AND $typ4 <> "" then
    if $datei4cnt = 1 then MsgBox(16,"Fehler", "Unzulässige Datei!")
    $fehler=1
    elseif StringLen ($datei4) > 0 then
    if (StringLen ($datei4) - StringInStr ($datei4, "\", 0, -1)) > 20 OR StringInStr ($datei4, " ") > 0 then
    FileCopy ($datei4, @TempDir & "\ptmp." & $typ4, 1)
    $datei4 = @TempDir & "\ptmp." & $typ4
    endif
    else
    $fehler=1
    EndIf
    if $fehler=0 then
    FileDelete (@TempDir & "\curl.txt")
    _curl($datei4)
    repic($datei4, 144, 81, 1)
    $typ4 = "jpg"
    GUICtrlSetState ($shack, $GUI_ENABLE)
    If FileExists($datei4) Then
    GUICtrlSetState ($shack, $GUI_ENABLE)
    $typ = ".jpg"
    _d2()
    _load($shack)
    endif
    GUICtrlSetColor($c09, 0x0077c4)
    GUICtrlSetData ($c09, "• • Bereit • •")
    else
    $dialog = @WindowsDir & "\"
    EndIf
    $typ = StringRight ($datei4, 4)
    $datei4cnt -= 1
    if $datei4cnt <= 0 Then
    $datei4cnt = 0
    _en()
    endif
    $typ4 = ""
    $waiting = 0
    EndIf
    if $datei4cnt = 0 then
    GUICtrlSetData($shack, "Datei")
    GUICtrlSetData($cprot, "")
    endif
    EndIf
    WEnd

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

    Func _Quit()
    if msgbox(68,"PicLoad","Wirklich beenden?") = 6 then
    Exit
    endif
    EndFunc

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

    func _picfile()
    $i = 0
    while not FileExists($datei4)
    sleep(20)
    $i += 1
    if $i > 150 then ExitLoop
    WEnd
    endfunc

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

    Func _shack()
    _tv($shack, "Datei")
    EndFunc
    Func _tv($tv1, $tv2)
    Switch GUICtrlRead($tv1)
    Case $tv2
    $ip = 0
    if $waiting = 0 Then GUICtrlSetData($tv1, "Cancel")
    Case else
    _exx()
    GUICtrlSetData($tv1, $tv2)
    EndSwitch
    EndFunc

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

    func _exx()
    $datei4cnt = 0
    $waiting = 0
    repic(@TempDir & "\a2.jpg", 144, 81, 1)
    FileDelete (@TempDir & "\curl.txt")
    GUICtrlSetData ($c09, "Abbruch bitte warten...")
    _en()
    endfunc
    func _historyclear()
    if stringlen(GUICtrlRead($c16)) > 0 and msgbox(68,"PicLoad","Liste Löschen?") = 6 then
    GUICtrlSetData($c16, "")
    repic(@TempDir & "\a2.jpg", 144, 81, 1)
    endif
    endfunc

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

    Func _curl($curl)
    $opt3 = GUICtrlRead($cl2)
    Switch $opt3
    Case "imageshack.us"
    $newcurl = '-F key=07AHPRSUb540e13d31461ec4d69d5fc122bd5ab7 -F fileupload=@"' & $curl & '" -H Expect: -o curl.txt --location-trusted --url "http://post.imageshack.us/"'
    Case "abload.de"
    $newcurl = '-F img0=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.abload.de/upload.php"'
    case "h4w.de"
    $newcurl = '-F andygo=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.h4w.de/upload.php"'
    Case "imagebanana.com"
    $newcurl = '-F upload[]=@"' & $curl & '" -F send=Hochladen! -H Expect: -o curl.txt --location-trusted --url "http://www.imagebanana.com/"'
    Case "pic-upload.de"
    $newcurl = '-F file=@"' & $curl & '" -F Submit=" Bild Hochladen" -H Expect: -o curl.txt --location-trusted --url "http://www.pic-upload.de/upload.php"'
    Case "directupload.net"
    $newcurl = '-F bilddatei=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.directupload.net/index.php?mode=upload"'
    Case "img-teufel.de"
    $newcurl = '-F upload_image=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.img-teufel.de/upload.html"'
    Case Else
    Exit MsgBox(16, "Fehler", "Curl Speicherüberlauf! Programm wird jetzt beendet!")
    EndSwitch
    EndFunc

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

    Func _d2()
    $skb = (FileGetSize ($datei4) / 1024)
    local $foo = Run(FileGetShortName(@TempDir) & "\curl.exe " & $newcurl, FileGetShortName(@TempDir) & "\", @SW_HIDE, $STDERR_CHILD), $line
    While $ip = 0 and ProcessExists ("curl.exe")
    $line = StderrRead($foo)
    $line = StringRegExp($line, '\d+', 3)
    if NOT @error then
    if $line[0] = 100 then $line[0] = 99
    GUICtrlSetData ($c09, "uploading " & $line[0] & " %")
    endif
    sleep(50)
    if $waiting = 0 then exitloop
    Wend
    Processclose ("curl.exe")
    GUICtrlSetData ($c09, "uploading 100 %")
    if FileExists (@TempDir & "\curl.txt") = 0 Then FileInstall("dummy", @TempDir & "\curl.txt", 1)
    EndFunc

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

    func _load($ldi)
    Local $file1 = FileOpen(@TempDir & "\curl.txt", 0)
    $chars = FileRead($file1)
    FileClose($file1)
    _filter()
    if stringlen ($chars) > 100 then $chars = "Error"
    ClipPut($chars)
    GUICtrlSetData($c16, GUICtrlRead($c16) & @CRLF & $chars & @CRLF)
    EndFunc

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

    func _dis()
    $waiting = 1
    ClipPut ("")
    GUICtrlSetColor($c09,0xff0000)
    GUICtrlSetData ($c09, "preparing upload...")
    $orglink = ""
    EndFunc
    func _en()
    GUICtrlSetData ($c09, "• • Bereit • •")
    EndFunc

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

    func _filter()
    if $opt3 = "imageshack.us" then
    $result = StringInStr($chars, "url_image_path"" value=""")
    $chars = StringTrimLeft($chars, $result + 22)
    $result = StringInStr($chars, """")
    $res2 = StringLen ($chars)
    $chars = StringTrimRight($chars, $res2 - $result + 1)
    $result = StringInStr($chars, "/")
    $res2 = StringLeft ($chars, $result -1)
    $chars = "http://" & $res2 & ".imageshack.us/" & $chars
    elseif $opt3 = "abload.de" then
    $result = StringInStr($chars, "&quot;;}}")
    $res2 = StringLen ($chars)
    $chars = StringTrimRight($chars, $res2 - $result + 1)
    while StringInStr($chars, ":&quot;") > 0
    $res2 = StringInStr($chars, ":&quot;")
    $chars = StringTrimLeft($chars, $res2 + 6)
    wend
    $chars = "http://www.abload.de/img/" & $chars
    elseif $opt3 = "imagebanana.com" then
    $result = StringInStr($chars, "]")
    $res2 = StringLen ($chars)
    $chars = StringTrimRight($chars, $res2 - $result + 1)
    elseif $opt3 = "img-teufel.de" then
    $result = StringInStr($chars, "[Blockierte Grafik: http://www.img-teufel.de/uploads/&quot;)<br>%20%20%20%20%20%20%20%20%24chars%20=%20StringTrimLeft(%24chars,%20%24result%20+%204)<br>%20%20%20%20%20%20%20%20%24result%20=%20StringInStr(%24chars,%20&quot;]")
    $res2 = StringLen ($chars)
    $chars = StringTrimRight($chars, $res2 - $result + 1)
    Else
    exit MsgBox(16, "Fehler", "Filter Speicherüberlauf! Programm wird jetzt beendet!")
    EndIf
    endfunc

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

    Eine oder gleich mehrere Dateien können entweder per Datei-Button gewählt werden oder mit Drag&Drop in das Bildfeld gezogen werden.
    Rest passiert dann automatisch.

    Dateien

    curl.rar 205,54 kB – 413 Downloads
  • Upload Image auf Imageshack.us

    • andygo
    • 1. Mai 2012 um 20:53
    Zitat von SYY99

    und wie kann ich das machen? Ich habe so ziemlich keine Ahnung von dem Zeug das im Skript steht.

    bei dem script oben bin ich leider auch noch nicht auf den richtigen syntax gekommen, sorry.

    in meinem script arbeite ich zusätzlich mit curl.exe (http://curl.haxx.se), damit hab ichs hinbekommen.

  • Upload Image auf Imageshack.us

    • andygo
    • 1. Mai 2012 um 13:38

    mit dem key von imageshack selbst geht es:

    [autoit]

    <input type="hidden" name="key" value="07AHPRSUb540e13d31461ec4d69d5fc122bd5ab7"/>

    [/autoit]

    musste halt nur irgendwie in die funktion integrieren

  • Ausgabe der DOS-Box auslesen

    • andygo
    • 21. April 2012 um 08:08

    Versuche mal das hier:

    [autoit]


    #include<Constants.au3>
    local $foo = Run(@ComSpec & " /c vpncli.exe", "C:\Programme\Cisco\Cisco AnyConnect VPN Client\", @SW_HIDE, $STDERR_CHILD), $Ergebnis
    While ProcessExists ("vpncli.exe")
    $Ergebnis &= StderrRead($foo)
    WEnd
    MsgBox(0, "STDOUT gelesen:", $Ergebnis)

    [/autoit]
  • Autoit Window Info und eine Checkbox

    • andygo
    • 31. März 2012 um 15:41

    soweit ich weiß lässt sich imgburn doch mit der option /S silent installieren?

  • Probleme bei der Ausgabe: Subscript used with non-Array variable

    • andygo
    • 23. März 2012 um 22:21

    lass dir doch ggf. mal mit arraydisplay anzeigen was überhaupt gefunden wird.
    bzw. vielleicht wird ja manchmal einfach nichts gefunden?

  • Webcam Ausschnitt abspeichern

    • andygo
    • 19. Januar 2012 um 19:38

    sollte mit screencaputre gehen oder?

    [autoit]

    _ScreenCapture_Capture($datei, $s_left, $s_top, $s_right, $s_down, false)

    [/autoit]
  • Werte der Variablen "verschwunden"??

    • andygo
    • 16. Januar 2012 um 10:07
    Zitat von Pixelwizard

    Soooo...

    So ein Schubs in die richtige Richtung wirkt doch manchmal. Noch ein bischen zusätzlich gelesen, da hat sich allerdings noch eine Frage nebenbei ergeben...

    Wie bringe ich einem Slider bei, mit zwei Nachkommastellen zu arbeiten? ....

    Werd mich mal durch die Hilfen hangeln, soll ja schließlich Lerneffekt dabei rauskommen.

    So long und gute Nacht!

    slider selbst können glaub ich nur integerwerte, da musste manuell umrechnen.
    ich steuere mit einem slider z.b. die gammafunktion von irfanview, die geht ja von 0.01 bis 1.00
    mein slider geht von 1 bis 100 und anwenden tu ich es dann so:

    PHP
    /gamma="&GUICtrlRead($slider)/100&
  • Group Umrandung Farbe ändern?

    • andygo
    • 16. Januar 2012 um 09:56

    moin moin,

    dazu gibt's ne UDF:

    Spoiler anzeigen
    [autoit]


    Func _GUICtrlCreateGroup($sText, $iLeft, $iTop, $iWidth, $iHeight, $bColor = 0xC0C0C0, $OutlineColor = 0xFFFFFF)
    Local $aLabel[6] = [5], $aLabelInner[6] = [5]
    Local $aStringSize = _StringSize($sText)
    GUISwitch($gui2)
    $aLabel[1] = GUICtrlCreateLabel("", $iLeft + 1, $iTop + 1, 1, $iHeight) ; Left Line.
    $aLabelInner[1] = GUICtrlCreateLabel("", $iLeft + 2, $iTop + 1, 1, $iHeight) ; Inner/Outer Left Line.
    $aLabel[2] = GUICtrlCreateLabel("", $iLeft + 1, $iTop + 1, 10, 1) ; Top Left Line.
    $aLabelInner[2] = GUICtrlCreateLabel("", $iLeft + 2, $iTop + 2, 10 - 1, 1) ; Top Inner/Outer Left Line.
    GUICtrlCreateLabel(" " & $sText, $iLeft + 7, $iTop - 4, $aStringSize[2] - 3, 15)
    GUICtrlSetColor(-1, 0xc00000); optional text color
    ;GUICtrlSetbkColor(-1, 0xc00000); optional text bg color
    $aLabel[3] = GUICtrlCreateLabel("", $iLeft + $aStringSize[2] + 4, $iTop + 1, $iWidth - $aStringSize[2] - 3, 1) ; Top Right Line.
    $aLabelInner[3] = GUICtrlCreateLabel("", $iLeft + $aStringSize[2] + 4, $iTop + 2, $iWidth - $aStringSize[2] - 3, 1) ; Top Inner/Outer Right Line.
    $aLabel[4] = GUICtrlCreateLabel("", $iLeft + $iWidth + 1, $iTop + 1, 1, $iHeight) ; Right Line.
    $aLabelInner[4] = GUICtrlCreateLabel("", $iLeft + $iWidth + 2, $iTop + 1, 1, $iHeight + 1) ; Right Inner/Outer Line.
    $aLabel[5] = GUICtrlCreateLabel("", $iLeft + 1, $iTop + $iHeight + 1, $iWidth + 1, 1) ; Bottom Line.
    $aLabelInner[5] = GUICtrlCreateLabel("", $iLeft + 1, $iTop + $iHeight + 2, $iWidth + 2, 1) ; Bottom Inner/Outer Line.
    For $i = 1 To $aLabel[0]
    GUICtrlSetBkColor($aLabel[$i], $bColor)
    GUICtrlSetBkColor($aLabelInner[$i], $OutlineColor)
    Next
    EndFunc

    [/autoit]

    anwendungsbeispiel:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    Opt("GUIOnEventMode", 0)
    Break(0)
    Opt("TrayAutoPause",0)
    $gui2 = GUICreate("test", 300, 100)
    _GUICtrlCreateGroup("farbengroup", 3, 15, 274, 77, 0x019c00, 0x74ff73)
    GUISetState()
    while 1
    sleep(50)
    $mMsg = GUIGetMsg(1)
    Switch $mMsg[0]
    case $GUI_EVENT_CLOSE
    exitloop
    EndSwitch
    wend
    Func _GUICtrlCreateGroup($sText, $iLeft, $iTop, $iWidth, $iHeight, $bColor = 0x00ff00, $OutlineColor = 0xFFFFFF)
    Local $aLabel[6] = [5], $aLabelInner[6] = [5]
    Local $aStringSize = _StringSize($sText)
    GUISwitch($gui2)
    $aLabel[1] = GUICtrlCreateLabel("", $iLeft + 1, $iTop + 1, 1, $iHeight) ; Left Line.
    $aLabelInner[1] = GUICtrlCreateLabel("", $iLeft + 2, $iTop + 1, 1, $iHeight) ; Inner/Outer Left Line.
    $aLabel[2] = GUICtrlCreateLabel("", $iLeft + 1, $iTop + 1, 10, 1) ; Top Left Line.
    $aLabelInner[2] = GUICtrlCreateLabel("", $iLeft + 2, $iTop + 2, 10 - 1, 1) ; Top Inner/Outer Left Line.
    GUICtrlCreateLabel(" " & $sText, $iLeft + 7, $iTop - 4, $aStringSize[2] - 3, 15)
    GUICtrlSetColor(-1, 0x285af2); optional text color
    GUICtrlSetbkColor(-1, 0xf2eb28); optional text bg color
    $aLabel[3] = GUICtrlCreateLabel("", $iLeft + $aStringSize[2] + 4, $iTop + 1, $iWidth - $aStringSize[2] - 3, 1) ; Top Right Line.
    $aLabelInner[3] = GUICtrlCreateLabel("", $iLeft + $aStringSize[2] + 4, $iTop + 2, $iWidth - $aStringSize[2] - 3, 1) ; Top Inner/Outer Right Line.
    $aLabel[4] = GUICtrlCreateLabel("", $iLeft + $iWidth + 1, $iTop + 1, 1, $iHeight) ; Right Line.
    $aLabelInner[4] = GUICtrlCreateLabel("", $iLeft + $iWidth + 2, $iTop + 1, 1, $iHeight + 1) ; Right Inner/Outer Line.
    $aLabel[5] = GUICtrlCreateLabel("", $iLeft + 1, $iTop + $iHeight + 1, $iWidth + 1, 1) ; Bottom Line.
    $aLabelInner[5] = GUICtrlCreateLabel("", $iLeft + 1, $iTop + $iHeight + 2, $iWidth + 2, 1) ; Bottom Inner/Outer Line.
    For $i = 1 To $aLabel[0]
    GUICtrlSetBkColor($aLabel[$i], $bColor)
    GUICtrlSetBkColor($aLabelInner[$i], $OutlineColor)
    Next
    EndFunc
    Func _StringSize($sText, $iSize = Default, $iWeight = Default, $iAttrib = Default, $sName = "", $iWidth = 0)

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

    Local $avSize_Info[4], $aRet, $iLine_Width = 0, $iLast_Word, $iWrap_Count
    Local $hLabel_Handle, $hFont, $hDC, $oFont, $tSize = DllStructCreate("int X;int Y")

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

    ; Check parameters are correct type
    If Not IsString($sText) Then Return SetError(1, 1, 0)
    If Not IsNumber($iSize) And $iSize <> Default Then Return SetError(1, 2, 0)
    If Not IsInt($iWeight) And $iWeight <> Default Then Return SetError(1, 3, 0)
    If Not IsInt($iAttrib) And $iAttrib <> Default Then Return SetError(1, 4, 0)
    If Not IsString($sName) Then Return SetError(1, 5, 0)
    If Not IsNumber($iWidth) Then Return SetError(1, 6, 0)

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

    ; Create GUI to contain test labels, set to required font parameters
    Local $hGUI = GUICreate("", 1200, 500, 10, 10)
    If $hGUI = 0 Then Return SetError(2, 0, 0)
    GUISetFont($iSize, $iWeight, $iAttrib, $sName)

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

    ; Store unwrapped text
    $avSize_Info[0] = $sText

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

    ; Ensure EoL is @CRLF and break text into lines
    If StringInStr($sText, @CRLF) = 0 Then $sText = StringRegExpReplace($sText, "[\x0a|\x0d]", @CRLF)
    Local $asLines = StringSplit($sText, @CRLF, 1)

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

    ; Draw label with unwrapped lines to check on max width
    Local $hText_Label = GUICtrlCreateLabel($sText, 10, 10)
    Local $aiPos = ControlGetPos($hGUI, "", $hText_Label)

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

    GUISetState(@SW_HIDE)

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

    GUICtrlDelete($hText_Label)

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

    ; Store line height for this font size after removing label padding (always 8)
    $avSize_Info[1] = ($aiPos[3] - 8)/ $asLines[0]
    ; Store width and height of this label
    $avSize_Info[2] = $aiPos[2]
    $avSize_Info[3] = $aiPos[3] - 4 ; Reduce margin

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

    ; Check if wrapping is required
    If $aiPos[2] > $iWidth And $iWidth > 0 Then

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

    ; Set returned text element to null
    $avSize_Info[0] = ""

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

    ; Set width element to max allowed
    $avSize_Info[2] = $iWidth

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

    ; Set line count to zero
    Local $iLine_Count = 0

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

    ; Take each line in turn
    For $j = 1 To $asLines[0]

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

    ; Size this line unwrapped
    $hText_Label = GUICtrlCreateLabel($asLines[$j], 10, 10)
    $aiPos = ControlGetPos($hGUI, "", $hText_Label)
    GUICtrlDelete($hText_Label)

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

    ; Check wrap status
    If $aiPos[2] < $iWidth Then
    ; No wrap needed so count line and store
    $iLine_Count += 1
    $avSize_Info[0] &= $asLines[$j] & @CRLF
    Else
    ; Wrap needed so need to count wrapped lines

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

    ; Create label to hold line as it grows
    $hText_Label = GUICtrlCreateLabel("", 0, 0)
    ; Initialise Point32 method
    $hLabel_Handle = ControlGetHandle($hGui, "", $hText_Label)
    ; Get DC with selected font
    $aRet = DllCall("User32.dll", "hwnd", "GetDC", "hwnd", $hLabel_Handle)
    If @error Or $aRet[0] = 0 Then Return SetError(3, 1, 0)
    $hDC = $aRet[0]
    $aRet = DllCall("user32.dll", "lparam", "SendMessage", "hwnd", $hLabel_Handle, "int", 0x0031, "wparam", 0, "lparam", 0) ; $WM_GetFont
    If @error Or $aRet[0] = 0 Then Return SetError(3, _StringSize_Error(2, $hLabel_Handle, $hDC, $hGUI), 0)
    $hFont = $aRet[0]
    $aRet = DllCall("GDI32.dll", "hwnd", "SelectObject", "hwnd", $hDC, "hwnd", $hFont)
    If @error Or $aRet[0] = 0 Then Return SetError(3, _StringSize_Error(3, $hLabel_Handle, $hDC, $hGUI), 0)
    $oFont = $aRet[0]

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

    ; Zero counter
    $iWrap_Count = 0

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

    While 1

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

    ; Set line width to 0
    $iLine_Width = 0
    ; Initialise pointer for end of word
    $iLast_Word = 0

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

    For $i = 1 To StringLen($asLines[$j])

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

    ; Is this just past a word ending?
    If StringMid($asLines[$j], $i, 1) = " " Then $iLast_Word = $i - 1
    ; Increase line by one character
    Local $sTest_Line = StringMid($asLines[$j], 1, $i)
    ; Place line in label
    GUICtrlSetData($hText_Label, $sTest_Line)

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

    ; Get line length into size structure
    $iSize = StringLen($sTest_Line)
    DllCall("GDI32.dll", "int", "GetTextExtentPoint32", "hwnd", $hDC, "str", $sTest_Line, "int", $iSize, "ptr", DllStructGetPtr($tSize))
    If @error Then Return SetError(3, _StringSize_Error(4, $hLabel_Handle, $hDC, $hGUI), 0)
    $iLine_Width = DllStructGetData($tSize, "X")

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

    ; If too long exit the loop
    If $iLine_Width >= $iWidth - Int($iSize / 2) Then ExitLoop
    Next

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

    ; End of the line of text?
    If $i > StringLen($asLines[$j]) Then
    ; Yes, so add final line to count
    $iWrap_Count += 1
    ; Store line
    $avSize_Info[0] &= $sTest_Line & @CRLF
    ExitLoop
    Else
    ; No, but add line just completed to count
    $iWrap_Count += 1
    ; Check at least 1 word completed or return error
    If $iLast_Word = 0 Then Return SetError(4, _StringSize_Error(0, $hLabel_Handle, $hDC, $hGUI), 0)
    ; Store line up to end of last word
    $avSize_Info[0] &= StringLeft($sTest_Line, $iLast_Word) & @CRLF
    ; Strip string to point reached
    $asLines[$j] = StringTrimLeft($asLines[$j], $iLast_Word)
    ; Trim leading whitespace
    $asLines[$j] = StringStripWS($asLines[$j], 1)
    ; Repeat with remaining characters in line
    EndIf

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

    WEnd

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

    ; Add the number of wrapped lines to the count
    $iLine_Count += $iWrap_Count

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

    ; Clean up
    DllCall("User32.dll", "int", "ReleaseDC", "hwnd", $hLabel_Handle, "hwnd", $hDC)
    If @error Then Return SetError(3, _StringSize_Error(5, $hLabel_Handle, $hDC, $hGUI), 0)
    GUICtrlDelete($hText_Label)

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

    EndIf

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

    Next

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

    ; Convert lines to pixels and add reduced margin
    $avSize_Info[3] = ($iLine_Count * $avSize_Info[1]) + 4

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

    EndIf

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

    ; Clean up
    GUIDelete($hGUI)

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

    ; Return array
    Return $avSize_Info

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

    EndFunc ; => _StringSize
    Func _StringSize_Error($iExtended, $hLabel_Handle, $hDC, $hGUI)

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

    ; Release DC if created
    DllCall("User32.dll", "int", "ReleaseDC", "hwnd", $hLabel_Handle, "hwnd", $hDC)
    ; Delete GUI
    GUIDelete($hGUI)
    ; Return with extended set
    Return $iExtended

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

    EndFunc ; => _StringSize_Error

    [/autoit]


    [Blockierte Grafik: http://h4w.de/1201/F1G.jpg]

  • Adressen/Städtenamen von Umlauten befreien

    • andygo
    • 12. Januar 2012 um 19:52

    du könntest ja den betreffenden string in ein array splitten wo jedes element nur aus einem buchstaben besteht.
    dann prüfst du mit stringislower bzw. stringisupper und je nach dem welcher fall öfter zutrifft verwandelst du die komplette ausgabe dann in stringlower bzw. stringupper.

  • Receiver Streamingtool - kompatibel zu Dreamboxen (enigma2) und D-Boxen (neutrino mit yWeb)

    • andygo
    • 12. Januar 2012 um 12:38
    Zitat von sc4ry

    gibts ein leines howto, wie man das benutzen soll?
    ich kann zwar meine ip eingeben, aber dann passiert nix weiter, egal welche datei ich starte.

    oder liegt es daran, dass ich ssl verwende?

    hallo,

    die beiden scripte sind miteinander verknüpft, du musst zuerst die atv_intern01.2012.au3 in atv_intern12.exe compilieren
    (weil die als fileinclude benötigt wird)

    und dann die atv_extern01.2012.au3 in ne beliebiger-name.exe.

    wenn du die nun startest und deine ip (bzw. die vom reciever eingibst) dann sollte es auf jeden fall ne reaktion geben,
    entweder das hauptfenster startet oder es kommt ne fehlermeldung.

  • Daten speichern in einer versteckten Editbox?

    • andygo
    • 11. Januar 2012 um 00:09

    schon mal was von $variablen gehört?

    [autoit]

    $eingabe = inputbox("boxtitel", "Boxtext")

    [/autoit]

    ist das einfachste was mir dazu einfällt.

  • Receiver Streamingtool - kompatibel zu Dreamboxen (enigma2) und D-Boxen (neutrino mit yWeb)

    • andygo
    • 9. Januar 2012 um 00:14

    Hallo,

    seit dem Scriptstand Mitte Dezember ist weiter fleissig gebastelt worden, die neuesten Scriptdateien habe ich im ersten Posting aktualisiert.
    Fragen, Kritik, Anregungen sind immer noch willkommen :)

    LG, Andy

  • Klick auf Button abfragen trotz While-Schleife...

    • andygo
    • 21. Dezember 2011 um 14:34
    Zitat von mikexmagic

    Danke für eine schnelle Antwort. Aber das Problem ist, dass der klick auf den Button überhaupt nicht registriert wird.

    Ich habe mir aber auch schon selber geholfen. Allerdings ist das bestimmt nicht die schönste Variante...

    Beim öffnen des LogGUI setze ich 'GUIOnEventMode' wieder auf NULL, also auf den MessageMode. Im laufe der WHILE-Schleife für den Log-Output frage ich dann gleichzeitig $msg ab. Klickt man nun auf den Button, wird der Prozess gestoppt und der 'GUIOnEventMode' wird wieder auf EINS gesetzt. usw usw....

    und wenn du es mal so versuchst?

    [autoit]


    AutoItSetOption ( "GUIOnEventMode", 0)
    Func RefreshLog()
    While ProcessExists($hPID)
    $msg = GUIGetMsg()
    Select
    Case $msg = $lv_Stoptask
    StopTask()
    endselect
    $readData = StdoutRead($hPID, 1)
    If $readData <> $oldData Then
    GUICtrlSetData($e_logoutput, @CRLF & $readData)
    _GUICtrlEdit_LineScroll($e_logoutput, 0, _GUICtrlEdit_GetLineCount($e_logoutput))
    $oldData = $readData
    EndIf
    Wend
    EndFunc

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

    Func StopTask()
    LogWrite("stop " & $hPID)
    ProcessClose ( $hPID)
    ProcessWaitClose ( $hPID)
    AutoItSetOption ( "GUIOnEventMode", 1)
    EndFunc

    [/autoit]
  • VLC integrieren, aber wie?

    • andygo
    • 19. Dezember 2011 um 01:03

    hallo,

    ich habe das script nun auch unter vista zum laufen gebracht, bisher ist es da immer abgestürzt.
    die methode zum vlc-einbinden ist geändert. aktualisiertes script gibts hier:

    Receiver Streamingtool - kompatibel zu Dreamboxen (enigma2) und D-Boxen (neutrino mit yWeb)

  • Manipulierte Slider-Position wird nicht erkannt

    • andygo
    • 17. Dezember 2011 um 17:46
    Zitat von klischee

    Hejo

    Ich versuche grade einen Slider eines Windows-Programmes (VirtualDub) mit einem Slider in AutoIt zu manipulieren. Optisch funktioniert das einwandfrei, jedoch erkennt das manipulierte Programm nicht, dass der Slider verstellt wurde. Das äußert sich in diesem Fall so, dass die Geschwindigkeit eines Rendering-Vorgangs auch dann pausiert ist, wenn ich den Slider mit AutoIt auf maximum verändert hab.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <SliderConstants.au3>
    #include <WindowsConstants.au3>
    #Include <GuiSlider.au3>

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

    $Form1 = GUICreate("Form1", 270, 54, 304, 261)
    $RenderSpeed = GUICtrlCreateSlider(16, 16, 233, 25)
    GUICtrlSetLimit(-1, 10, 0)

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

    ; Sliderposition für aktuelle Geschwindigkeit holen
    $SliderHandle = ControlGetHandle("VirtualDub Status", "", "[CLASS:msctls_trackbar32;INSTANCE:1]")
    $SliderPositionStandard = _GUICtrlSlider_GetPos($SliderHandle)
    If @error = 1 Then
    MsgBox(0,"","Kein Zielfenster gefunden (VirtualDub Status)")
    Exit
    EndIf
    GUICtrlSetData($RenderSpeed,$SliderPositionStandard)

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

    GUISetState(@SW_SHOW)

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

    While 1
    Sleep(1000)
    $SliderPositionNeu = _GUICtrlSlider_GetPos($RenderSpeed) ; Slider auf veränderungen überwachen
    If $SliderPositionNeu <> $SliderPositionStandard Then ; Wenn Slider sich verändert
    _GUICtrlSlider_SetPos($SliderHandle,$SliderPositionNeu) ; Sliderposition in zu manipulierendes Fenster übertragen
    $SliderPositionStandard = $SliderPositionNeu
    EndIf

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

    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit]


    Kann mir da jemand weiterhelfen?

    Alles anzeigen

    vielleicht musst du im virtual-dub noch einen controlclick auf den slider simulieren?

  • Receiver Streamingtool - kompatibel zu Dreamboxen (enigma2) und D-Boxen (neutrino mit yWeb)

    • andygo
    • 17. Dezember 2011 um 13:08
    Zitat von hauke96

    Sieht ja ganz gut aus ( auf dem Screenshot ), doch kann ich es nicht testen, weil ich die unixtime.au3 nicht habe.

    mfg
    Hauke

    sorry, die hatte ich vergessen. ist nun auch im posting oben.

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™