WhoElse Posted February 3, 2013 Share Posted February 3, 2013 Greetings fellow newbies and pros! So I've been looking for answers the whole evening, but couldn't find any that fit my problem. Basically it is pretty basic, but somehow I can't get it to work. Anyway, here it goes: My parameters $Location, $Infection and $Difficulty are specified in ComboBoxes in the first Function. When the button is pressed I want to pass them to the next Function. They are however not passed as far as i can tell. Heres my code, and I appreciate every helpful comment Go nuts! expandcollapse popupChoose() Func Choose() $gui = GUICreate("StartUp", 120, 220, 750, 300) $label_combo_infection = GUICtrlCreateLabel("Choose Infection:", 11, 25, 100, 20) $combo_choose_infection = GUICtrlCreateCombo("Bacteria", 10, 45, 100, 0,$CBS_DROPDOWNlist + $CBS_AUTOHSCROLL) $combo_populate_choose_infection = GUICtrlSetData($combo_choose_infection, "Virus|Fungus|Nano Bots|Bio Weapon|Parasite|Alien Worm") $label_combo_difficulty = GUICtrlCreateLabel("Choose Difficulty:", 11, 75, 100, 20) $combo_choose_difficulty = GUICtrlCreateCombo("Casual", 10, 95, 100, 0, $CBS_DROPDOWNlist + $CBS_AUTOHSCROLL) $combo_populate_choose_difficulty = GUICtrlSetData($combo_choose_difficulty, "Normal|Hard|Apocalyptic|Mastermind") $label_combo_location = GUICtrlCreateLabel("Choose Location:", 11, 125, 100, 20) $combo_choose_location = GUICtrlCreateCombo("Afghanistan", 10, 145, 100, 0, $CBS_DROPDOWNlist + $CBS_AUTOHSCROLL) $combo_populate_choose_location = GUICtrlSetData($combo_choose_location, $locations) $button_start = GUICtrlCreateButton("Begin", 10, 175, 100, 30) GUISetState(@SW_SHOW, $gui) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $button_start $Infection = _GUICtrlComboBox_GetEditText($combo_choose_infection) $Difficulty = _GUICtrlComboBox_GetEditText($combo_choose_difficulty) $Location = _GUICtrlComboBox_GetEditText($combo_choose_location) Game($Infection, $Difficulty, $Location) GUIDelete($gui) EndSwitch WEnd EndFunc Func Game($Infection, $Difficulty, $Location) $gui_game = GUICreate("Pandemic", 1300, 900, 200, 50) $preferences_label = GUICtrlCreateLabel($Infection & " | " & $Location & " | " & $Difficulty, 10, 5, 400, 20) GUISetState(@SW_SHOW, $gui_game) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 3, 2013 Moderators Share Posted February 3, 2013 Comraw,Welcome to the AutoIt forum. You need to use GUICtrlRead to read the combos - just replace the current _GUICtrlComboBox_GetEditText function and the code works. But I note your use of the G word throughout the script - please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
WhoElse Posted February 3, 2013 Author Share Posted February 3, 2013 Wow, many thanks for the fast and working(!) help. I assume you meant the G*me part? I'm sorry if it looked like I wanted to modify or break a game with my "programm". Actually I'm just ripping off someones game idea (so a new game and not a modification of something existing) for my own personal autoit learning satisfaction ( ). However I wouldn't dream of publishing it and since I know myself, I can also safely assume that I won't finish it. Thank you again for your help, it worked. Be ready for some more questions that wouldn't stagger a 3 year-old Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 3, 2013 Moderators Share Posted February 3, 2013 Comraw, Happy to help with the questions - I might be able to answer them! But please do read those rules - we enforce them rigidly. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
WhoElse Posted February 3, 2013 Author Share Posted February 3, 2013 You mean this part, don't you? "Launching, automation or script interaction with games or game servers, regardless of the game." Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 3, 2013 Moderators Share Posted February 3, 2013 Comraw, I mean all of them - but that is the bit I particularly wanted you to note. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
WhoElse Posted February 3, 2013 Author Share Posted February 3, 2013 I will include them into my evening prayers for you I read them all and I will off course try and follow them to the best of my abilites. Keep it real, yo yo! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 3, 2013 Moderators Share Posted February 3, 2013 Comraw,I will include them into my evening prayers for youIf you wish. I will off course try and follow themDelighted to hear it - it will make my life much easier. to the best of my abilitesBe assured that I will keep an eye open to make sure that your abilities are up to the task. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now