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

Beiträge von i2c

  • Variierende Anzahl von Dimensionen in einem Array

    • i2c
    • 23. Mai 2010 um 01:52
    Zitat

    Ich möchte nähmlich ein Script schreiben welches etwas bestimmtes in ein Array umwandelt, aber ich weis voher nicht welche Dimensionen es hat.

    Wenn du von irgendwoher Informationen einliest kannst du doch daraus ein passendes Array deklarieren. Wäre vlt. hilfreich zu wissen, was da woher kommt.

    edit: nie 3 Tabs auf einmal lesen sonst ist man irgendwo zu spät dran.

  • Func - Problem

    • i2c
    • 22. Mai 2010 um 17:19

    Ja was weiss ich denn was du in der Funktion machst. Kann ich hellsehen?
    Also entweder ist dein Skript regelkonform und du zeigst es oder jeder weitere Blick in diesen Thread ist unnütz.

  • Func - Problem

    • i2c
    • 22. Mai 2010 um 17:09

    Um's kurz zu machen - dir kann nicht geholfen werden wenn man dein Skript nicht sieht.
    Dein Skript kannst du uns nicht zeigen weil es gegen die Regeln verstösst (vermute ich).
    Ein Teufelskreis.

  • Func - Problem

    • i2c
    • 22. Mai 2010 um 14:33

    Wenn du dir ein paar Beispiele in der GUI und MessageLoop Referenz angeschaut hättest, dann wäre dir das Wirrwarr in deinem Schnipsel aufgefallen.

    Mal abgesehen davon, das du dort eine Funktion _Vari() aufrufst die es anscheinend nicht gibt betreibst du in deinem Skript mehrere Schleifen die warscheinlich nie beendet werden. So wie sich das für mich darstellt wird dein Skript nie beim 2ten Switch für $button2 und $button4 ankommen.

    "halbwegs logisch"
    [autoit]

    ;GUI erzeugen

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

    While 1
    $nmsg = GUIGetMsg()
    Switch $nmsg
    Case $Button1
    MsgBox(0, "", GUICtrlRead($Vari))
    GUICtrlSetBkColor($button3, 0x00CF00)
    _Vari1()
    Case $Button2
    GUICtrlSetBkColor($button3, 0xFF0000)
    Case $Button4
    GUICtrlSetBkColor($button3, 0xFF0000)
    EndSwitch
    WEnd

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

    Func _Vari1()
    ;mach was
    EndFunc ;==>_Vari1

    [/autoit]

    Und jetzt bau was sinnvolles und keinen Spambot.

  • ControlSend

    • i2c
    • 22. Mai 2010 um 12:12

    Ja Ineluki, aber das will er ja scheinbar gerade.

    volle: Mit dem WIndowInfoTool. Raupi hat's ja aber auch schon geschrieben.

  • ControlSend

    • i2c
    • 22. Mai 2010 um 12:04

    Klick in deinem Code mal auf ControlSend dann findest du das - ControlSend ( "title", "text", controlID, "string" [, flag] )

    Eine ControlID vermiss ich bei dir schonmal ;).

  • Func - Problem

    • i2c
    • 22. Mai 2010 um 11:28

    Das ändert ja nix an der tatsache das es 'nen Spambot o.ä. wird.
    Du solltest dir mal das hieranschauen. Beim genaueren hinsehen wirst du dann einen ganz entscheidenden Unterschied zwischen deinem Skript und den Beispielen erkennen.

    edit: vote die 3te

  • Func - Problem

    • i2c
    • 22. Mai 2010 um 11:13

    Lösung

  • array-ausgabe visualisieren?

    • i2c
    • 22. Mai 2010 um 03:40
    "aha"
    [autoit]

    $i = 0
    Func _WinlistVisibleEx($Titel)
    Local $var = WinList()
    Local $aTemp[1][2]
    Local $iCount = 0
    For $i = 1 To $var[0][0]
    If $var[$i][0] <> "" And BitAND(WinGetState($var[$i][1]), 2) Then
    Local $temp = StringRight($var[$i][0], 1)
    If $temp = $Titel Then
    $iCount += 1
    ReDim $aTemp[UBound($aTemp) + 1][2]
    $aTemp[$iCount][0] = $var[$i][0]
    $aTemp[$iCount][1] = $var[$i][1]
    EndIf
    EndIf
    $aTemp[0][0] = UBound($aTemp) - 1
    Next
    Return $aTemp
    EndFunc ;==>_WinlistVisibleEx

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

    $w1 = _WinlistVisibleEx("A") ;anzahl aller fenster die mit "A" enden
    $w2 = _WinlistVisibleEx("B") ;anzahl aller fenster die mit "B" enden

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

    SplashTextOn("", 'Fenster die auf "A" enden: ' & $w1[0][0] & @CRLF & 'Fenster die auf "B" enden: ' & $w2[0][0], "500", "100", "-1", "-1", 33, "", "", "")
    Sleep(3000)

    [/autoit] [autoit][/autoit] [autoit][/autoit]
  • array-ausgabe visualisieren?

    • i2c
    • 22. Mai 2010 um 03:10
    &quot;ungetestet&quot;
    [autoit]


    $i = 0
    Func _WinlistVisibleEx($Titel)
    Local $var = WinList()
    Local $aTemp[1][2]
    Local $iCount = 0
    For $i = 1 To $var[0][0]
    If $var[$i][0] <> "" And BitAND(WinGetState($var[$i][1]), 2) Then
    Local $temp = StringRight($var[$i][0], 1)
    If $temp = $Titel Then
    $iCount += 1
    ReDim $aTemp[UBound($aTemp) + 1][2]
    $aTemp[$iCount][0] = $var[$i][0]
    $aTemp[$iCount][1] = $var[$i][1]
    EndIf
    EndIf
    $aTemp[0][0] = UBound($aTemp) - 1
    Next
    Return $aTemp
    EndFunc ;==>_WinlistVisibleEx

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

    $w1 = _WinlistVisibleEx("A") ;anzahl aller fenster die mit "A" enden
    $w2 = _WinlistVisibleEx("B") ;anzahl aller fenster die mit "B" enden

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

    If IsArray($w1) Then
    Local $result = ""
    For $i = 1 To $w1[0][0]
    $result &= $w1[$i][0] & @CRLF
    Next
    If Not $result = "" Then
    SplashTextOn("", $result)
    Sleep(3000)
    SplashOff()
    EndIf
    EndIf

    [/autoit]
  • Auto it Abfrage erstellen ?

    • i2c
    • 21. Mai 2010 um 18:34
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    $Form1 = GUICreate("", 248, 89, 254, 124)
    $Input1 = GUICtrlCreateInput("", 8, 32, 121, 21)
    $Label1 = GUICtrlCreateLabel("bli, bla oder blub?", 8, 8, 87, 17)
    $Button1 = GUICtrlCreateButton("los", 144, 32, 75, 25)
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $read = GUICtrlRead($Input1) ;Input auslesen
    $pfad = IniRead(@ScriptDir & "\programme.ini", "main", $read, "") ;das was in Input steht in der ini suchen then
    If $pfad = "" then
    Msgbox(64, "", "Programm existiert nicht")
    Else
    ShellExecute($pfad) ;das Programm starten
    Endif
    EndSwitch
    WEnd

    [/autoit]

    Als programme.ini im Skriptordner ablegen.

    Code
    [main]
    firefox=c:\Programme\irgendwo\firefox.exe
    skype=c:\irgendwo\skype.exe

    ohne Gewähr auf Funktion

  • Auto it Abfrage erstellen ?

    • i2c
    • 21. Mai 2010 um 18:09

    In die einzelnen Funktionen für bli, bla und blub. Da wo jetzt die Messageboxen stehen.

    [autoit]

    Func _bli()
    ;hier dein Code für bli
    EndFunc ;==>_bli

    [/autoit]
  • Auto it Abfrage erstellen ?

    • i2c
    • 21. Mai 2010 um 18:02
    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    $Form1 = GUICreate("", 248, 89, 254, 124)
    $Input1 = GUICtrlCreateInput("", 8, 32, 121, 21)
    $Label1 = GUICtrlCreateLabel("bli, bla oder blub?", 8, 8, 87, 17)
    $Button1 = GUICtrlCreateButton("los", 144, 32, 75, 25)
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    _goto() ;wenn Button gedrückt, starte _goto()
    EndSwitch
    WEnd

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

    Func _goto()
    $read = GUICtrlRead($Input1) ;Inputfeld auslesen
    Switch $read ;Prüfen ob der EIngabe in Input eine Funktion zugeprdnet ist
    Case "bli" ;Wenn bli eingegeben wurde .....
    _bli() ;die Funktion _bli() aufrufen
    Case "bla"
    _bla()
    Case "blub"
    _blub()
    Case Else
    MsgBox(64, "", "ungültige Eingabe")
    EndSwitch
    EndFunc ;==>_goto

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

    Func _bli()
    MsgBox(64, "", "Ich bin die Funktion _bli()")
    EndFunc ;==>_bli

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

    Func _bla()
    MsgBox(64, "", "Ich bin die Funktion _bla()")
    EndFunc ;==>_bla

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

    Func _blub()
    MsgBox(64, "", "Ich bin die Funktion _blub()")
    EndFunc ;==>_blub

    [/autoit]
    Zitat

    i2c: das ist doch etwas hoch für einen anfänger...


    Ja, da magst du evtl. recht haben.

  • Auto it Abfrage erstellen ?

    • i2c
    • 21. Mai 2010 um 17:45
    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    $Form1 = GUICreate("", 248, 89, 254, 124)
    $Input1 = GUICtrlCreateInput("", 8, 32, 121, 21)
    $Label1 = GUICtrlCreateLabel("bli, bla oder blub?", 8, 8, 87, 17)
    $Button1 = GUICtrlCreateButton("los", 144, 32, 75, 25)
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    _goto()
    EndSwitch
    WEnd

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

    Func _goto()
    $read = GUICtrlRead($Input1)
    Switch $read
    Case "bli"
    MsgBox(64, "", "zur Funktion für bli springen")
    ;_bli()
    Case "bla"
    MsgBox(64, "", "zur Funktion für bla springen")
    ;_bla()
    Case "blub"
    MsgBox(64, "", "zur Funktion für blub springen")
    ;_blub()
    Case Else
    MsgBox(64, "", "ungültige Eingabe")
    EndSwitch
    EndFunc ;==>_goto

    [/autoit]
  • bytes in sekunde

    • i2c
    • 21. Mai 2010 um 15:40
    &quot;ungefähr so?&quot;
    [autoit]

    $seconds = 280
    ConsoleWrite(Floor($seconds/60) & ":" & $seconds - Floor($seconds/60)*60)

    [/autoit]
  • Woher imagesearch datei ?

    • i2c
    • 21. Mai 2010 um 13:00

    Als imagesearch.au3 in ...\Programme\Autoit3\Include\ speichern. und mit #include <imagesearch.au3> ins Skript einbinden.

  • Woher imagesearch datei ?

    • i2c
    • 21. Mai 2010 um 12:25
    &quot;imagesearch.au3&quot;
    [autoit]

    #include-once
    ; ------------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.0
    ; Language: English
    ; Description: Functions that assist with Image Search
    ; Require that the ImageSearchDLL.dll be loadable
    ;
    ; ------------------------------------------------------------------------------

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

    ;===============================================================================
    ;
    ; Description: Find the position of an image on the desktop
    ; Syntax: _ImageSearchArea, _ImageSearch
    ; Parameter(s):
    ; $findImage - the image to locate on the desktop
    ; $tolerance - 0 for no tolerance (0-255). Needed when colors of
    ; image differ from desktop. e.g GIF
    ; $resultPosition - Set where the returned x,y location of the image is.
    ; 1 for centre of image, 0 for top left of image
    ; $x $y - Return the x and y location of the image
    ;
    ; Return Value(s): On Success - Returns 1
    ; On Failure - Returns 0
    ;
    ; Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify
    ; a desktop region to search
    ;
    ;===============================================================================
    Func _ImageSearch($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance)
    return _ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance)
    EndFunc

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

    Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance)
    ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom)
    if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage
    $result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage)

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

    ; If error exit
    if $result[0]="0" then return 0

    ; Otherwise get the x,y location of the match and the size of the image to
    ; compute the centre of search
    $array = StringSplit($result[0],"|")

    $x=Int(Number($array[2]))
    $y=Int(Number($array[3]))
    if $resultPosition=1 then
    $x=$x + Int(Number($array[4])/2)
    $y=$y + Int(Number($array[5])/2)
    endif
    return 1
    EndFunc

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

    ;===============================================================================
    ;
    ; Description: Wait for a specified number of seconds for an image to appear
    ;
    ; Syntax: _WaitForImageSearch, _WaitForImagesSearch
    ; Parameter(s):
    ; $waitSecs - seconds to try and find the image
    ; $findImage - the image to locate on the desktop
    ; $tolerance - 0 for no tolerance (0-255). Needed when colors of
    ; image differ from desktop. e.g GIF
    ; $resultPosition - Set where the returned x,y location of the image is.
    ; 1 for centre of image, 0 for top left of image
    ; $x $y - Return the x and y location of the image
    ;
    ; Return Value(s): On Success - Returns 1
    ; On Failure - Returns 0
    ;
    ;
    ;===============================================================================
    Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance)
    $waitSecs = $waitSecs * 1000
    $startTime=TimerInit()
    While TimerDiff($startTime) < $waitSecs
    sleep(100)
    $result=_ImageSearch($findImage,$resultPosition,$x, $y,$tolerance)
    if $result > 0 Then
    return 1
    EndIf
    WEnd
    return 0
    EndFunc

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

    ;===============================================================================
    ;
    ; Description: Wait for a specified number of seconds for any of a set of
    ; images to appear
    ;
    ; Syntax: _WaitForImagesSearch
    ; Parameter(s):
    ; $waitSecs - seconds to try and find the image
    ; $findImage - the ARRAY of images to locate on the desktop
    ; - ARRAY[0] is set to the number of images to loop through
    ; ARRAY[1] is the first image
    ; $tolerance - 0 for no tolerance (0-255). Needed when colors of
    ; image differ from desktop. e.g GIF
    ; $resultPosition - Set where the returned x,y location of the image is.
    ; 1 for centre of image, 0 for top left of image
    ; $x $y - Return the x and y location of the image
    ;
    ; Return Value(s): On Success - Returns the index of the successful find
    ; On Failure - Returns 0
    ;
    ;
    ;===============================================================================
    Func _WaitForImagesSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance)
    $waitSecs = $waitSecs * 1000
    $startTime=TimerInit()
    While TimerDiff($startTime) < $waitSecs
    for $i = 1 to $findImage[0]
    sleep(100)
    $result=_ImageSearch($findImage[$i],$resultPosition,$x, $y,$tolerance)
    if $result > 0 Then
    return $i
    EndIf
    Next
    WEnd
    return 0
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit]
  • AutoIt funktion analog zu unix date

    • i2c
    • 21. Mai 2010 um 11:29
    Zitat von dexli


    Danke
    für diese schnelle Antwort!

    jetzt muß ich nur noch herausfinden warum FileWriteLine($file, @hour, @min, @sec) einen Fehler erzeugt.

    Dexli

    [autoit]

    FileWriteLine($file, @HOUR & ":" & @MIN & ":" & @SEC)

    [/autoit]
  • AutoIt funktion analog zu unix date

    • i2c
    • 21. Mai 2010 um 11:19
    [autoit]

    $result = DllCall("msvcrt.dll", "int:cdecl", "time", "int", 0)
    MsgBox(0, "", "Timestamp: " & $result[0])

    [/autoit]
  • Msg eines GUI Controls in einer funktion auserhalb der while schleife

    • i2c
    • 20. Mai 2010 um 20:47

    Du machst also bei der Aufgabenstellung msgs eines GUI Controls auserhalb einer whileschleife in einer funktion abfragen einfach aus der While eine Do...Until - sehr pfiffig. :thumbup:

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™