Plug-In Schnittstelle

  • Hallo,

    ich hab seit 3 Tagen versucht eine Plug-In Schnittstelle für AutoIt zusammenzubasteln. Dies klappt soweit gut.

    Hat jemand Tipps zu diesem Thema?

    Soweit bin ich:

    [autoit]

    $Source = '$Answer1 = MsgBox(262212, "Hallo", "Klick any button ^^")' & @CRLF _
    & '$Answer2 = MsgBox(262212, "Hallo", "Klick any button ^^")' & @CRLF _
    & 'If $Answer1 = $Answer2 Then' & @CRLF _
    & ' MsgBox(0, "", "Sie haben 2x das selbe gewählt.")' & @CRLF _
    & 'EndIf'

    _RunPlugIn($Source)

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _RunPlugIn
    ; Description ...: Führt einen Plug-In aus
    ; Syntax.........: _RunPlugIn($Source)
    ; Parameters ....: $Source - Source in AutoIt
    ; Author ........: Burak Keskin <[email='Burak.keskin@arcor.de'][/email]>
    ; ===============================================================================================================================
    Func _RunPlugIn($Source)

    Local $StartLoop_Line, $EndLoop_Line

    $Split1 = StringSplit($Source, @LF)

    For $NextLoop1 = 1 To $Split1[0]

    $Split2 = StringSplit($Split1[$NextLoop1], "=")
    $Split3 = StringSplit($Split1[$NextLoop1], " ")
    ;---------------------------------------------------------------------------------------------------------------
    ;///////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ;---------------------------------------------------------------------------------------------------------------
    If $Split3[1] <> "For" And $Split3[1] <> "If" Then
    If $Split2[0] > 1 Then
    Assign(StringTrimLeft(StringTrimRight($Split2[1], 1), 1), Execute(StringTrimLeft(StringReplace($Split2[2], @CR, ""), 1)))
    ElseIf $Split2[0] = 1 Then
    Execute(StringReplace($Split1[$NextLoop1], @CR, ""))
    EndIf
    EndIf
    ;---------------------------------------------------------------------------------------------------------------
    ;///////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ;---------------------------------------------------------------------------------------------------------------
    If $Split3[1] = "For" Then
    $StartLoop_Line = $NextLoop1
    For $NextLoop2 = $StartLoop_Line To $Split1[0]
    If StringInStr($Split1[$NextLoop2], "Next") Then
    $EndLoop_Line = $NextLoop2
    ExitLoop
    EndIf
    Next
    $From = $Split3[4]
    $To = $Split3[6]
    $StartLoop_Line += 1
    $EndLoop_Line -= 1
    $VarName = $Split3[2]
    For $FNLoop = Number($From) To Number($To)
    For $NextLoop3 = Number($StartLoop_Line) To Number($EndLoop_Line)
    Execute(StringReplace($Split1[$NextLoop3], @CR, ""))
    Next
    Next
    $NextLoop1 = $EndLoop_Line
    EndIf
    ;---------------------------------------------------------------------------------------------------------------
    ;///////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ;---------------------------------------------------------------------------------------------------------------
    If $Split3[1] = "If" Then
    $StartLoop_Line2 = $NextLoop1
    For $NextLoop2 = $StartLoop_Line To $Split1[0]
    If StringInStr($Split1[$NextLoop2], "EndIf") Then
    $EndLoop_Line2 = $NextLoop2
    ExitLoop
    EndIf
    Next
    $Var1 = $Split3[2]
    $Var2 = $Split3[4]
    $StartLoop_Line2 += 1
    $EndLoop_Line2 -= 1
    $IfType = $Split3[3]
    If StringLeft(Eval("Var1"), 1) = "$" Then
    $Var1 = Eval(StringTrimLeft(Eval("Var1"), 1))
    Else
    $Var1 = Eval("Var1")
    EndIf
    If StringLeft(Eval("Var2"), 1) = "$" Then
    $Var2 = Eval(StringTrimLeft(Eval("Var2"), 1))
    Else
    $Var2 = Eval("Var2")
    EndIf
    If $IfType = "=" Then
    If String($Var1) = String($Var2) Then
    For $NextLoop4 = $StartLoop_Line2 To $EndLoop_Line2
    Execute(StringReplace($Split1[$NextLoop4], @CR, ""))
    Next
    EndIf
    ElseIf $IfType = "<" Then
    If String($Var1) < String($Var2) Then
    For $NextLoop4 = $StartLoop_Line2 To $EndLoop_Line2
    Execute(StringReplace($Split1[$NextLoop4], @CR, ""))
    Next
    EndIf
    ElseIf $IfType = ">" Then
    If String($Var1) > String($Var2) Then
    For $NextLoop4 = $StartLoop_Line2 To $EndLoop_Line2
    Execute(StringReplace($Split1[$NextLoop4], @CR, ""))
    Next
    EndIf
    ElseIf $IfType = "<>" Then
    If String($Var1) <> String($Var2) Then
    For $NextLoop4 = $StartLoop_Line2 To $EndLoop_Line2
    Execute(StringReplace($Split1[$NextLoop4], @CR, ""))
    Next
    EndIf
    EndIf
    $NextLoop1 = $EndLoop_Line2
    EndIf
    ;---------------------------------------------------------------------------------------------------------------
    ;///////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ;---------------------------------------------------------------------------------------------------------------
    If $Split3[1] = "While" Then

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

    EndIf

    Next
    EndFunc ;==>_RunPlugIn

    [/autoit]
  • @Deepred
    Was genau macht denn das Plug-In bzw. die Schnittstelle?

    Wie kann ich es nutzen?

    Frage, weil ich das irgendwie in meinem Hirn umsetzen möchte, wenn Du weißt was ich meine? Plug-In hört sich gut an, aber ... Neee, geht irgendwie nicht in mein Kopf. Sorry.

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    OuBVU5ebLhHu5QvlnAyQB4A7SzBrvWulwL7RLl2BdH5tI6sIYspeMKeXMSXl