Diese Seite ist leider nicht verfügbar.
Beiträge von DeepRed92
-
-
Bei mir kommen nur 204 Byte an
. -
@Padmak: Da stimmt etwas mit deinem BatMaker nicht. Hast du evtl. vergessen bei Run o.ä @ScriptDir zu schreiben?
-
Man könnte damit z.B andere Programme irgendwie so erweitern, das es vor dem Start einen Benutzerdefinierten Code ausführt.
Das könnte in manchen Fällen auch nützlich sein.
-
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 _
[/autoit][autoit][/autoit][autoit]
& '$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); #FUNCTION# ====================================================================================================================
[/autoit][autoit][/autoit][autoit]
; 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" ThenEndIf
[/autoit]
Next
EndFunc ;==>_RunPlugIn -
Mach doch noch eine UDF, wo man die PQ-Formel ausrechnen kann. Also so ungefähr: _MathEx_Get_PQ_Result($Value1,$Value2)
Hier mal ein Beispiel:
[autoit]$p = -7
[/autoit][autoit][/autoit][autoit]
$q = 12$rechnenplus = -($p / 2) + Sqrt(($p / 2) ^ 2 - $q)
[/autoit][autoit][/autoit][autoit]
$rechnenminus = -($p / 2) - Sqrt(($p / 2) ^ 2 - $q)MsgBox(0, "Lösung", "Plus = " & $rechnenplus & @CRLF & "Minus = " & $rechnenminus)
[/autoit] -
Nein. Dann hast du die Endung .lnk.lnk

