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

Beiträge von Morrison

  • _WinAPI_DrawLine, mit Pfeiltasten Rechteck bewegen

    • Morrison
    • 17. Februar 2011 um 07:53

    Hallo,

    ich versuche für mein Projekt ein Rechteck mit den Pfeiltasten bewegen zu lassen, leider schaff ich des nicht..ich hoffe auf Eure Hilfe!

    Danke!

    Spoiler anzeigen
    [autoit]

    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <SliderConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #include <GDIPlus.au3>
    #include <ScreenCapture.au3>
    #include <WinAPI.au3>
    $dll = DllOpen("user32.dll")
    Opt("GUIOnEventMode", 1)
    #region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\besitzer\desktop\au3\lupe.kxf
    $Form1 = GUICreate("Form1", 422, 255, 286, 196)
    GUISetState($WS_EX_TOPMOST)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
    GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
    GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
    $Slider1 = GUICtrlCreateSlider(32, 56, 150, 45)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUICtrlSetLimit($Slider1, 100, 0)
    GUICtrlSetData($Slider1, 50)
    ;GUICtrlSetOnEvent(-1, "Slider1Change")
    $Slider2 = GUICtrlCreateSlider(32, 152, 150, 45)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUICtrlSetLimit($Slider2, 100, 0)
    GUICtrlSetData($Slider2, 50)
    ;GUICtrlSetOnEvent(-1, "Slider2Change")
    $Input1 = GUICtrlCreateInput("", 224, 32, 150, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
    GUICtrlSetOnEvent(-1, "Input1Change")
    $Label1 = GUICtrlCreateLabel("Koordinaten:", 224, 15, 64, 17)
    GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
    GUICtrlSetOnEvent(-1, "Label1Click")
    $Label2 = GUICtrlCreateLabel("x - Achse", 40, 40, 48, 17)
    GUICtrlSetOnEvent(-1, "Label2Click")
    $Label3 = GUICtrlCreateLabel("y - Achse", 40, 136, 48, 17)
    GUICtrlSetOnEvent(-1, "Label3Click")
    ;$Label4 = GUICtrlCreateLabel("", 224, 64, 150, 150)
    ;GUICtrlSetOnEvent(-1, "Label4Click")
    #endregion ### END Koda GUI section ###
    ;$hDesktop = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST, $GUI_BKCOLOR_TRANSPARENT))
    Dim $iX1o, $iY1o, $iX2o, $iY2o, $iX1u, $iY1u, $iX2u, $iY2u, $iX1l, $iY1l, $iX2l, $iY2l, $iX1r, $iY1r, $iX2r, $iY2r

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

    Local $hDC, $hPen, $obj_orig
    $width = 1
    $color = 0xFF
    $hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop)
    $hPen = _WinAPI_CreatePen($PS_SOLID, $width, $color)
    $obj_orig = _WinAPI_SelectObject($hDC, $hPen)
    Dim $coordLR, $coordHR, $countLR, $countHR, $ok
    $dist = 5
    $Scale = 30
    $sl1 = 50
    $sl2 = 50
    Dim $Lay[$Scale + 1][$Scale + 1]
    Dim $PosOld[2]
    For $x = 1 To $Scale
    For $y = 1 To $Scale
    $Lay[$x][$y] = GUICtrlCreateLabel("", 224 + $x * 5, 64 + $y * 5, 5, 5, $SS_RIGHT);, BitOR($SS_BLACKRECT, $SS_WHITERECT)) entweder schwarz oder weiss
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT);
    Next
    Next
    GUISetState(@SW_SHOW)
    HotKeySet("{ESC}", "_Exit")
    ;Start GUI Schleife
    While 1
    $Pos = MouseGetPos()
    For $x = 1 To $Scale
    For $y = 1 To $Scale
    $Pix = PixelGetColor(($Pos[0] + $coordLR) + $x - ($Scale / 2), ($Pos[1] + $coordHR) + $y - ($Scale / 2))
    GUICtrlSetBkColor($Lay[$x][$y], $Pix)
    Next
    Next
    ;wenn Pfeiltasten gedrückt
    If _IsPressed('25', $dll) Then ;links gedrückt
    $countLR = $countLR + (-1)
    $coordLR = $coordLR - $dist
    $sl1 = $sl1 - 10
    $iX1o = $iX1o - $dist
    $iY1o = $iY1o
    $iX2o = $iX2o - $dist
    $iY2o = $iY2o
    $iX1u = $iX1u - $dist
    $iY1u = $iY1u
    $iX2u = $iX2u - $dist
    $iY2u = $iY2u
    $iX1l = $iX1l - $dist
    $iY1l = $iY1l
    $iX2l = $iX2l - $dist
    $iY2l = $iY2l
    $iX1r = $iX1r - $dist
    $iY1r = $iY1r
    $iX2r = $iX2r - $dist
    $iY2r = $iY2r
    GUICtrlSetData($Slider1, $sl1)
    ElseIf _IsPressed('27', $dll) Then ;rechts gedrückt
    $countLR = $countLR + 1
    $coordLR = $coordLR + $dist
    $sl1 = $sl1 + 10
    ;_WinAPI_DrawLine($hDC, $iX1, $iY1, $iX2, $iY2)
    ;$iX1 X Koordinate des Startpunkts der Linie.
    ;$iY1 Y Koordinate des Startpunkts der Linie.
    ;$iX2 X Koordinate des Endpunkts der Linie.
    ;$iY2 Y Koordinate des Endpunkts der Linie.
    $iX1o = $iX1o + $dist
    $iY1o = $iY1o
    $iX2o = $iX2o + $dist
    $iY2o = $iY2o
    $iX1u = $iX1u + $dist
    $iY1u = $iY1u
    $iX2u = $iX2u + $dist
    $iY2u = $iY2u
    $iX1l = $iX1l + $dist
    $iY1l = $iY1l
    $iX2l = $iX2l + $dist
    $iY2l = $iY2l
    $iX1r = $iX1r + $dist
    $iY1r = $iY1r
    $iX2r = $iX2r + $dist
    $iY2r = $iY2r
    GUICtrlSetData($Slider1, $sl1)
    ElseIf _IsPressed('26', $dll) Then ;hoch gedrückt
    $countHR = $countHR + (-1)
    $coordHR = $coordHR - $dist
    $sl2 = $sl2 - 10
    $iX1o = $iX1o - $dist
    $iY1o = $iY1o
    $iX2o = $iX2o - $dist
    $iY2o = $iY2o
    $iX1u = $iX1u - $dist
    $iY1u = $iY1u
    $iX2u = $iX2u - $dist
    $iY2u = $iY2u
    $iX1l = $iX1l - $dist
    $iY1l = $iY1l
    $iX2l = $iX2l - $dist
    $iY2l = $iY2l
    $iX1r = $iX1r - $dist
    $iY1r = $iY1r
    $iX2r = $iX2r - $dist
    $iY2r = $iY2r
    GUICtrlSetData($Slider2, $sl2)
    ElseIf _IsPressed('28', $dll) Then ;runter gedrückt
    $countHR = $countHR + 1
    $coordHR = $coordHR + $dist
    $sl2 = $sl2 + 10
    $iX1o = $iX1o + $dist
    $iY1o = $iY1o
    $iX2o = $iX2o + $dist
    $iY2o = $iY2o
    $iX1u = $iX1u + $dist
    $iY1u = $iY1u
    $iX2u = $iX2u + $dist
    $iY2u = $iY2u
    $iX1l = $iX1l + $dist
    $iY1l = $iY1l
    $iX2l = $iX2l + $dist
    $iY2l = $iY2l
    $iX1r = $iX1r + $dist
    $iY1r = $iY1r
    $iX2r = $iX2r + $dist
    $iY2r = $iY2r
    GUICtrlSetData($Slider2, $sl2)
    EndIf
    ;wenn Mausbewegung
    If $Pos[0] <> $PosOld[0] Or $Pos[1] <> $PosOld[1] Then
    $coordHR = 0
    $coordLR = 0
    $countHR = 0
    $countLR = 0
    $PosOld = $Pos
    GUICtrlSetData($Slider1, 50)
    GUICtrlSetData($Slider2, 50)
    _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_INVALIDATE + $RDW_ALLCHILDREN)
    EndIf
    ;_WinAPI_DrawLine($hDC, $iX1, $iY1, $iX2, $iY2)
    ;$iX1 X Koordinate des Startpunkts der Linie.
    ;$iY1 Y Koordinate des Startpunkts der Linie.
    ;$iX2 X Koordinate des Endpunkts der Linie.
    ;$iY2 Y Koordinate des Endpunkts der Linie.
    _WinAPI_DrawLine($hDC, $Pos[0] - $iX1o , $Pos[1] - $iY1o, $Pos[0] + $iX2o, $Pos[1] - $iY2o) ; oben
    _WinAPI_DrawLine($hDC, $Pos[0] - $iX1u , $Pos[1] + $iY1u, $Pos[0] + $iX2u, $Pos[1] + $iY2u) ; untel
    _WinAPI_DrawLine($hDC, $Pos[0] + $iX1r , $Pos[1] - $iY1r, $Pos[0] + $iX2r, $Pos[1] + $iY2r) ; rechts
    _WinAPI_DrawLine($hDC, $Pos[0] - $iX1l , $Pos[1] - $iY1l, $Pos[0] - $iX2l, $Pos[1] + $iY2l) ; links

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

    ;~ _WinAPI_DrawLine($hDC, $Pos[0] - 15 , $Pos[1] - 15, $Pos[0] + 16, $Pos[1] - 15) ; oben
    ;~ _WinAPI_DrawLine($hDC, $Pos[0] - 15 , $Pos[1] + 16, $Pos[0] + 16, $Pos[1] + 16) ; untel
    ;~ _WinAPI_DrawLine($hDC, $Pos[0] + 16 , $Pos[1] - 15, $Pos[0] + 16, $Pos[1] + 16) ; rechts
    ;~ _WinAPI_DrawLine($hDC, $Pos[0] - 15 , $Pos[1] - 15, $Pos[0] - 15, $Pos[1] + 16) ; links

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

    ToolTip($countLR & ', ' & $countHR)
    GUICtrlSetData($Input1, 'Maus: x=' & $Pos[0] & ', y=' & $Pos[1]); & ' Bild: x=' & $Pos[0] + ($Scale / 2) & ', y=' & $Pos[1] + ($Scale / 2))
    Sleep(100)
    WEnd

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

    Func Form1Close()
    _WinAPI_SelectObject($hDC, $obj_orig)
    _WinAPI_DeleteObject($hPen)
    _WinAPI_ReleaseDC(0, $hDC)
    Exit
    EndFunc ;==>Form1Close
    Func Form1Maximize()
    EndFunc ;==>Form1Maximize
    Func Form1Minimize()
    EndFunc ;==>Form1Minimize
    Func Form1Restore()
    EndFunc ;==>Form1Restore
    Func Input1Change()
    EndFunc ;==>Input1Change
    Func Label1Click()
    EndFunc ;==>Label1Click
    Func Label2Click()
    EndFunc ;==>Label2Click
    Func Label3Click()
    EndFunc ;==>Label3Click
    Func Label4Click()
    EndFunc ;==>Label4Click
    Func Slider1Change()
    EndFunc ;==>Slider1Change
    Func Slider2Change()
    EndFunc ;==>Slider2Change
    ;~ Func Auswahl()
    ;~ ;Auswahlrechteck zeichnen
    ;~ ; X des Startpunkts der Linie./Y des Startpunkts der Linie./X des Endpunkts der Linie./Y des Endpunkts der Linie.
    ;~ _WinAPI_DrawLine($hDC, $Pos[0] - 15 , $Pos[1] - 15, $Pos[0] + 16, $Pos[1] - 15) ; oben
    ;~ _WinAPI_DrawLine($hDC, $Pos[0] - 15 , $Pos[1] + 16, $Pos[0] + 16, $Pos[1] + 16) ; untel
    ;~ _WinAPI_DrawLine($hDC, $Pos[0] + 16 , $Pos[1] - 15, $Pos[0] + 16, $Pos[1] + 16) ; rechts
    ;~ _WinAPI_DrawLine($hDC, $Pos[0] - 15 , $Pos[1] - 15, $Pos[0] - 15, $Pos[1] + 16) ; links
    ;~ EndFunc
    Func _Exit()
    _WinAPI_SelectObject($hDC, $obj_orig)
    _WinAPI_DeleteObject($hPen)
    _WinAPI_ReleaseDC(0, $hDC)
    Exit
    EndFunc ;==>_Exit

    [/autoit]
  • Lupe geht nicht! Fenster nicht transparent?

    • Morrison
    • 15. Februar 2011 um 04:45

    Hallo!

    Ich weiss nicht warum ich im kleinen Fenster nicht die Vergrösserung von der Lupe sehe?

    Kann mir jemand helfen?

    Spoiler anzeigen

    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <SliderConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Include <Misc.au3>
    $dll = DllOpen("user32.dll")
    Opt("GUIOnEventMode", 1)
    #Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\besitzer\desktop\au3\lupe.kxf
    $Form1 = GUICreate("Form1", 422, 255, 286, 196)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
    GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
    GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
    $Slider1 = GUICtrlCreateSlider(32, 56, 150, 45)
    GUICtrlSetOnEvent(-1, "Slider1Change")
    $Slider2 = GUICtrlCreateSlider(32, 152, 150, 45)
    GUICtrlSetOnEvent(-1, "Slider2Change")
    $Input1 = GUICtrlCreateInput("", 224, 32, 150, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
    GUICtrlSetOnEvent(-1, "Input1Change")
    $Label1 = GUICtrlCreateLabel("Koordinaten:", 224, 15, 64, 17)
    GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
    GUICtrlSetOnEvent(-1, "Label1Click")
    $Label2 = GUICtrlCreateLabel("x - Achse", 40, 40, 48, 17)
    GUICtrlSetOnEvent(-1, "Label2Click")
    $Label3 = GUICtrlCreateLabel("y - Achse", 40, 136, 48, 17)
    GUICtrlSetOnEvent(-1, "Label3Click")
    ;~ $Label4 = GUICtrlCreateLabel("", 224, 64, 150, 150)
    ;~ GUICtrlSetOnEvent(-1, "Label4Click")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###


    $Scale = 30
    $PixelSize = 5
    Dim $Lay[$Scale + 1][$Scale + 1]
    Dim $PosOld[2]


    For $x = 1 To $Scale
    For $y = 1 To $Scale
    $Lay[$x][$y] = GUICtrlCreateLabel("", 224, 64, 150, 150, BitOR($SS_RIGHT,$SS_BLACKRECT,$SS_WHITERECT))
    Next
    Next
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

    While 1
    $Pos = MouseGetPos()
    ;If $Pos[0] <> $PosOld[0] Or $Pos[1] <> $PosOld[1] Then
    For $x = 1 To $Scale
    For $y = 1 To $Scale
    $Pix = PixelGetColor($Pos[0] + $x - ($Scale / 2), $Pos[1] + $y - ($Scale / 2))
    GUICtrlSetBkColor($Lay[$x][$y], $Pix)
    Next
    Next
    $PosOld = $Pos
    ;EndIf
    If GUIGetMsg() = -3 Then Exit
    WEnd


    Func Form1Close()

    EndFunc
    Func Form1Maximize()

    EndFunc
    Func Form1Minimize()

    EndFunc
    Func Form1Restore()

    EndFunc
    Func Input1Change()

    EndFunc
    Func Label1Click()

    EndFunc
    Func Label2Click()

    EndFunc
    Func Label3Click()

    EndFunc
    Func Label4Click()

    EndFunc
    Func Slider1Change()

    EndFunc
    Func Slider2Change()

    EndFunc

  • _IELoadWait($oIE) oder: Flash erfassen / oder woher weiss ich wann die Webseite geladen ist?

    • Morrison
    • 11. Februar 2011 um 21:27

    Hi!

    Ich habe Probleme beim erfassen wann die Webseite den Flashinhalt bzw. das Flashspiel geladen hat!

    Es handelt sich dabei um die Facebook Browserspiele? Kann mir jemand Tipps oder eine Lösung geben wie ich des bewerkstelligen könnte?
    Oder auch wie ich den Flashinhalt in einer GUI laufen lassen kann!?
    Bin für alles dankbar!

    Danke!

  • ProgressBar auslesen und Anwendung beenden

    • Morrison
    • 11. Dezember 2009 um 13:25

    Nee, des dauert mir zu lang.. :S

  • ProgressBar auslesen und Anwendung beenden

    • Morrison
    • 11. Dezember 2009 um 12:55

    Hallo!

    Ich rufe per shellexecute eine INet Explorer Instanz auf und hole mir die PID mit ProcessExists.

    Wie kann ich die StatusBar (msctls_progress32) soweit auslesen das ich den Fortschrittbalken übernehmen oder auslesen kann und die Meldungen wie "Fertig" oder "Fehler auf der Seite" ausgegeben bekomme?

    Anschliessend soll die shell geschlossen werden wenn timeout oder progressbar 100% bzw. "Fertig".

  • StringInStr und doppelte Einträge finden..vllt. auch _sort func

    • Morrison
    • 8. Dezember 2009 um 15:51

    Kewl! :thumbup: Sehr schönes Ding! Danke!!


    Muss mich echt bissl mehr reinknien in die Sache! :D

  • TCPConnect funktioniert gar nicht ?!

    • Morrison
    • 8. Dezember 2009 um 15:11

    Hallo!


    Ich hab hier das gefunden:

    Spoiler anzeigen
    [autoit]

    #include <INet.au3>
    $s_SmtpServer = "mail.gmx.net"
    $s_FromName = "Mega"
    $s_FromAddress = "XXX"
    $s_ToAddress = "XXX"
    $s_Subject = "My Test UDF"
    $s_UName = "XXX"
    $s_PWD = "XXX"
    Dim $as_Body[2]
    $as_Body[0] = "Testing the new email udf"
    $as_Body[1] = "Second Line"
    $Response = _INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_UName, $s_PWD, $s_Subject, $as_Body)
    ;~ $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
    $err = @error
    If $Response = 1 Then
    MsgBox(0, "Success!", "Mail sent")
    Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
    EndIf
    ;===============================================================================
    ;
    ; Function Name: _INetSmtpMailAuth()
    ; Description: Sends an email using SMTP over TCP IP.
    ; Parameter(s): $s_SmtpServer - SMTP server to be used for sending email
    ; $s_FromName - Name of sender
    ; $s_FromAddress - eMail address of sender
    ; $s_ToAddress - Address that email is to be sent to
    ; $s_Username - Username for Authentication (bernd670)
    ; $s_Passwd - Password for Authentication (bernd670)
    ; $s_Subject - Subject of eMail
    ; $as_Body - Single dimension array containing the body of eMail as strings
    ; $s_helo - Helo identifier (default @COMPUTERNAME) sometime needed by smtp server
    ; $s_first - send before Helo identifier (default @CRLF) sometime needed by smtp server
    ; $b_trace - trace on a splash window (default 0 = no trace)
    ; Requirement(s): None
    ; Return Value(s): On Success - Returns 1
    ; On Failure - 0 and sets
    ; @ERROR = 1 - Invalid Parameters
    ; @ERROR = 2 - Unable to start TCP
    ; @ERROR = 3 - Unable to resolve IP
    ; @ERROR = 4 - Unable to create socket
    ; @ERROR = 5x - Cannot open SMTP session
    ; @ERROR = 50x - Cannot send body
    ; @ERROR = 5000 - Cannot close SMTP session
    ; Authors: Original function to send email via TCP - Asimzameer
    ; Conversion to UDF - Walkabout
    ; Correction Helo, timeout, trace - Jpm
    ; Correction send before Helo - Jpm
    ; Include Authentication - bernd670
    ;
    ;===============================================================================
    Func _INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Username, $s_Passwd, $s_Subject = "", $as_Body = "", $s_helo = "", $s_first = "-1", $b_trace = 0)
    Local $v_Socket
    Local $s_IPAddress
    Local $i_Count
    Local $s_Send[9]
    Local $s_ReplyCode[9];Return code from SMTP server indicating success
    If $s_SmtpServer = "" Or $s_FromAddress = "" Or $s_ToAddress = "" Or $s_Username = "" Or $s_Passwd = "" Or $s_FromName = "" Or StringLen($s_FromName) > 256 Then
    SetError(1)
    Return 0
    EndIf
    If $s_helo = "" Then $s_helo = @ComputerName
    If TCPStartup() = 0 Then
    SetError(2)
    Return 0
    EndIf
    StringRegExp($s_SmtpServer, "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")
    If @extended Then
    $s_IPAddress = $s_SmtpServer
    Else
    $s_IPAddress = TCPNameToIP($s_SmtpServer)
    EndIf
    If $s_IPAddress = "" Then
    TCPShutdown()
    SetError(3)
    Return 0
    EndIf
    $v_Socket = TCPConnect($s_IPAddress, 25)
    If $v_Socket = -1 Then
    TCPShutdown()
    SetError(4)
    Return (0)
    EndIf
    $s_Send[0] = "EHLO " & $s_helo & @CRLF
    ;~ If StringLeft($s_helo,5) <> "EHLO " Then $s_Send[0] = "EHLO " & $s_helo & @CRLF
    $s_ReplyCode[0] = "250"
    $s_Send[1] = "AUTH LOGIN" & @CRLF
    $s_ReplyCode[1] = "334"
    $s_Send[2] = _Base64Encoding($s_Username) & @CRLF
    $s_ReplyCode[2] = "334"
    $s_Send[3] = _Base64Encoding($s_Passwd) & @CRLF
    $s_ReplyCode[3] = "235"
    $s_Send[4] = "MAIL FROM: <" & $s_FromAddress & ">" & @CRLF
    $s_ReplyCode[4] = "250"
    $s_Send[5] = "RCPT TO: <" & $s_ToAddress & ">" & @CRLF
    $s_ReplyCode[5] = "250"
    $s_Send[6] = "DATA" & @CRLF
    $s_ReplyCode[6] = "354"
    $s_Send[7] = "From: " & $s_FromName & " <" & $s_FromAddress & ">" & @CRLF & _
    "To: " & "<" & $s_ToAddress & ">" & @CRLF & _
    "Subject: " & $s_Subject & @CRLF & _
    "Mime-Version: 1.0" & @CRLF & _
    "Content-Type: text/plain; charset=US-ASCII" & @CRLF & _
    @CRLF
    $s_ReplyCode[7] = ""
    $s_Send[8] = @CRLF & "." & @CRLF
    $s_ReplyCode[8] = "250"
    ; open stmp session
    If _SmtpSend ($v_Socket, $s_Send[0], $s_ReplyCode[0], $b_trace, "220", $s_first) Then
    SetError(50)
    Return 0
    EndIf
    ; send header
    For $i_Count = 0 To UBound($s_Send) - 2
    If _SmtpSend ($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
    SetError(50 + $i_Count)
    Return 0
    EndIf
    Next
    ; send body records (a record can be multiline : take care of a subline beginning with a dot should be ..)
    For $i_Count = 0 To UBound($as_Body) - 1
    ; correct line beginning with a dot
    If StringLeft($as_Body[$i_Count], 1) = "." Then $as_Body[$i_Count] = "." & $as_Body[$i_Count]
    If _SmtpSend ($v_Socket, $as_Body[$i_Count] & @CRLF, "", $b_trace) Then
    SetError(500 + $i_Count)
    Return 0
    EndIf
    Next
    ; close the smtp session
    $i_Count = UBound($s_Send) - 1
    If _SmtpSend ($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
    SetError(5000)
    Return 0
    EndIf
    TCPCloseSocket($v_Socket)
    TCPShutdown()
    Return 1
    EndFunc ;==>_INetSmtpMailAuth

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

    ;===============================================================================
    ;
    ; Function Name: _Base64Encoding()
    ; Description: Kodiert eine Zeichenfolge mit dem Base64-Verfahren
    ; (http://de.wikipedia.org/wiki/Base64)
    ; Parameter(s): $String - Zeichenfolge die kodiert werden soll
    ; Requirement(s): None
    ; Return Value(s): Kodierte Zeichenfolge
    ; Authors: bernd670
    ;
    ;===============================================================================
    Func _Base64Encoding($String)
    $strUmsetzung = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
    $strRetValue = ""
    For $i = 1 To StringLen($String) Step 3
    $strTok = StringMid($String, $i, 3)
    Switch StringLen($strTok)
    Case 3
    $iTokVal = (Asc(StringMid($strTok, 1, 1)) * 256 + _
    Asc(StringMid($strTok, 2, 1))) * 256 + _
    Asc(StringMid($strTok, 3, 1))
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt
    Case 2
    $iTokVal = (Asc(StringMid($strTok, 1, 1)) * 256 + _
    Asc(StringMid($strTok, 2, 1))) * 256
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt & "="
    Case 1
    $iTokVal = Asc(StringMid($strTok, 1, 1)) * 65536
    $iTokVal = BitShift($iTokVal, 12)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt & "=="
    EndSwitch
    Next
    Return $strRetValue
    EndFunc ;==>_Base64Encoding

    [/autoit]


    Variablen entsprechend deklarieren!

  • StringInStr und doppelte Einträge finden..vllt. auch _sort func

    • Morrison
    • 8. Dezember 2009 um 14:46

    Hallo!

    Ich habe eine Textdatei mit vielen Einträgen. Mir ist es wichtig das das Script die doppelten Einträge findet und löscht. Am besten die Textdatei auch sortiert. Hat jemand schon solch ein UDF oder ähnliches gesehen?

    Spoiler anzeigen
    [autoit]

    #Include <Array.au3>
    #Include <file.au3>
    Local $stringCount = 0
    $file = FileOpen("sorted.txt", 0)
    For $i = _FileCountLines($file) to 1 step -1
    $t = $i + 1
    $readline1 = FileReadLine($file, $i)
    $readline2 = FileReadLine($file, $t)
    If StringInStr($readline1, $readline2) Then
    $stringCount += 1
    _FileWriteToLine($file, $t, "", 1)
    EndIf
    Next
    FileClose($file)

    [/autoit]

    Dateien

    sorted.txt 1,45 kB – 284 Downloads
  • XP-CD Key auslesen

    • Morrison
    • 8. Dezember 2009 um 11:06

    Hiho!


    Hab XP Prof. SP3..bei mir funktionierts! :thumbup:

  • _IEFormGetCollection & _IEFormElementGetCollection suche Hilfe!

    • Morrison
    • 4. Dezember 2009 um 15:31

    KEWL!! :D


    Vielen Dank!! :thumbup:

  • _IEFormGetCollection & _IEFormElementGetCollection suche Hilfe!

    • Morrison
    • 4. Dezember 2009 um 15:10

    Was mache ich denn wenn das Objekt kein Namen hat? Bzw. woher weiss ich das es sich um ein Eingabefeld handelt?

  • _IEFormGetCollection & _IEFormElementGetCollection suche Hilfe!

    • Morrison
    • 4. Dezember 2009 um 10:30

    Hallo!
    Ich habe eine Liste mit mehreren Web-Proxys.
    Auf jedem Web-Proxy sollte es eine Eingabezeile und ein "submit"-Button geben.

    Ich möchte nun diese Eingabezeile und den "submit"-Button finden!

    Probleme:
    Es kann sein das die Eingabezeile nicht in "form" 0 sondern in "form" 1 liegt.
    Nicht immer heisst die Eingabezeile "u".

    Der Form_Collector findet den "submit"-Button nicht.

    Ich hab mal die "schlimmen" Proxys in die List.txt getan!
    Danke!

    Form_Collector.au3:

    Spoiler anzeigen
    [autoit]

    #include <IE.au3>
    $Url = 'http://www.healthysafe.cn'
    $oIE = _IECreate ($Url, 0, 0, 1, 1)
    $oForms = _IEFormGetCollection ($oIE)
    If @error Then
    MsgBox(0, '', 'Keine Formen enthalten')
    Else
    $Index = 0
    For $oForm In $oForms
    ConsoleWrite('Form-Index: ' & $Index & ' / Name: ' & $oForm.Name & @CRLF)
    $oFormElements = _IEFormElementGetCollection($oForm)
    If IsObj($oFormElements) Then
    $IndexElement = 0
    For $oElement In $oFormElements
    ConsoleWrite('Form: ' & $Index & ' /Element: ' & $IndexElement & ' /Name: ' & $oElement.Name & @CRLF)
    $IndexElement += 1
    Next
    EndIf
    $Index += 1
    Next
    EndIf

    [/autoit]

    callHP.au3:

    Spoiler anzeigen
    [autoit]

    #include <file.au3>
    #include <array.au3>
    #include <string.au3>
    #include <IE.au3>
    ;declare
    Global $targeturl = "www.google.de"
    Global $ProxyFile = "List.txt"
    Global $ProxyCount = _FileCountLines($ProxyFile)
    Global $aLine
    ;Main
    _FileReadToArray($ProxyFile, $aLine)
    For $i = 1 To UBound($aLine) -1
    _callProxyHP($aLine[$i], $targeturl)
    Next
    For $az = 1 to $ProxyCount
    $ProxAct = FileOpen("List.txt", 1)
    $ProxyAddress = FileReadLine($ProxAct, $az)
    _callProxyHP($ProxyAddress, $targeturl)
    Next
    ;func _callProxyHP($url, $targeturl)
    func _callProxyHP($url, $targeturl)
    $IE = _IECreate($url, 0, 0, 1, 1)
    $oForm = _IEFormGetCollection ($IE,0) ; <== Nummer der "Form"
    $oName = _IEFormElementGetObjByName ($oForm, "u")
    _IEFormElementSetValue ($oName, $targeturl) ;Text eingeben
    _IEFormSubmit ($oForm)
    EndFunc

    [/autoit]

    Test.au3:

    Spoiler anzeigen
    [autoit]

    #include <IE.au3>
    $oIE = _IECreate("http://www.healthysafe.cn", 0, 0, 1, 1)
    $oInputs = _IETagNameGetCollection ($oIE, "input")
    $oForms = _IEFormGetCollection ($oIE)
    For $oInput In $oInputs
    MsgBox(0, "Fromular Input Typ", "Formular: " & $oInput.form.name & " Typ: " & $oInput.type)
    If $oInput.type = "text" Then
    $Index = 0
    For $oForm In $oForms
    $oFormElements = _IEFormElementGetCollection($oForm)
    If IsObj($oFormElements) Then
    $IndexElement = 0
    For $oElement In $oFormElements
    ConsoleWrite('Form: ' & $Index & ' /Element: ' & $IndexElement & ' /Name: ' & $oElement.Name & @CRLF)
    $IndexElement += 1
    Next
    EndIf
    Next
    EndIf
    Next

    [/autoit]


    Woher weiss ich nun also was die Eingabezeile ist bzw. wie heisst sie?

    Dateien

    callHP.zip 1,13 kB – 245 Downloads
  • HP Quelltext, _FileRead, Dateien zusammenfügen, wer hilft mir??

    • Morrison
    • 2. Dezember 2009 um 00:15

    Käy, des Script funzt. :thumbup: .hatte da was durcheinander gebracht. :rolleyes:
    Danke für die Hilfe! 8o


    Wie würde der StringRegExp Ausdruck heissen wenn dies die Quelle:

    <optionvalue="81d.info">81d.info&nbsp;&nbsp;(US, Glype)

    und dies:

    http://http://www.81d.info

    das Ergebnis sein soll? :huh:


    Meine "GetProxyList.au3":

    Spoiler anzeigen
    [autoit]


    #include <file.au3>
    #include <array.au3>
    #include <string.au3>
    #include <IE.au3>
    ;
    ;
    Global $a_foundtxt
    FileDelete("Match.txt")
    ;Main
    ;
    ;Proxy-Liste
    #Region --- CodeWizard generated code Start ---
    ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Icon=None
    If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
    $iMsgBoxAnswer = MsgBox(4,"Proxy-Liste","Proxy-Liste aktualisieren?")
    Select
    Case $iMsgBoxAnswer = 6 ;Yes
    ;
    Case $iMsgBoxAnswer = 7 ;No
    ;
    EndSelect
    #EndRegion --- CodeWizard generated code End ---
    ;
    ;
    If $iMsgBoxAnswer = 6 Then
    _GetProxyList(19)
    EndIf
    If $iMsgBoxAnswer = 7 Then
    EndIf
    ;
    ;
    _FileReadToArray("found.txt", $a_foundtxt)
    For $i = 1 To $a_foundtxt[0]
    _TextLookup($a_foundtxt[$i])
    Next
    ;Main_End
    ;;

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

    ;Func _TextLookup($Dat)
    ;
    Func _TextLookup($Dat)
    $Matchtxt = FileOpen("Match.txt", 1)
    $aRegExp = StringRegExp(FileRead($Dat), '("(+(\.[a-z]+){1,2}(\&quot;|\/\&quot;|\/[\-a-z0-9]+\/&quot;))'']http://www\.|http://)[\-a-z0-9]+(\.[a-z]+){1,2}(\"|\/\"|\/[\-a-z0-9]+\/"))', 4)
    For $x = 0 To UBound($aRegExp) - 1
    $dummy = $aRegExp[$x]
    FileWriteLine($Matchtxt, StringReplace($dummy[1], '"', ''))
    ConsoleWrite(StringReplace($dummy[1], '"', '') & @CRLF)
    Next
    FileClose($Matchtxt)
    EndFunc ;==>_TextLookup
    ;Func _GetProxyList($pages)
    ;
    Func _GetProxyList($pages)
    $h_foundtxt = FileOpen("found.txt", 2)
    For $i = 1 To $pages
    InetGet("http://www.proxy4free.com/list/webproxy" & $i & ".html", "webproxy" & $i & ".html")
    FileWriteLine($h_foundtxt, "webproxy" & $i & ".html")
    Next
    FileClose($h_foundtxt)
    ;
    $h_foundtxt = FileOpen("found.txt", 1)
    InetGet("http://www.stayinvisible.com/web_proxy_list.html", "webproxy.html")
    FileWriteLine($h_foundtxt, "webproxy.html")
    FileClose($h_foundtxt)
    ;
    $p = 0
    $Page = 200
    $h_foundtxt = FileOpen("found.txt", 1)
    For $o = 1 To $page
    InetGet("http://www.tech-faq.com/proxy.shtml?start=" & $p, "webfaqproxy" & $o & ".html")
    FileWriteLine($h_foundtxt, "webfaqproxy" & $o & ".html")
    $p = $p + 25
    Next
    FileClose($h_foundtxt)
    EndFunc ;==>_GetProxyList
    ;

    [/autoit]

    Meine "_callHP.au3":

    Spoiler anzeigen
    [autoit]


    #include <file.au3>
    #include <array.au3>
    #include <string.au3>
    #include <IE.au3>

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

    ;declare
    ;;
    ;$url = "Proxy-Server-Liste"
    Global $targeturl = "www.google.de"
    Global $ProxyFile = "Match.txt"
    Global $ProxyCount = _FileCountLines($ProxyFile)
    Global $aLine
    ;Main
    ;;
    _FileReadToArray($ProxyFile, $aLine)
    For $i = 1 To UBound($aLine) -1
    _callProxyHP($aLine[$i], $targeturl)
    Next
    For $az = 1 to $ProxyCount
    $ProxAct = FileOpen("Match.txt", 1)
    $ProxyAddress = FileReadLine($ProxAct, $az)
    _callProxyHP($ProxyAddress, $targeturl)
    Next
    ;func _callProxyHP($url, $targeturl)
    ;;
    func _callProxyHP($url, $targeturl)
    $IEProxy = _IECreate($url, 0, 1, 1, 1)
    _IEAction ($IEProxy, "focus")
    Send("www.google.de")
    Send("{Enter}")
    _IELoadWait($IEProxy)
    _IEQuit($IEProxy)
    EndFunc
    ;EndFunc _callProxyHP($url, $targeturl)

    [/autoit]


    Mein Problem ist jetzt nur noch das ich auf manchen Proxy-Seiten nix ins Eingabefeld bekomme.

    Hab schon versucht mit _IEFormElementSetValue und _IEFormGetObjByName zu arbeiten..funzte auch nicht so richtig.

    Wenn da noch jemand Rat wüsste!? :whistling:


    Hier iss auch nix inne Ausgabedatei (*mpf*):

    Spoiler anzeigen
    [autoit]


    #include <file.au3>
    #include <array.au3>
    #include <string.au3>
    #include <IE.au3>
    #include <INet.au3>
    ;
    ;;
    $Matchtxt = FileOpen("Match.txt", 1)
    $String = _IECreate("http://proxy.org/cgi_proxies.shtml", 0 ,1 ,1 ,1)
    $aArray = StringRegExp(_INetGetSource($String),'<option value="(.*?)">',1)
    For $x = 0 To UBound($aArray) - 1
    $dummy = $aArray[$x]
    FileWriteLine($Matchtxt, StringReplace($dummy[1], '"', ''))
    ConsoleWrite(StringReplace($dummy[1], '"', '') & @CRLF)
    Next
    FileClose($Matchtxt)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Matchtxt = FileOpen("Match.txt", 1)

    [/autoit]

    Dateien

    Proxy.zip 5,61 kB – 249 Downloads
  • HP Quelltext, _FileRead, Dateien zusammenfügen, wer hilft mir??

    • Morrison
    • 1. Dezember 2009 um 17:24

    Ich raffs nich :?: :huh:

    ...wieso ist meine Match.txt leer?!?

    Hab Dein Code übernommen, funzt aber nicht..was kann das nu sein?

    Versionsprobleme?? Hatte vorher die lite Version und jetzt des neue SciTE drüberinstalliert.

    ?(

  • HP Quelltext, _FileRead, Dateien zusammenfügen, wer hilft mir??

    • Morrison
    • 1. Dezember 2009 um 15:55

    Hiho!

    kewl..aber

    ..in der "Match.txt" ist leider immer noch nichts drin! ;(


    Kanns was mit dem $dummy[1] zu tun haben?

    Dateien

    found.txt 869,21 kB – 489 Downloads
  • HP Quelltext, _FileRead, Dateien zusammenfügen, wer hilft mir??

    • Morrison
    • 1. Dezember 2009 um 09:23

    Hi!


    Das mit getHP iss schon sehr gut! Danke! :rock:


    Aber warum ist die Match.txt leer?? : :huh:


    [autoit]

    #include <file.au3>
    #include <array.au3>
    #include <string.au3>
    ;#Include <_TextLookup.au3>
    ;
    Dim $Dir = ("*.html")
    Dim $FileList[500]
    Dim $file = "found.txt"
    $anzahl = _FileCountLines($file)
    $line = 1
    _Dir($Dir)
    For $i = 1 to $anzahl
    $Dat = FileReadLine($file, $line)
    $line +=1
    _TextLookup($Dat)
    $rest = $anzahl - $i
    ToolTip($rest & " Dats left")
    Next

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

    ;
    func _Dir($Dir)
    $foundtxt = FileOpen("found.txt",2)
    ; Shows the filenames of all files in the current directory.
    $search = FileFindFirstFile($Dir)
    $loopcount = 0
    ; Check if the search was successful
    If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
    EndIf
    ;
    While 1
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
    FileWriteLine($foundtxt, $file)
    ;_ArrayAdd($FileList, $file) ; add found to .txt
    ;MsgBox(4096, "File:", $file)
    $loopcount +=1
    WEnd
    ; Close the search handle
    FileClose($foundtxt)
    FileClose($search)
    EndFunc ;_Dir($Dir)
    ;
    ;
    func _TextLookup($Dat)
    $Matchtxt = FileOpen("Match.txt",2)
    $aRegExp = StringRegExp(FileRead($Dat),'"((http://www\.|http://).+?\..+?\/)"',4)
    For $x = 0 to UBound($aRegExp) -1
    $dummy = $aRegExp[$x]
    FileWriteLine($Matchtxt,$dummy[1])
    Next
    FileClose($Matchtxt)
    EndFunc ;_TextLookup(Dat)
    ;
    ;FileClose($Matchtxt)

    [/autoit]
  • HP Quelltext, _FileRead, Dateien zusammenfügen, wer hilft mir??

    • Morrison
    • 30. November 2009 um 08:15

    Ich habe mir den Quelltext von Seiten mit Proxy Servern mit "HTTrack Website Copier" auf Platte geladen.
    Nun wollte ich mit der "getUrl.au3" aus dem Quelltext der Seite nur die Proxy-Server-Adressen raussuchen.
    Klappt auch schon, nur bei grossen Dateien zeitaufwändig!

    Danach wollte ich alle ProxyListen zu einer zusammenfügen, was ich nicht geschafft hab..immer .txt leer! ?(
    Mit "_callHP" möchte ich (am besten unsichtbar) über alle Proxys eine bestimmte Webseite aufrufen und
    nach vollständigem laden beenden.

    Probleme: Lange Arbeitszeit beim suchen von Adressen
    zusammenfügen von .txt Dateien funzt nicht
    Proxy-Server werden sichtbar aufgerufen
    nicht auf allen Proxy-Servern funzt die Eingabe der Ziel-Seite


    Dateien im Anhang! :D


    Bin dankbar für jeden Rat!

    Dateien

    HP.zip 27,59 kB – 250 Downloads
  • Markierte Dateien in Variable übernehmen

    • Morrison
    • 16. Oktober 2008 um 16:24

    Hi! Ich habe vor durch das markieren von mehreren Videodateien diese mit Nandub zusammen zu schneiden!

    Es soll also per Rechtsklick im Windows Explorer im Kontextmenü die Option "mit Nandub zusammenschneiden" wählbar sein und durch wählen dieses Eintrages Nandub gestartet und die markierten Dateien automatisch in einen vordefinierten Ordner gespeichert werden!

    Den Kontextmenüeintrag hab ich per Registry-Eintrag erstellt..jedoch fehlen wohl noch Befehle die dem Script sagen was passieren soll.

    Mein Problem ist jetzt der Scriptaufruf per Kontextmenü und die Übernahme der markierten Dateien in Variablen!

    Kann mir da wer weiterhelfen??

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™