Jump to content

Combobox as variable


Recommended Posts

CODE
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("CS-Server Starter", 730, 142, 186, 115)

$Button1 = GUICtrlCreateButton("Start", 28, 72, 321, 50, 0)

GUICtrlSetFont(-1, 36, 400, 0, "Courier New")

$Button2 = GUICtrlCreateButton("Exit", 380, 72, 321, 50, 0)

GUICtrlSetFont(-1, 36, 400, 0, "Courier New")

GUICtrlSetCursor (-1, 2)

$Label1 = GUICtrlCreateLabel("Slots", 40, 48, 27, 17)

$Label2 = GUICtrlCreateLabel("Map", 216, 48, 25, 17)

$Label3 = GUICtrlCreateLabel("Pingboost", 392, 48, 51, 17)

$Label4 = GUICtrlCreateLabel("Ticrate", 568, 48, 37, 17)

$Combo1 = GUICtrlCreateCombo("2", 40, 16, 121, 25)

GUICtrlSetData(-1, "4|6|8|10|12|14|16|18|20|22|24|26|28|30|32", "16")

$Combo2 = GUICtrlCreateCombo("fy_ice", 216, 16, 121, 25)

GUICtrlSetData(-1, "de_dust2|de_dust", "de_dust2")

$Combo3 = GUICtrlCreateCombo("1", 392, 16, 121, 25)

GUICtrlSetData(-1, "2|3", "3")

$Combo4 = GUICtrlCreateCombo("1000", 568, 16, 121, 25)

GUICtrlSetData(-1, "2000|3000", "1000")

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

funcStart ()

Case $Button2

funcExit ()

EndSwitch

WEnd

Func funcStart ()

ShellExecute("hlds.exe", "-game cstrike -secure -autoupdate +maxplayers $Combo1 + map $Combo2 -pingboost $Combo3 -sys_ticrate $Combo4")

EndFunc

Func funcExit ()

Exit

EndFunc

this is my little script to run a .exe file with parameters but it dos not work now

i want to use the comboboxes as "variables" pleas help me i do not know how to do it

Link to comment
Share on other sites

ShellExecute("hlds.exe", "-game cstrike -secure -autoupdate +maxplayers " & GUICtrlRead($Combo1) & " + map " & GUICtrlRead($Combo2) & " -pingboost " & GUICtrlRead($Combo3) & " -sys_ticrate " & GUICtrlRead($Combo4))

Edited by KaFu
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...