-
[autoit]
FileCreateShortcut(@ScriptFullPath, @StartupDir & "\" & "Name")
[/autoit] -
Stimmt. Ich hab da @LF reingeschrieben, damit die Zeilen richtig gezählt werden. Mit @crlf zeigt es immer (fast) das Doppelte an.
-
Zitat
Aber warum machst du es dir so schwer?
Ist folgendes nicht viel einfacher?Sicher ist das einfacher. Aber mit meinem kann man sozusagen auch auf die Variablen des Hauptscriptes zugreifen bzw. ändern.
Aber es geht doch drum warum Execute dabei nicht funktioniert. Es wird doch nur 5x 'MsgBox(0,"","")' übergeben.Gelöst
-
Zitat
Also nochmal:
- Execute erlaubt nur einen Befehl / Befehlszeile
- jede Schleife besteht aber aus: Befehl Schleifenanfang + Befehl(e) in der Schleife + Befehl SchleifenendeVersuch doch mal: For $i=0 To 20 auszuführen
==> geht nicht!
Und darum macht Execute das auch nicht.Ich glaube ich habs falsch erklärt.
Also die folgenden Werte werden an Execute in meinem Script übergeben:1.> MsgBox(0,"","")
2.> MsgBox(0,"","")
3.> MsgBox(0,"","")
4.> MsgBox(0,"","")
5.> MsgBox(0,"","")So. Die Befehle For und Next werden dabei herausgefiltert. Es werden nur die gesposteten Werte übergeben. (Einzeln)
-
Zitat
Ich meinte nicht Codezeile, sondern Programmzeilen.
Ist ja. Der Code wird gesplitet. Hier dann als Anhang nochmal:
-
Hallo BugFix,
ja das weiß ich auch. Macht es in meinem Beispiel ja auch. Hier nochmal mit msgBox:
Spoiler anzeigen
[autoit]$Source = 'For $FNLoop = 5 To 10' & @CRLF _
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
& 'MsgBox(0,"","")' & @CRLF _
& 'Next'_RunPlugIn($Source)
[/autoit] [autoit][/autoit] [autoit]; #FUNCTION# ====================================================================================================================
[/autoit] [autoit][/autoit] [autoit]
; 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" Then$StartLoop_Line = $NextLoop1
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
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
For $NextLoop3 = Number($From) To Number($To)
For $FNLoop = Number($StartLoop_Line) To Number($EndLoop_Line)
MsgBox(0,"Code",$Split1[$FNLoop])
Execute($Split1[$FNLoop]) ;Funktioniert nicht
Next
NextEndIf
[/autoit]
Next
EndFunc ;==>_RunPlugIn -
Hallo,
bei meinem Script funktionier der Befehle Execute nicht. Es wird alles richtig übergeben aber es funzt halt nicht

Spoiler anzeigen
[autoit]$Source = 'For $FNLoop = 5 To 10' & @CRLF _
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
& 'MsgBox(0,"","")' & @CRLF _
& 'Next'_RunPlugIn($Source)
[/autoit] [autoit][/autoit] [autoit]; #FUNCTION# ====================================================================================================================
[/autoit] [autoit][/autoit] [autoit]
; 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" Then$StartLoop_Line = $NextLoop1
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
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
For $NextLoop3 = Number($From) To Number($To)
For $FNLoop = Number($StartLoop_Line) To Number($EndLoop_Line)
Execute($Split1[$FNLoop]) ;Funktioniert nicht
Next
NextEndIf
[/autoit]
Next
EndFunc ;==>_RunPlugIn -
Mit @LF funktioniert es. Danke. Mit ist jetzt nur Unklar warum das nicht mit @crlf ging

-
Hallo,
ich habe eine Textdatei wo folgendes drin steht:
[autoit]For $Loop = 5 To 10
[/autoit]
FileWrite("Hallo1.txt", $Loop & @CRLF)
Next
For $Loop = 1 To 5
FileWrite("Hallo2.txt", $Loop & @CRLF)
Next
MsgBox(0, "", "Hallo")
For $Loop = 1 To 5
FileWrite("Hallo3.txt", $Loop & @CRLF)
Next
MsgBox(0, "", "Hallo3")So. Es sind ja eigentlich 11 Zeilen. Aber wenn ich mit StringSplit die Datei splitte erhalte ich die Zahl 21.
[autoit]$Split1 = StringSplit($Source, @CRLF)
[/autoit]
Warum werden 21 Zeilen statt nur 11 angezeigt? Mache ich etwas falsch? -
Oder versuche es doch hiermit:
[ offen ] Plug-In Schnittstelle
Die For und Next Schleifen gehen Einigermaßen

-
Hallo,
ich habe gerade das hier gefunden: http://msdn.microsoft.com/en-us/library/bb776819.aspx
Ist es möglich eine Deskband mit Autoit in den Explorer zu inegrieren? -
Die Grafikfehler tauchen nur bei AutoIt auf (evtl. ein Bug?).

-
@Raupi:
Meinst du sowas? :
Spoiler anzeigen
[autoit]#include <GUIConstantsEX.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <Constants.au3>
#include <WindowsConstants.au3>Global $GCL_HICONSM = -34
[/autoit] [autoit][/autoit] [autoit]
Global $GCL_HICON = -14;$hGUI = GUICreate("No Icon", 300, 200, -1, -1, -1, $WS_EX_DLGMODALFRAME)
[/autoit] [autoit][/autoit] [autoit]
$hGUI = GUICreate("No Icon", 300, 200, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU,$WS_MINIMIZEBOX,$WS_MAXIMIZEBOX), $WS_EX_DLGMODALFRAME)$hIcon = GetClassLong($hGUI, $GCL_HICON)
[/autoit] [autoit][/autoit] [autoit]
DllCall("User32.dll", "int", "DestroyIcon", "hwnd", $hIcon)
SetClassLong($hGUI, $GCL_HICON, 0)
SetClassLong($hGUI, $GCL_HICONSM, 0)
GUISetState()Do
[/autoit] [autoit][/autoit] [autoit]
Until GUIGetMsg() = $GUI_EVENT_CLOSEFunc GetClassLong($hWnd, $nIndex)
[/autoit] [autoit][/autoit] [autoit]
Local $hResult = DllCall("user32.dll", "dword", "GetClassLong", "hwnd", $hWnd, "int", $nIndex)
Return $hResult[0]
EndFuncFunc SetClassLong($hWnd, $nIndex, $dwNewLong)
[/autoit]
Local $hResult = DllCall("user32.dll", "dword", "SetClassLong", "hwnd", $hWnd, "int", $nIndex, "long", $dwNewLong)
Return $hResult[0]
EndFunc