GUI falsche werte ausgelesen?

  • Hallo

    folgendes problem liegt vor:

    Das GUI funktioniert einbahnfrei

    jedoch ließt der per Guicrtlread befehl falsche werte aus (oder die if funktion funktioniert nicht)

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <IE.au3>
    #Region ### START Koda GUI section ###
    $Form1_1 = GUICreate("Auto Login Bot by MarcoPolo", 413, 298, 216, 138)
    GUISetBkColor(0x000080)
    $PageControl1 = GUICtrlCreateTab(8, 8, 284, 256)
    GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
    $TabSheet1 = GUICtrlCreateTabItem("Logindaten")
    $Login = GUICtrlCreateInput("Login", 24, 80, 153, 22)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xD8E4F8)
    $Pass = GUICtrlCreateInput("Pass", 24, 160, 153, 22, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xD8E4F8)
    $Loginname = GUICtrlCreateLabel("Loginname eintragen", 24, 56, 104, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Passwort = GUICtrlCreateLabel("Passwort eintragen", 24, 136, 99, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFBF0)
    $TabSheet2 = GUICtrlCreateTabItem("Server")
    $ServerSlider = GUICtrlCreateSlider(76, 49, 150, 37)
    GUICtrlSetLimit(-1, 3, 1)
    GUICtrlSetData(-1, 1)
    $Server = GUICtrlCreateLabel("Server1 Server2 Server3", 72, 88, 164, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFBF0)
    $Channel1 = GUICtrlCreateRadio("Channel 1", 72, 136, 65, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Channel2 = GUICtrlCreateRadio("Channel 2", 72, 176, 65, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Channel3 = GUICtrlCreateRadio("Channel 3", 72, 216, 65, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Channel4 = GUICtrlCreateRadio("Channel 4", 169, 136, 73, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Channel5 = GUICtrlCreateRadio("Channel 5", 169, 176, 71, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Channel6 = GUICtrlCreateRadio("Channel 6", 169, 216, 73, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlCreateTabItem("")
    $Button1 = GUICtrlCreateButton("&OK", 22, 272, 75, 25, 0)
    $Button2 = GUICtrlCreateButton("&Abbrechen", 110, 272, 75, 25, 0)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $Button2
    Exit
    Case $Button1
    MsgBox (4096, "Login", GUICtrlRead($Login))
    MsgBox (4096, "Password", GUICtrlRead($Pass))
    MsgBox (4096, "Server", GUICtrlRead($ServerSlider))
    MsgBox (4096, "Channel1", GUICtrlRead($Channel1))
    MsgBox (4096, "Channel2", GUICtrlRead($Channel2))
    MsgBox (4096, "Channel3", GUICtrlRead($Channel3))
    MsgBox (4096, "Channel4", GUICtrlRead($Channel4))
    MsgBox (4096, "Channel5", GUICtrlRead($Channel5))
    MsgBox (4096, "Channel6", GUICtrlRead($Channel6))
    Run ( "Notepad" , "" )
    Sleep (15000)
    if $ServerSlider = 1 Then
    Mouseclick ( "left" , 256, 387 , 1 )
    Sleep (100)
    endif
    If $ServerSlider = 2 Then
    Mouseclick ( "left" , 261, 402 , 1 )
    Sleep (100)
    endif
    If $ServerSlider = 3 Then
    Mouseclick ( "left" , 262, 420 , 1 )
    Sleep (100)
    endif
    Sleep (1000)
    If $Channel1 = 1 Then
    Mouseclick ( "left" , 517, 385 , 1 )
    Sleep (100)
    endif
    If $Channel2 = 1 Then
    Mouseclick ( "left" , 517, 403 , 1 )
    Sleep (100)
    endif
    If $Channel3 = 1 Then
    Mouseclick ( "left" , 517, 419 , 1 )
    Sleep (100)
    endif
    If $Channel4 = 1 Then
    Mouseclick ( "left" , 517, 437 , 1 )
    Sleep (100)
    endif
    If $Channel5 = 1 Then
    Mouseclick ( "left" , 517, 454 , 1 )
    Sleep (100)
    endif
    If $Channel6 = 1 Then
    Mouseclick ( "left" , 517, 471 , 1 )
    Sleep (100)
    endif
    sleep (1000)
    Mouseclick ( "left" , 528, 517 , 1 )
    sleep (1000)

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

    EndSwitch
    WEnd

    [/autoit]

    kann man sonst noch was benutzten um die ausgelsenenden werte zu benutzten?

    Edit BugFix: Tags gesetzt

    2 Mal editiert, zuletzt von MarcoPolo (10. März 2008 um 13:27)

    • Offizieller Beitrag

    Wenn du die Werte nur in die MsgBox ausliest, kannst du sie auch nicht auswerten.
    Du mußt die Werte an eine Variable übergeben und dann diese auswerten, momentan fragst du nur die ID's ab. ;)
    So in etwa sollte es aussehen:

    [autoit]

    $Value_Slider1 = GuiCtrlRead($Slider1)
    Switch $Value_Slider1
    Case 1
    ; Code
    Case 10
    ; Code
    Case 50
    ; Code
    EndSwitch

    [/autoit]