Combox auslesen und in Edit anderen wert schreiben.

  • Hi Leute
    Ich habe eine Gui ( Server Settings ) mit Combo ( Ja|Nein), einen Button ( Set Settings) und ein Edit.
    Wenn ich in der Combo ja oder nein anklicke, drücke den Button und der wert wird in die Edit geschrieben
    Meine Frage , Ist es möglich wenn ich in der Combo Nein klicke das es den wert 0 anstelle von Nein in die Edit schreibt?
    Und anstelle von Ja den wert 1.

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Server Settings", 237, 439, 361, 122)
    $Combo1 = GUICtrlCreateCombo("", 9, 69, 145, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_DROPDOWNLIST))
    GUICtrlSetData(-1, "Yes|No")
    $Label1 = GUICtrlCreateLabel("Friendly Fire", 9, 48, 60, 17)
    $Edit1 = GUICtrlCreateEdit("", 6, 187, 196, 89, BitOR($GUI_SS_DEFAULT_EDIT,$ES_READONLY))
    GUICtrlSetData(-1, "")
    $Button1 = GUICtrlCreateButton("Set Settings", 11, 120, 75, 25)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $s = 'SetSetting friendly_fire '
    $read = GUICtrlRead($Combo1)
    GUICtrlSetData ($Edit1,$s & $read)

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

    EndSwitch
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von VinceA (25. Februar 2013 um 18:19)

  • Hi !
    Es ist auch möglich mehrere Werte zu unterscheiden, als nur ja oder nein.

    Spoiler anzeigen
    [autoit]


    GUICreate("Combo-Tut", 280, 80)
    $cmbCombo = GUICtrlCreateCombo("", 10, 5, 260, 20)
    GUICtrlSetData($cmbCombo, "|Fall 1|Fall 2|Fall 3")
    $btnEx = GUICtrlCreateButton("Example 1-3", 190, 40, 80, 22)
    GUISetState()

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

    While True
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case -3 ;i $GUI_EVENT_CLOSE
    ExitLoop
    Case $btnEx
    ;i Example 1
    MsgBox(0, "1. Example", GUICtrlRead($cmbCombo))

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

    ;i Example 2
    $comboRead = GUICtrlRead($cmbCombo)
    If $comboRead = "Fall 1" Then
    MsgBox(64, "2. Example", "Der Erste.")
    ElseIf $comboRead = "Fall 2" Then
    MsgBox(64, "2. Example", "Der Zweite.")
    ElseIf $comboRead = "Fall 3" Then
    MsgBox(64, "2. Example", "Der Dritte.")
    Else
    MsgBox(48, "2. Example", "Der Ausnahmefall.")
    EndIf

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

    ;i Example 3
    $comboRead = GUICtrlRead($cmbCombo)
    $Flag = 64
    $sHeader = "3. Example"
    Switch $comboRead
    Case "Fall 1"
    $Msg = "Der Erste."
    Case "Fall 2"
    $Msg = "Der Zweite."
    Case "Fall 3"
    $Msg = "Der Dritte."
    Case Else
    $Flag = 48
    $sHeader = "Oh oh"
    $Msg = "Keiner der definierten Fälle !"
    EndSwitch
    MsgBox($Flag, $sHeader, StringFormat("%s \n\n %s", $comboRead, $Msg) & @TAB)
    EndSwitch
    WEnd
    ; Ende

    [/autoit]


    Da der User Deines Scriptes eine weitere Einstellungsmöglichkeit hat:

    Spoiler anzeigen
    [autoit]


    #include <ComboConstants.au3>
    #include <EditConstants.au3>
    #region ### START Koda GUI section ###
    GUICreate("Server Settings", 237, 439, 361, 122)
    $Combo = GUICtrlCreateCombo("", 9, 69, 145, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
    GUICtrlSetData(-1, "Yes|No")
    GUICtrlCreateLabel("Friendly Fire", 9, 48, 60, 17)
    $Edit = GUICtrlCreateEdit("", 6, 187, 210, 89, BitOR($GUI_SS_DEFAULT_EDIT, $ES_READONLY))
    $Button = GUICtrlCreateButton("Set Settings", 11, 120, 75, 25)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

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

    While True
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case -3
    ExitLoop
    Case $Button
    $s = 'SetSetting friendly_fire '
    $read = GUICtrlRead($Combo)
    Switch $read
    Case "Yes"
    $write = 1
    Case "No"
    $write = 0
    Case Else
    $write = "keine Eingabe"
    EndSwitch
    GUICtrlSetData($Edit, $s & $write)
    EndSwitch
    WEnd
    ; Ende

    [/autoit]
  • Vielen dank fü die schnelle Hilfe.
    Ich habe beide Methoden ausprobiert, Tip Top.

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ListViewConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section
    $Form2 = GUICreate("FC2 Server Settings", 604, 646, 250, 133)
    $Edit1 = GUICtrlCreateEdit("", 257, 442, 334, 154, BitOR($GUI_SS_DEFAULT_EDIT,$ES_READONLY), $WS_EX_STATICEDGE)
    GUICtrlSetData(-1, "")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Input1 = GUICtrlCreateInput("", 3, 33, 219, 21)
    $Combo1 = GUICtrlCreateCombo("", 100, 76, 121, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE))
    GUICtrlSetData(-1, "Deathmatch|TeamDeathmatch|Uprising|Capture The Diamonds")
    $Label1 = GUICtrlCreateLabel("Server Name", 4, 11, 66, 17)
    GUICtrlSetTip(-1, "maximum of 32 characters (single-byte)")
    $Label2 = GUICtrlCreateLabel("Game Mode", 4, 80, 62, 17)
    $Label3 = GUICtrlCreateLabel("Network Type", 4, 108, 71, 17)
    $Combo2 = GUICtrlCreateCombo("", 100, 103, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Online|LAN")
    $Label19 = GUICtrlCreateLabel("Admin Password", 4, 556, 82, 17)
    $Label5 = GUICtrlCreateLabel("Hardcore Mode", 4, 164, 78, 17)
    $Label17 = GUICtrlCreateLabel("Max Score", 4, 500, 55, 17)
    $Label8 = GUICtrlCreateLabel("Allow Voting", 4, 248, 62, 17)
    $Label7 = GUICtrlCreateLabel("Start Rank", 4, 223, 55, 17)
    $Label20 = GUICtrlCreateLabel("Time Of Day", 4, 584, 63, 17)
    $Label21 = GUICtrlCreateLabel("Wheather Type", 4, 612, 78, 17)
    $Combo4 = GUICtrlCreateCombo("", 100, 160, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Combo15 = GUICtrlCreateCombo("", 100, 496, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "0|5|10|15|20|25|20|40|50|100|200")
    $Combo7 = GUICtrlCreateCombo("", 100, 244, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Combo6 = GUICtrlCreateCombo("", 100, 216, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10|11|12|13|14|45|16|17|18|19")
    $Combo17 = GUICtrlCreateCombo("", 100, 581, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "MapDefault|Random|Dawn|Midday|Dusk|Night")
    $Combo18 = GUICtrlCreateCombo("", 100, 608, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Clear|Windy|Varied|Overcast|Stormy|Random")
    $Combo13 = GUICtrlCreateCombo("", 100, 440, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Combo14 = GUICtrlCreateCombo("", 98, 467, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Infinite|5min|10min|15min|20min|25min|30min|60min")
    $Combo5 = GUICtrlCreateCombo("", 100, 188, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Combo8 = GUICtrlCreateCombo("", 100, 300, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16")
    $Combo9 = GUICtrlCreateCombo("", 100, 329, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16")
    $Combo16 = GUICtrlCreateCombo("", 100, 524, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Detect public IP|Use local IP")
    $Label15 = GUICtrlCreateLabel("Join In Progress", 4, 444, 79, 17)
    $Label16 = GUICtrlCreateLabel("Round Time", 4, 472, 62, 17)
    $Label6 = GUICtrlCreateLabel("Punk Buster", 4, 192, 62, 17)
    $Label10 = GUICtrlCreateLabel("Minimum Players", 4, 304, 82, 17)
    $Label11 = GUICtrlCreateLabel("Maximum Players", 4, 332, 85, 17)
    $Label18 = GUICtrlCreateLabel("Detect Address", 4, 528, 80, 17)
    $Label4 = GUICtrlCreateLabel("Ranked Match", 4, 136, 75, 17)
    $Combo3 = GUICtrlCreateCombo("", 100, 132, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Label12 = GUICtrlCreateLabel("TeamBalance", 4, 360, 70, 17)
    $Combo10 = GUICtrlCreateCombo("", 100, 356, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Label13 = GUICtrlCreateLabel("TeamSwap", 4, 388, 58, 17)
    $Combo11 = GUICtrlCreateCombo("", 100, 384, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Label14 = GUICtrlCreateLabel("Friendly Fire", 4, 416, 60, 17)
    $Combo12 = GUICtrlCreateCombo("", 100, 412, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Label9 = GUICtrlCreateLabel("Match Password", 4, 276, 83, 17)
    $Input2 = GUICtrlCreateInput("", 100, 272, 121, 21)
    $Input3 = GUICtrlCreateInput("", 100, 552, 121, 21)
    $ListView1 = GUICtrlCreateListView("", 257, 75, 334, 206)
    $Button1 = GUICtrlCreateButton("Set Settings", 300, 607, 75, 22)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $s1 = 'SetSetting server_name '
    $s2 = 'SetSetting gamemode '
    $s3 = 'SetSetting map_cycle '
    $s4 = 'User Maps\downloads\'
    $s9 = 'SetSetting start_rank '
    $s11 = 'SetSetting matchPassword '
    $s12 = 'SetSetting minplayers '
    $s13 = 'SetSetting maxplayers '
    $s19 = 'SetSetting max_score '
    $s21 = 'SetSetting remotePassword '

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

    $i1 = GUICtrlRead($Input1)
    $i2 = GUICtrlRead($Input2)
    $i3 = GUICtrlRead($Input3)
    $c1 = GUICtrlRead($Combo1)
    $c6 = GUICtrlRead($Combo6)
    $c8 = GUICtrlRead($Combo8)
    $c9 = GUICtrlRead($Combo9)
    $c15 = GUICtrlRead($Combo15)

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

    $s5 = 'SetSetting network_type '
    $c2 = GUICtrlRead($Combo2)
    $write1 = 1
    $s6 = 'SetSetting ranked_match '
    $c3 = GUICtrlRead($Combo3)
    $write2 = 1
    If $c3 = "No" Then $write2 = 0

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

    $s7 = 'SetSetting hardcore_mode '
    $c4 = GUICtrlRead($Combo4)
    $write3 = 1
    If $c4 = "No" Then $write3 = 0

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

    $s8 = 'SetSetting match_pb_enabled '
    $c5 = GUICtrlRead($Combo5)
    $write4 = 1
    If $c5 = "No" Then $write4 = 0

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

    $s10 = 'SetSetting allow_voting '
    $c7 = GUICtrlRead($Combo7)
    $write5 = 1
    If $c7 = "No" Then $write5 = 0

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

    $s14 = 'SetSetting teambalance '
    $c10 = GUICtrlRead($Combo10)
    $write6 = 1
    If $c10 = "No" Then $write6 = 0

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

    $s15 = 'SetSetting teamswap '
    $c11 = GUICtrlRead($Combo11)
    $write7 = 1
    If $c11 = "No" Then $write7 = 0

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

    $s16 = 'SetSetting friendly_fire '
    $c12 = GUICtrlRead($Combo12)
    $write8 = 1
    If $c12 = "No" Then $write8 = 0

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

    $s17 = 'SetSetting joinprogress '
    $c13 = GUICtrlRead($Combo13)
    $write9 = 1
    If $c13 = "No" Then $write9 = 0

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

    $s18 = 'SetSetting inroundtime '
    $c14 = GUICtrlRead($Combo14)
    $write10 = 900
    If $c14 = "Infinite" Then $write10 = 0
    If $c14 = "5min" Then $write10 = 300
    If $c14 = "10min" Then $write10 = 600
    If $c14 = "20min" Then $write10 = 1200
    If $c14 = "25min" Then $write10 = 1500
    If $c14 = "30min" Then $write10 = 1800
    If $c14 = "60min" Then $write10 = 3600

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

    $s20 = 'SetSetting detectPublicAddress '
    $c16 = GUICtrlRead($Combo16)
    $write11 = 0
    If $c16 = "Detect public IP" Then $write11 = 1

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

    $s22 = 'SetSetting time_of_day '
    $c17 = GUICtrlRead($Combo17)
    $write12 = 0
    If $c17 = "Random" Then $write12 = -1
    If $c17 = "Dawn" Then $write12 = 6
    If $c17 = "Midday" Then $write12 = 11
    If $c17 = "Dusk" Then $write12 = 21
    If $c17 = "Night" Then $write12 = 23

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

    $s23 = 'SetSetting weather_type '
    $c18 = GUICtrlRead($Combo18)
    $write13 = 0
    If $c18 = "Windy" Then $write13 = 225
    If $c18 = "Varied" Then $write13 = 50
    If $c18 = "Overcast" Then $write13 = 75
    If $c18 = "Stormy" Then $write13 = 100
    If $c18 = "Random" Then $write13 = -1

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

    GUICtrlSetData($Edit1, $s1 & $i1 & @CRLF & $s2 & $c1 & @CRLF & $s3 & $s4 & @CRLF & $s5 & $write1& @CRLF & $s6 & $write2 & @CRLF & _
    $s7 & $write3 & @CRLF & $s8 & $write4 & @CRLF & $s9 & $c6 & @CRLF & $s10 & $write5 & @CRLF & $s11 & $i2 & @CRLF & $s12& $c8 & @CRLF & _
    $s13 & $c9 & @CRLF & $s14 & $write6 & @CRLF & $s15 & $write7 & @CRLF & $s16 & $write8 & @CRLF & $s17 & $write9 & @CRLF & _
    $s18 & $write10 & @CRLF & $s19 & $c15 & @CRLF & $s20 & $write11 & @CRLF & $s21 & $i3 & @CRLF & $s22 & $write12 & @CRLF & _
    $s23 & $write13)

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

    EndSwitch
    WEnd

    [/autoit]
    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ListViewConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section
    $Form2 = GUICreate("FC2 Server Settings", 604, 646, 250, 133)
    $Edit1 = GUICtrlCreateEdit("", 257, 442, 334, 154, BitOR($GUI_SS_DEFAULT_EDIT,$ES_READONLY), $WS_EX_STATICEDGE)
    GUICtrlSetData(-1, "")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Input1 = GUICtrlCreateInput("", 3, 33, 219, 21)
    $Combo1 = GUICtrlCreateCombo("", 100, 76, 121, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE))
    GUICtrlSetData(-1, "Deathmatch|TeamDeathmatch|Uprising|Capture The Diamonds")
    $Label1 = GUICtrlCreateLabel("Server Name", 4, 11, 66, 17)
    GUICtrlSetTip(-1, "maximum of 32 characters (single-byte)")
    $Label2 = GUICtrlCreateLabel("Game Mode", 4, 80, 62, 17)
    $Label3 = GUICtrlCreateLabel("Network Type", 4, 108, 71, 17)
    $Combo2 = GUICtrlCreateCombo("", 100, 103, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Online|LAN")
    $Label19 = GUICtrlCreateLabel("Admin Password", 4, 556, 82, 17)
    $Label5 = GUICtrlCreateLabel("Hardcore Mode", 4, 164, 78, 17)
    $Label17 = GUICtrlCreateLabel("Max Score", 4, 500, 55, 17)
    $Label8 = GUICtrlCreateLabel("Allow Voting", 4, 248, 62, 17)
    $Label7 = GUICtrlCreateLabel("Start Rank", 4, 223, 55, 17)
    $Label20 = GUICtrlCreateLabel("Time Of Day", 4, 584, 63, 17)
    $Label21 = GUICtrlCreateLabel("Wheather Type", 4, 612, 78, 17)
    $Combo4 = GUICtrlCreateCombo("", 100, 160, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Combo15 = GUICtrlCreateCombo("", 100, 496, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "0|5|10|15|20|25|20|40|50|100|200")
    $Combo7 = GUICtrlCreateCombo("", 100, 244, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Combo6 = GUICtrlCreateCombo("", 100, 216, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10|11|12|13|14|45|16|17|18|19")
    $Combo17 = GUICtrlCreateCombo("", 100, 581, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "MapDefault|Random|Dawn|Midday|Dusk|Night")
    $Combo18 = GUICtrlCreateCombo("", 100, 608, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Clear|Windy|Varied|Overcast|Stormy|Random")
    $Combo13 = GUICtrlCreateCombo("", 100, 440, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Combo14 = GUICtrlCreateCombo("", 98, 467, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Infinite|5min|10min|15min|20min|25min|30min|60min")
    $Combo5 = GUICtrlCreateCombo("", 100, 188, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Combo8 = GUICtrlCreateCombo("", 100, 300, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16")
    $Combo9 = GUICtrlCreateCombo("", 100, 329, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16")
    $Combo16 = GUICtrlCreateCombo("", 100, 524, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Detect public IP|Use local IP")
    $Label15 = GUICtrlCreateLabel("Join In Progress", 4, 444, 79, 17)
    $Label16 = GUICtrlCreateLabel("Round Time", 4, 472, 62, 17)
    $Label6 = GUICtrlCreateLabel("Punk Buster", 4, 192, 62, 17)
    $Label10 = GUICtrlCreateLabel("Minimum Players", 4, 304, 82, 17)
    $Label11 = GUICtrlCreateLabel("Maximum Players", 4, 332, 85, 17)
    $Label18 = GUICtrlCreateLabel("Detect Address", 4, 528, 80, 17)
    $Label4 = GUICtrlCreateLabel("Ranked Match", 4, 136, 75, 17)
    $Combo3 = GUICtrlCreateCombo("", 100, 132, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Label12 = GUICtrlCreateLabel("TeamBalance", 4, 360, 70, 17)
    $Combo10 = GUICtrlCreateCombo("", 100, 356, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Label13 = GUICtrlCreateLabel("TeamSwap", 4, 388, 58, 17)
    $Combo11 = GUICtrlCreateCombo("", 100, 384, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Label14 = GUICtrlCreateLabel("Friendly Fire", 4, 416, 60, 17)
    $Combo12 = GUICtrlCreateCombo("", 100, 412, 121, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Yes|No")
    $Label9 = GUICtrlCreateLabel("Match Password", 4, 276, 83, 17)
    $Input2 = GUICtrlCreateInput("", 100, 272, 121, 21)
    $Input3 = GUICtrlCreateInput("", 100, 552, 121, 21)
    $ListView1 = GUICtrlCreateListView("", 257, 75, 334, 206)
    $Button1 = GUICtrlCreateButton("Set Settings", 300, 607, 75, 22)
    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 $Button1
    $s1 = 'SetSetting server_name '
    $s2 = 'SetSetting gamemode '
    $s3 = 'SetSetting map_cycle '
    $s4 = 'User Maps\downloads\'
    $s9 = 'SetSetting start_rank '
    $s11 = 'SetSetting matchPassword '
    $s12 = 'SetSetting minplayers '
    $s13 = 'SetSetting maxplayers '
    $s19 = 'SetSetting max_score '
    $s21 = 'SetSetting remotePassword '

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

    $i1 = GUICtrlRead($Input1)
    $i2 = GUICtrlRead($Input2)
    $i3 = GUICtrlRead($Input3)
    $c1 = GUICtrlRead($Combo1)
    $c6 = GUICtrlRead($Combo6)
    $c8 = GUICtrlRead($Combo8)
    $c9 = GUICtrlRead($Combo9)
    $c15 = GUICtrlRead($Combo15)

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

    Local $write1
    Local $write2
    Local $write3
    Local $write4
    Local $write5
    Local $write6
    Local $write7
    Local $write8
    Local $write9
    Local $write10
    Local $write11
    Local $write12
    Local $write13

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

    $s5 = 'SetSetting network_type '
    $c2 = GUICtrlRead($Combo2)
    Switch $c2
    Case "Online"
    $write1 = 1
    Case "LAN"
    $write1 = 0
    Case Else
    MsgBox(16, 'Error',"Network Type Is Empty")
    EndSwitch

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

    $s6 = 'SetSetting ranked_match '
    $c3 = GUICtrlRead($Combo3)
    Switch $c3
    Case "Yes"
    $write2 = 1
    Case "No"
    $write2 = 0
    Case Else
    MsgBox(16, 'Error',"Ranked Match Is Empty")

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

    EndSwitch

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

    $s7 = 'SetSetting hardcore_mode '
    $c4 = GUICtrlRead($Combo4)
    Switch $c4
    Case "Yes"
    $write3 = 1
    Case "No"
    $write3 = 0
    Case Else
    MsgBox(16, 'Error',"Hardcore Mode Is Empty")

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

    EndSwitch

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

    $s8 = 'SetSetting match_pb_enabled '
    $c5 = GUICtrlRead($Combo5)
    Switch $c5
    Case "Yes"
    $write4 = 1
    Case "No"
    $write4 = 0
    Case Else
    MsgBox(16, 'Error',"Punk Buster Is Empty")

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

    EndSwitch

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

    $s10 = 'SetSetting allow_voting '
    $c7 = GUICtrlRead($Combo7)
    Switch $c7
    Case "Yes"
    $write5 = 1
    Case "No"
    $write5 = 0
    Case Else
    MsgBox(16, 'Error',"Allow Voting Is Empty")

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

    EndSwitch

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

    $s14 = 'SetSetting teambalance '
    $c10 = GUICtrlRead($Combo10)
    Switch $c10
    Case "Yes"
    $write6 = 1
    Case "No"
    $write6 = 0
    Case Else
    MsgBox(16, 'Error',"Teambalance Is Empty")

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

    EndSwitch

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

    $s15 = 'SetSetting teamswap '
    $c11 = GUICtrlRead($Combo11)
    Switch $c11
    Case "Yes"
    $write7 = 1
    Case "No"
    $write7 = 0
    Case Else
    MsgBox(16, 'Error',"Teambswap Is Empty")

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

    EndSwitch

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

    $s16 = 'SetSetting friendly_fire '
    $c12 = GUICtrlRead($Combo12)
    Switch $c12
    Case "Yes"
    $write8 = 1
    Case "No"
    $write8 = 0
    Case Else
    MsgBox(16, 'Error',"Friendly Fire Is Empty")

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

    EndSwitch

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

    $s17 = 'SetSetting joinprogress '
    $c13 = GUICtrlRead($Combo13)
    Switch $c13
    Case "Yes"
    $write9 = 1
    Case "No"
    $write9 = 0
    Case Else
    MsgBox(16, 'Error',"Join In Progress Is Empty")

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

    EndSwitch

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

    $s18 = 'SetSetting inroundtime '
    $c14 = GUICtrlRead($Combo14)
    Switch $c14
    Case "Infinite"
    $write10 = 0
    Case "5min"
    $write10 = 300
    Case "10min"
    $write10 = 600
    Case "15min"
    $write10 = 900
    Case "20min"
    $write10 = 1200
    Case "25min"
    $write10 = 1500
    Case "30min"
    $write10 = 1800
    Case "60min"
    $write10 = 3600
    Case Else
    MsgBox(16, 'Error',"Round Time Is Empty")

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

    EndSwitch

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

    $s20 = 'SetSetting detectPublicAddress '
    $c16 = GUICtrlRead($Combo16)
    Switch $c16
    Case "Detect public IP"
    $write11 = 1
    Case "Use local IP"
    $write11 = 0
    Case Else
    MsgBox(16, 'Error',"Detect Address Is Empty")

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

    EndSwitch

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

    $s22 = 'SetSetting time_of_day '
    $c17 = GUICtrlRead($Combo17)
    Switch $c17
    Case "Map Default"
    $write12 = 0
    Case "Random"
    $write12 = -1
    Case "Dawn"
    $write12 = 6
    Case "Midday"
    $write12 = 11
    Case "Dusk"
    $write12 = 21
    Case "Night"
    $write12 = 23
    Case Else
    MsgBox(16, 'Error',"Time Of Day Is Empty")

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

    EndSwitch

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

    $s23 = 'SetSetting weather_type '
    $c18 = GUICtrlRead($Combo18)
    Switch $c18
    Case "Clear"
    $write13 = 0
    Case "Windy"
    $write13 = 225
    Case "Varied"
    $write13 = 50
    Case "Overcast"
    $write13 = 75
    Case "Stormy"
    $write13 = 100
    Case "Random"
    $write13 = -1
    Case Else
    MsgBox(16, 'Error',"Weather Type Is Empty")

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

    EndSwitch

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

    GUICtrlSetData($Edit1, $s1 & $i1 & @CRLF & $s2 & $c1 & @CRLF & $s3 & $s4 & @CRLF & $s5 & $write1& @CRLF & $s6 & $write2 & @CRLF & _
    $s7 & $write3 & @CRLF & $s8 & $write4 & @CRLF & $s9 & $c6 & @CRLF & $s10 & $write5 & @CRLF & $s11 & $i2 & @CRLF & $s12& $c8 & @CRLF & _
    $s13 & $c9 & @CRLF & $s14 & $write6 & @CRLF & $s15 & $write7 & @CRLF & $s16 & $write8 & @CRLF & $s17 & $write9 & @CRLF & _
    $s18 & $write10 & @CRLF & $s19 & $c15 & @CRLF & $s20 & $write11 & @CRLF & $s21 & $i3 & @CRLF & $s22 & $write12 & @CRLF & _
    $s23 & $write13)

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

    EndSwitch
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von VinceA (24. Februar 2013 um 18:52)