tool per cmd füttern

  • Ja das geht :)

    Guck dir mal in der Hilfe den Punkt "Command Line Parameters" an. Da ist alles bestens Dokumentiert ;)

  • Bestimmt irgendwie, aber du kannst dir jagenau so gut ne eigene Konsole bauen, ein großes Edit...machst Vorgaben was man dort eingeben soll splittest dann den Strin entsprechend und dann gibst du die Daten an AutoIt mit Shutdown oder _RunDos


    Waluev

    Flensburg ist wie Payback - wenn man 18 Punkte hat bekommt man ein Fahrrad.

    Einmal editiert, zuletzt von Waluev (14. Mai 2007 um 17:03)

  • ^^ sowas gibt es schon im englischen Forum.Hier der Quelltext:

    Spoiler anzeigen
    [autoit]


    #include <GuiConstants.au3>
    #Include <GuiEdit.au3>
    #include <date.au3>

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

    opt("GUIOnEventMode", 1)

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

    Demo()

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

    ;------------------------------------------------------------------------------------------------------
    ;- C O N S O L E D E M O
    ;------------------------------------------------------------------------------------------------------
    Func Demo()
    Global $ConsoleID=0
    $ConsoleID = ConsoleWinCreate(-1, -1, 638, 326, "Age Demo...", "Starting demo..." & @CRLF, True)
    $answer1 = ConsoleWinInput($ConsoleID, "Please input your Year of Birth (example.. 1985) ?", 15, 1 )
    $Vanswer1 =ConsoleWinVerify($ConsoleID, $answer1, "Please input your Year of Birth (example.. 1985) ?", True, 4, 4)
    ConsoleWinWrite($ConsoleID, "OK.. " & @CRLF, 30, 1)
    $answer2 = ConsoleWinInput($ConsoleID, "Please input your Month of Birth (example.. 3 = March) ?", 45, 1 )
    $Vanswer2 =ConsoleWinVerify($ConsoleID, $answer2, "Please input your Month of Birth (example.. 3 = March) ?", True, 1, 2)
    ConsoleWinWrite($ConsoleID, "Good.. " & @CRLF, 60, 1)
    $answer3 = ConsoleWinInput($ConsoleID, "Please input your Day of Birth (ex.. 22) ?" , 75, 1 )
    $Vanswer3 =ConsoleWinVerify($ConsoleID, $answer3, "Please input your Month of Birth (example.. 22) ?", True, 1, 2)
    ConsoleWinWrite($ConsoleID, "Great!.. Please wait while i calculate your age..." & @CRLF, 90, 1)
    Sleep(1000)
    ConsoleWinWrite($ConsoleID, " You have been alive " & _DateDiff( 'd',$Vanswer1 &"/"& $Vanswer2 &"/"& $Vanswer3,_NowCalc()) & " days!" & @CRLF, 100, 1)
    Sleep(5000)
    ConsoleWinWrite($ConsoleID, "Example: Clearing console in five seconds...Thanks Valuater 8) ")
    Sleep(5000)
    ConsoleWinClear($ConsoleID)
    ConsoleWinWrite($ConsoleID, "Demo finished! Exiting in five seconds...")
    Sleep(5000)
    Exit
    EndFunc

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

    ;------------------------------------------------------------------------------------------------------
    ;- C O N S O L E L I B R A R Y
    ;------------------------------------------------------------------------------------------------------

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

    ;===============================================================================
    ; Description: Create a Window console to display status text information with history
    ; Parameter(s): $x - x position of the window
    ; $y - y position of the window
    ; $width - Optional - Window width
    ; $height - Optional - Window height
    ; $Title - Optional - Console Window title
    ; $text - Optional - Initial text to display.
    ; $CreateProgress - Optional - Create Progress (True/False)
    ; $BgColor - Optional - background color
    ; $FgColor - Optional - Foreground color
    ; $Transparency - Optional - Transparency (0=Invisible, 255=Visible)
    ; Requirement(s): None
    ; Return Value(s): The Console ID
    ; Author(s): Jerome DERN (jdern "at" free "dot" fr)
    ; Note(s): None
    ;===============================================================================
    Func ConsoleWinCreate($x, $y, $width=638, $height=126, $Title="Console", $Text="", $CreateProgress=False, $BgColor=0xFFFFFF, $FgColor=0xFF0000, $Transparency=255)
    Dim $Console[3]
    $Console[0] = GuiCreate($Title, $width, $height, $x, $y, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS), $WS_EX_TOOLWINDOW)
    GUISetOnEvent($GUI_EVENT_CLOSE, "ConsoleWinExitEvent")
    If $CreateProgress Then $height -= 20
    $Console[1] = GuiCtrlCreateEdit($Text & @CRLF, 0, 0, $width-1, $height-1, BitOR($ES_MULTILINE, $ES_READONLY, $ES_AUTOVSCROLL,$WS_HSCROLL,$WS_VSCROLL))
    GUICtrlSetBkColor($Console[1], $BgColor)
    GUICtrlSetColor($Console[1], $FgColor)
    GUICtrlSetResizing($Console[1], $GUI_DOCKBORDERS)
    GUICtrlSetFont($Console[1], 12, 400, 0, "Courrier New")
    $Console[2] =0
    If $CreateProgress Then $Console[2] = GUICtrlCreateProgress(0, $height+5, $width-1, 12)
    WinSetTrans($Console[0], "", $Transparency)
    GuiSetState()
    Return $Console
    EndFunc

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

    Func ConsoleWinExitEvent()
    GUIDelete(@GUI_WinHandle)
    Exit
    EndFunc

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

    ;===============================================================================
    ; Description: Write a message to the console
    ; Parameter(s): $ConsoleID - Console ID returned by ConsoleWinCreate
    ; $text - Text to display.
    ; $Progress - Optional - Progress value (0-100)
    ; $NoCRLF - Optional - Don't add CRLF and the end of text
    ; $Replace - Optional - Replace last line
    ; Requirement(s): ConsoleWinCreate called first
    ; Return Value(s): None
    ; Author(s): Jerome DERN (jdern "at" free "dot" fr)
    ; Note(s): None
    ;===============================================================================
    Func ConsoleWinWrite($ConsoleID, $Text, $Progress=-1, $Speak=False, $NoCRLF=False, $Replace=False)
    If $Replace Then
    $string = GUICtrlRead($ConsoleID[1])
    $pos = StringInStr($string, @CRLF, 0, -1)
    If $pos > 0 Then $pos += 1
    $end = StringLen($string)
    _GUICtrlEditSetSel($ConsoleID[1], $pos, $end)
    Else
    $pos = StringLen(GUICtrlRead($ConsoleID[1]))
    _GUICtrlEditSetSel($ConsoleID[1], $pos, $pos)
    EndIf
    If $NoCRLF = False Then $Text = $Text & @CRLF
    GUICtrlSetData ($ConsoleID[1], $Text, 1)
    If $Speak Then ConsoleSpeak($Text)
    If $ConsoleID[2] >0 And $Progress>=0 Then GUICtrlSetData($ConsoleID[2], $Progress)
    EndFunc

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

    ;===============================================================================
    ; Description: Ask for the user to input something
    ; Parameter(s): $ConsoleID - Console ID returned by ConsoleWinCreate
    ; $text - Text to display, the question.
    ; $Progress - Optional - Progress value (0-100)
    ; Requirement(s): ConsoleWinCreate called first
    ; Return Value(s): What user have typed.
    ; Author(s): Jerome DERN (jdern "at" free "dot" fr)
    ; Note(s): $text could be an empty string
    ;===============================================================================
    Func ConsoleWinInput($ConsoleID, $Text, $Progress=-1, $Speak = 0)
    WinSetOnTop($ConsoleID[0], "", 1)
    WinActivate($ConsoleID[0])
    $string = GUICtrlRead($ConsoleID[1])
    $pos = StringLen($string)
    _GUICtrlEditSetSel($ConsoleID[1], $pos, $pos)
    GUICtrlSetData ($ConsoleID[1], $Text, 1)
    GUICtrlSetStyle($ConsoleID[1], BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_HSCROLL, $WS_VSCROLL, $ES_WANTRETURN))
    If $Speak Then ConsoleSpeak($Text)
    If $Text <> "" Then
    ; Wait for the user to input something
    While 1
    Sleep(100)
    $String=GUICtrlRead($ConsoleID[1])
    If StringRight($string, 2) = @CRLF Then ExitLoop
    ; Ensure that everything is typed at the end of edit control
    $pos = StringLen($String)
    _GUICtrlEditSetSel($ConsoleID[1], $pos, $pos)
    WEnd
    $pos = StringInStr($string, $Text, 0, -1)
    If $pos >0 Then $pos += StringLen($Text)
    Else
    $str = $string
    ; Wait for the user to input something
    While 1
    Sleep(100)
    $String=GUICtrlRead($ConsoleID[1])
    If StringRight($string, 2) = @CRLF And $string <> $str Then ExitLoop
    ; Ensure that everything is typed at the end of edit control
    $pos = StringLen($String)
    _GUICtrlEditSetSel($ConsoleID[1], $pos, $pos)
    WEnd
    $pos = StringInStr(StringLeft($string, StringLen($string)-2), @CRLF, 0, -1)
    If $pos > 0 Then $pos += 1
    EndIf
    $string = StringMid($string, $pos)
    $string = StringLeft($string, StringLen($string)-2)
    GUICtrlSetStyle($ConsoleID[1], BitOR($ES_MULTILINE, $ES_READONLY, $ES_AUTOVSCROLL,$WS_HSCROLL,$WS_VSCROLL))
    If $ConsoleID[2] >0 And $Progress>=0 Then GUICtrlSetData($ConsoleID[2], $Progress)
    Return $string
    WinSetOnTop($ConsoleID[0], "", 0)
    EndFunc

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

    ;===============================================================================
    ; Description: Clear the console
    ; Parameter(s): $ConsoleID - The console ID
    ; Requirement(s): None
    ; Return Value(s): None
    ; Author(s): Jerome DERN (jdern "at" free "dot" fr)
    ; Note(s): None
    ;===============================================================================
    Func ConsoleWinClear($ConsoleID)
    GUICtrlSetData ($ConsoleID[1], "")
    If $ConsoleID[2] >0 Then GUICtrlSetData($ConsoleID[2], 0)
    EndFunc

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

    ;===============================================================================
    ; Description: Save the content of the console to a file
    ; Parameter(s): $ConsoleID - The console ID
    ; $FileName - The filename used to save
    ; Requirement(s): None
    ; Return Value(s): Write status, same as FileWrite
    ; Author(s): Jerome DERN (jdern "at" free "dot" fr)
    ; Note(s): None
    ;===============================================================================
    Func ConsoleWinSave($ConsoleID, $FileName)
    $string = GUICtrlRead($ConsoleID[1])
    Return FileWrite($FileName, $string)
    EndFunc

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

    ;===============================================================================
    ; Description: Ask for the user to verify input something
    ; Parameter(s): $ConsoleID - Console ID returned by ConsoleWinCreate
    ; $VAns - info to verify
    ; $Text - Text to display, the question.
    ; $VNum - Optional - to verify an Intreger
    ; $VMin - Optional - Minimum length of string
    ; $VMax - Otional - Maximum length of string
    ; Requirement(s): ConsoleWinCreate available and ConsoleWinInput called first
    ; Return Value(s): What user has typed.
    ; Author(s): Jerome DERN (jdern "at" free "dot" fr)
    ; Co - Author Valuater
    ; Note(s): $Text may not be an empty string
    ;===============================================================================
    Func ConsoleWinVerify($ConsoleID, $VAns, $Text, $VNum = False, $VMin = 1, $VMax = 1000)
    While 1
    ConsoleWinWrite($ConsoleID, "You have answered: " & $VAns)
    $VLen = StringLen($VAns)
    If $VNum And Int($VAns) > 0 And $VLen >= $VMin And $VLen <= $VMax Then
    If ConsoleWinInput($ConsoleID, 'Is this Correct? "Y" or "N" ') = "y" Then Return $VAns
    ElseIf Not $VNum And $VLen >= $VMin And $VLen <= $VMax Then
    If ConsoleWinInput($ConsoleID, 'Is this Correct? "Y" or "N" ') = "y" Then Return $VAns
    EndIf
    $VAns = ConsoleWinInput($ConsoleID, $Text)
    Sleep(10)
    WEnd
    EndFunc

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

    Func ConsoleSpeak($S_text)
    Local $oi_speech = ObjCreate("SAPI.SpVoice")
    $oi_speech.Speak ($S_text)
    $oi_speech = ""
    EndFunc

    [/autoit]