Results 1 to 3 of 3

Thread: Recipe with autoit

  1. #1
    Constant Bitrate
    Join Date
    Aug 2007
    Posts
    167

    Recipe with autoit

    hello , here i have a script with autoit , but need somethink thinks

    1- add to use with osk RR
    2-use the button of RR
    3-the script when run , and add any recipe , show a popup screen for confimation , how i can add those popup with RR


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <WindowsConstants.au3>
    #Include <Array.au3>

    $GUI = GUICreate("RECIPES", 800, 500, 0 ,0, $WS_POPUP ) ;CUADRO TOTAL TAMANO CON FRAMELESS



    GUICtrlCreateLabel("INGREDIENTES",220,65,80,20);La bel INGREDIENTES Top section
    GUICtrlSetColor(-1, 0xff0000)
    GUISetState(@SW_SHOW)
    GUICtrlCreateLabel("PREPARACION",220,235,80,20);La bel PREPARACION Top section
    GUICtrlSetColor(-1, 0xFF0000)
    GUISetState(@SW_SHOW)


    $NewRecipeButton = GUICtrlCreateButton("New Recipe", 40, 0, 125, 42, $WS_GROUP) ;TAMANO Y POSICION DEL BOTON DE NEW RECIPE
    GUICtrlSetFont(-1, 11, 800, 2, "HandelGotDL") ;TAMANO DE LETRA DEL BOTON DE NEW RECIPE
    $RecipeListBox = GUICtrlCreateList("", 10, 45, 200, 450) ;TAMANO Y UBICACION DEL CUADRO DE LIST
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman") ;TAMANO DE LETRA DE LIST

    $TitleInput = GUICtrlCreateInput("", 270, 15, 335, 30) ;TAMANO Y UBICACION CUADRO TITULO
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")




    Dim $Ing[11]
    Dim $Q[11]
    Dim $QT[11]

    $Ing[1] = GUICtrlCreateInput("", 265, 80, 185, 25)
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")
    $Q[1] = GUICtrlCreateInput("", 220, 80, 40, 25)


    $Ing[2] = GUICtrlCreateInput("", 265, 105, 185, 25)
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")
    $Q[2] = GUICtrlCreateInput("", 220, 105, 40, 25)


    $Ing[3] = GUICtrlCreateInput("", 265, 130, 185, 25)
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")
    $Q[3] = GUICtrlCreateInput("", 220, 130, 40, 25)


    $Ing[4] = GUICtrlCreateInput("", 265, 155, 185, 25)
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")
    $Q[4] = GUICtrlCreateInput("", 220, 155, 40, 25)


    $Ing[5] = GUICtrlCreateInput("", 265, 180, 185, 25)
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")
    $Q[5] = GUICtrlCreateInput("", 220, 180, 40, 25)


    $Ing[6] = GUICtrlCreateInput("", 500, 80, 185, 25)
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")
    $Q[6] = GUICtrlCreateInput("", 455, 80, 40, 25)


    $Ing[7] = GUICtrlCreateInput("", 500, 105, 185, 25)
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")
    $Q[7] = GUICtrlCreateInput("", 455, 105, 40, 25)


    $Ing[8] = GUICtrlCreateInput("", 500, 130, 185, 25)
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")
    $Q[8] = GUICtrlCreateInput("", 455, 130, 40, 25)


    $Ing[9] = GUICtrlCreateInput("", 500, 155, 185, 25)
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")
    $Q[9] = GUICtrlCreateInput("", 455, 155, 40, 25)

    $Ing[10] = GUICtrlCreateInput("", 500, 180, 185, 25)
    GUICtrlSetFont(-1, 12, 400, 2, "Times New Roman")
    $Q[10] = GUICtrlCreateInput("", 455, 180, 40, 25)

    $InstructionBox = GUICtrlCreateEdit("", 220, 250, 500, 200, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETU RN,$WS_VSCROLL)) ; CUADRO DE PREPARAION
    GUICtrlSetFont(-1, 13, 400, 2, "Times New Roman")

    $SaveButton = GUICtrlCreateButton("Save", 280, 453, 165, 42, $WS_GROUP) ; BOTON DE SAVE
    GUICtrlSetFont(-1, 15, 800, 2, "HandelGotDL") ; LETRA DEL BOTON DE SAVE


    $DiscardButton = GUICtrlCreateButton("Discard", 495, 453, 165, 42, $WS_GROUP) ; BOTON DE DISCAR
    GUICtrlSetFont(-1, 15, 800, 2, "HandelGotDL") ; LETRA DEL BOTON DE DISCAR
    LoadFirstRecipe()
    RecipeListBoxRefresh()
    GUISetState(@SW_SHOW)


    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $RecipeListBox
    LoadRecipe()
    Case $NewRecipeButton
    NewRecipe()
    Case $SaveButton
    SaveRecipe()
    Case $DiscardButton
    Discard()
    EndSwitch
    WEnd

    Func NewRecipe()
    $SaveTitleData = GUICtrlRead($TitleInput)
    If FileExists(@ScriptDir & "\SB-" & $SaveTitleData & ".txt") Then
    ResetInputs()
    Else
    $ForgotSaveMsgBox = MsgBox(4, "Save?", "Before you go on, do you want to save this " & $SaveTitleData & " recipe?")
    If $ForgotSaveMsgBox = 6 then
    WriteSaveFile()
    ResetInputs()
    Else
    ResetInputs()
    EndIf
    EndIf
    EndFunc

    Func ResetInputs()
    GUICtrlSetData($TitleInput, "")
    For $Number = 1 to 10
    GUICtrlSetData($Ing[$Number], "")
    GUICtrlSetData($Q[$Number], "")

    Next
    GUICtrlSetData($InstructionBox, "")
    EndFunc

    Func SaveRecipe()
    $SaveTitleData = GUICtrlRead($TitleInput)
    If FileExists(@ScriptDir & "\SB-" & $SaveTitleData & ".txt") Then
    $OverwriteMsgBox = MsgBox(4, "Overwrite?", "Do you want to overwrite your other " & $SaveTitleData & " recipe?")
    If $OverwriteMsgBox = 6 then
    FileDelete(@ScriptDir & "\PB-" & $SaveTitleData & ".txt")
    WriteSaveFile()
    EndIf
    Else
    WriteSaveFile()
    EndIf
    EndFunc

    Func WriteSaveFile()
    $SaveTitleData = GUICtrlRead($TitleInput)
    FileWrite(@ScriptDir & "\SB-" & $SaveTitleData & ".txt", $SaveTitleData & @TAB)

    For $Number = 1 to 10
    $SaveIngData = GUICtrlRead($Ing[$Number])
    FileWrite(@ScriptDir & "\SB-" & $SaveTitleData & ".txt", $SaveIngData & @TAB)
    $SaveQData = GUICtrlRead($Q[$Number])
    FileWrite(@ScriptDir & "\SB-" & $SaveTitleData & ".txt", $SaveQData & @TAB)
    $SaveQTData = GUICtrlRead($QT[$Number])
    FileWrite(@ScriptDir & "\SB-" & $SaveTitleData & ".txt", $SaveQTData & @TAB)
    Next

    $SaveInstructionData = GUICtrlRead($InstructionBox)
    FileWrite(@ScriptDir & "\SB-" & $SaveTitleData & ".txt", $SaveInstructionData)

    If FileExists(@ScriptDir & "\SB-" & $SaveTitleData & ".txt") Then
    MsgBox(0, "Success!", "Your " & $SaveTitleData & " recipe has been saved.")
    RecipeListBoxRefresh()
    EndIf
    EndFunc

    Func RecipeListBoxRefresh()
    GUICtrlSetData($RecipeListBox, "")
    $FileSearch = FileFindFirstFile("SB-*.*")
    While 1
    $RecipeFile = FileFindNextFile($FileSearch)
    If @Error Then ExitLoop
    GUICtrlSetData($RecipeListBox, $RecipeFile & "|")
    WEnd
    FileClose($FileSearch)
    EndFunc

    Func LoadFirstRecipe()
    GUICtrlSetData($RecipeListBox, "")
    $FileSearch = FileFindFirstFile("SB-*.*")
    $RecipeFile = FileFindNextFile($FileSearch)
    If @Error Then
    MsgBox(0, "No recipes!", "You don't have any recipes yet.")
    Else
    $LoadData=FileRead(@ScriptDir & "\" & $RecipeFile )
    $LoadData = StringSplit($LoadData, @TAB)

    GUICtrlSetData($TitleInput, $LoadData[1])
    For $Number = 1 to 10
    $ArrayNumber=3 * $Number - 1
    GUICtrlSetData($Ing[$Number], $LoadData[$ArrayNumber])
    $ArrayNumber=3 * $Number
    GUICtrlSetData($Q[$Number], $LoadData[$ArrayNumber])
    $ArrayNumber=3 * $Number + 1
    GUICtrlSetData($QT[$Number], $LoadData[$ArrayNumber])
    Next
    GUICtrlSetData($InstructionBox, $LoadData[32])
    EndIf
    EndFunc

    Func LoadRecipe()
    $SaveTitleData = GUICtrlRead($TitleInput)
    If FileExists(@ScriptDir & "\SB-" & $SaveTitleData & ".txt") Then
    LoadSaveFile()
    Else
    $ForgotSaveMsgBox = MsgBox(4, "Save?", "Before you go on, do you want to save this " & $SaveTitleData & " recipe?")
    If $ForgotSaveMsgBox = 6 then
    SaveRecipe()
    LoadSaveFile()
    Else
    LoadSaveFile()
    EndIf
    EndIf
    EndFunc

    Func LoadSaveFile()
    $RecipePressed = GUICtrlRead($RecipeListBox)
    $LoadData=FileRead(@ScriptDir & "\" & $RecipePressed )
    $LoadData = StringSplit($LoadData, @TAB)

    GUICtrlSetData($TitleInput, $LoadData[1])
    For $Number = 1 to 10
    $ArrayNumber=3 * $Number - 1
    GUICtrlSetData($Ing[$Number], $LoadData[$ArrayNumber])
    $ArrayNumber=3 * $Number
    GUICtrlSetData($Q[$Number], $LoadData[$ArrayNumber])
    $ArrayNumber=3 * $Number + 1
    GUICtrlSetData($QT[$Number], $LoadData[$ArrayNumber])
    Next
    GUICtrlSetData($InstructionBox, $LoadData[32])
    EndFunc

    Func Discard()
    $SaveTitleData = GUICtrlRead($TitleInput)
    $DeleteMsgBox = MsgBox(4, "Delete?", "Are you sure you want to delete your " & $SaveTitleData & " recipe?")
    If $DeleteMsgBox = 6 Then
    ResetInputs()
    If FileExists(@ScriptDir & "\SB-" & $SaveTitleData & ".txt") then FileDelete(@ScriptDir & "\SB-" & $SaveTitleData & ".txt")
    RecipeListBoxRefresh()
    EndIf
    EndFunc
    Attached Images Attached Images  

  2. #2
    Constant Bitrate
    Join Date
    Aug 2007
    Posts
    167
    hi , anyone know what command is for call el RRosk for working with this autoit script ?

  3. #3
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,838
    Just add these line after your include lines!
    Code:
    if not ProcessExists("RoadRunner.exe") Then
    	MsgBox(16, "!Error", "Road Runner Must Be Running")
    	Exit
    EndIf
    $rr = ObjCreate("RoadRunner.SDK")
    After that, you will use all RR commands:
    $rr.Execute("...")
    $rr.SetUserVar("MYVAR","1")

    etc...

Similar Threads

  1. CAN bus sniffing hardware / software recipe
    By Daluv in forum Engine Management, OBD-II, Engine Diagnostics, etc.
    Replies: 6
    Last Post: 05-29-2012, 07:23 PM
  2. MDX and AutoIt with COM
    By JiC in forum FB Software
    Replies: 2
    Last Post: 12-21-2008, 09:03 PM
  3. Kitchen PC Recipe Program Developers needed...
    By Spacewaya in forum Coders Corner
    Replies: 12
    Last Post: 07-31-2008, 12:31 PM
  4. AutoIt and RR
    By montgomeryt in forum Road Runner
    Replies: 0
    Last Post: 12-09-2007, 12:41 PM
  5. KITCHEN PC: Recipe Plugin (please read)...
    By Spacewaya in forum RR Plugins
    Replies: 20
    Last Post: 01-09-2007, 11:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •