Chobby Posted April 23, 2006 Share Posted April 23, 2006 Okay, lets say i got a combo in a GUI.. I now need to make a variable for each possible selection.. I cant get a hold of this :S Here is an example.. (That might not work at all ) #include <GUIConstants.au3> GUICreate("My GUI") $ComboSelection = GUICtrlCreateCombo("Choose item", x, x, x, x) GUICtrlSetData(-1, "Item1|Item2|Item3|Item4") Now, i want to set the script to use for instance $GUI1 if Item1 is selected, and $GUI2 if Item2 is selected etc etc.. How do i get them "defined"? Thanks in advance Link to comment Share on other sites More sharing options...
Chobby Posted April 23, 2006 Author Share Posted April 23, 2006 I think i found a way .. I just cant get it working Can someone debug it, for me? :"> expandcollapse popup#NoTrayIcon ; Script Start #include <GUIConstants.au3> #include <Misc.au3> Opt("SendKeyDelay", 1) GUICreate("Ca Server Commands - By Chobby", 440, 320, 100, 100) $filemenu = GUICtrlCreateMenu("Files") $fileupdates = GUICtrlCreateMenuitem("Updates", $filemenu) $seperator2 = GUICtrlCreateMenuitem("", $filemenu) $fileexit = GUICtrlCreateMenuitem("Exit", $filemenu) $linkmenu = GUICtrlCreateMenu("Links") $link1 = GUICtrlCreateMenuitem("Clan Apathy Forum", $linkmenu) $seperator1 = GUICtrlCreateMenuitem("", $linkmenu) $link2 = GUICtrlCreateMenuitem("AutoIt HP", $linkmenu) $link3 = GUICtrlCreateMenuitem("AutoIt Forum", $linkmenu) $helpmenu = GUICtrlCreateMenu("Help") $helpfile = GUICtrlCreateMenuitem("Help...", $helpmenu) $helpabout = GUICtrlCreateMenuitem("About", $helpmenu) $helpversion = GUICtrlCreateMenuitem("Version", $helpmenu) ;GUICtrlCreateLabel("For more information and/or more programs see www.ipshare.5gigs.com! (Soon up) ", 10, 10, 400);Add the main label GUICtrlCreateTab(0, 0, 442, 310) GUICtrlCreateTabItem("Change map") GUICtrlCreateGroup("", 10, 20, 420, 112) GUICtrlCreateGroup("Choose Map:", 20, 32, 140, 40) $GUIMAP = GUICtrlCreateCombo("Choose default map", 30, 45, 120, 20) GUICtrlSetData(-1, " FFA_Bespin | FFA_Deathstar | FFA_Imperial | FFA_NS_Hideout | FFA_NS_Streets | FFA_Raven | FFA_Yavin | CTF_Bespin | CTF_Imperial | CTF_NS_Streets | CTF_Yavin | Duel_Bay | Duel_Jedi | Duel_Pit | Duel_Carbon | |Or custom map| Jedi Council | Country Academy | Country Roads | FFA_Koa | Naboo City | Cloud City Morning | Cloud City Noon", "Select") GUICtrlSetOnEvent(-1, "COMBOMAPSelected") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Choose Gametype:", 170, 32, 120, 40) $GUIGTYPE = GUICtrlCreateCombo("Choose gametype", 180, 45, 100, 20) GUICtrlSetData(-1, " FFA| Holocron| Jedimaster| Duel| TFFA| CTF", "Select") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Password*", 300, 32, 120, 40) $GUIPASS = GUICtrlCreateInput("", 310, 45, 100, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Tele in bespin", 10, 135, 420, 120) GUICtrlCreateLabel("Tele who?", 30, 155, 50, 20) $TELEwho = GUICtrlCreateInput("SELF", 90, 152, 40, 20) GUICtrlCreateLabel("To where?", 30, 180, 70, 20) $TELEwhere = GUICtrlCreateCombo("Choose place", 90, 177, 100, 20) GUICtrlSetData(-1, "Roof|Pad|Above Pad|Admin Shelter|Streets|Building|Sniper Tower") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateLabel("*) You don't HAVE to set a password. If not, leave box blank! If you put a password on your server," _ & "then be sure to remember it, as it's NOT recoverable with this program!", 20, 75, 400, 40) $BTNPreview = GUICtrlCreateButton("&Preview", 180, 105, 100, 20) GUICtrlSetTip(-1, "Show the options") $BTNSend = GUICtrlCreateButton("&Send", 30, 105, 120, 20) GUICtrlSetTip(-1, "Switch Map") GUICtrlSetState(-1, $GUI_DEFBUTTON) $BTNExit = GUICtrlCreateButton("&Exit", 310, 105, 100, 20) GUICtrlSetTip(-1, "Exit the program") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateLabel("You should have JK2 running, and then open the console. After that you switch to this window with <ALT> + <TAB>. Select your options, and hit Send!", 10, 260, 420, 30) GUICtrlCreateTabItem("Rcon And Admin") GUICtrlCreateLabel("You should have JK2 running, and then open the console. After that you switch to this window with <ALT> + <TAB>. Select your options, and hit Send!", 10, 260, 420, 30) GUICtrlCreateGroup("Rcon", 10, 25, 420, 45) $RCONspeed = GUICtrlCreateButton("Speed", 15, 40, 45, 20) $RCONfriendlyf = GUICtrlCreateButton("Friendly Fire", 130, 40, 70, 20) $RCONgrav = GUICtrlCreateButton("Gravity", 70, 40, 50, 20) $RCONfragl = GUICtrlCreateButton("Fraglimit", 210, 40, 60, 20) $RCONtimel = GUICtrlCreateButton("Timelimit", 280, 40, 60, 20) $RCONfriendlys = GUICtrlCreateButton("Friendly Saber", 350, 40, 75, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) ; - - - Define actions beneath - - - While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $BTNExit Or $msg = $fileexit Exit Case $msg = $fileupdates MsgBox(64, "Updates..", "Updates since Version 1 are:" & @CRLF & @CRLF & " - Added new system to maps and gametype" & _ @CRLF & " - Added custom maps (still as beta test)" & @CRLF & " - Added password ability for changing map" & _ @CRLF & " - Will add more commands and some tabs to switch between") Case $msg = $link1 $IE1 = _IECreate () _IENavigate ($IE1, "Http://clanapathy.13.forumer.com", 0) $IE1 = 0 Case $msg = $link2 $IE2 = _IECreate () _IENavigate ($IE2, "Http://www.autoitscript.com", 0) $IE2 = 0 Case $msg = $link3 $IE3 = _IECreate () _IENavigate ($IE3, "http://www.autoitscript.com/forum/index.php", 0) $IE3 = 0 Case $msg = $helpfile MsgBox(16, "Helpfile", "NOTE:" & @LF & "The helpfile is not avaliable yet.. If not in the next version, then it will be added in one of the following ones.. Please be patient :)" & @LF & @LF & "Thanks, Chobby..") Case $msg = $helpabout MsgBox(64, "About...", "I wrote this little program in AutoIt, 100% (Look in links).. The purpose of it is to help mainly new admins remember the admincommands like changing map (which is the first feature of this program, as well).. When more features are being added, it might be more useful for older admins as well :)" & _ @LF & @LF & "I would like, mainly to give credit to AutoIt and the creators behind that scripting-language.. Secondly, the persons who has been helping me with various stuff about the scripting and testing, should have my credit.. Besides those persons, I would like to thank the people that has been testing this program, and the people that are using it.. Also, I would like to thank (and give some focus) to the whole Clan Apathy clan :)" & _ @CRLF & @CRLF & "Created by <Ca>CHOBBY," & @CRLF & "MSN: Chobby_san@hotmail.com") Case $msg = $helpversion MsgBox(0, "Version", "The current version is:" & @LF & " Version 1.1a") Case $msg = $BTNSend If GUICtrlRead($GUIGTYPE) <> "Choose gametype" And _ GUICtrlRead($GUIMAP) <> "Choose default map" Then If WinExists("Jedi Knight 2: Jedi Outcast MP") Then Opt("SendKeyDelay", 0) WinActivate("Jedi Knight 2: Jedi Outcast MP") WinWaitActive("Jedi Knight 2: Jedi Outcast MP", "", 10) Send("/gametype" & GUICtrlRead($GUIGTYPE) & GUICtrlRead($GUIMAP) & GUICtrlRead($GUIPASS)) ;Send("{ENTER}") Else MsgBox(48, "Error", "You don't have JK2 open!"); you could start your game here EndIf Else ContinueLoop EndIf Case $msg = $BTNPreview ; NOTE!! Its from here to If GUICtrlRead($GUIGTYPE) <> "Choose gametype" And _ GUICtrlRead($GUIMAP) <> "Choose default map" Then MsgBox(4096, "Map change preview", "Will change the map to " & _ GUICtrlRead($GUIGTYPE) & "in " & $MAPSelected & @LF & " with --> " & GUICtrlRead($GUIPASS) & " <-- as password.") ; here i am trying my combo selections! Else MsgBox(48, "Error", "You must select the options first.") EndIf EndSelect WEnd ;=============================================================================== ; ; Function Name: _IECreate() ; Description: Create an Internet Explorer Browser Window ; Parameter(s): $f_visible - 1 sets visible (default), 0 sets invisible ; Requirement(s): AutoIt3 Beta with COM support (post 3.1.1) ; Return Value(s): On Success - Returns an object variable pointing to a new InternetExplorer.Application object ; On Failure - 0 and sets @ERROR = 1 ; Author(s): Dale Hohm ; ;=============================================================================== ; Func _IECreate($f_visible = 1) $o_object = ObjCreate("InternetExplorer.Application") If IsObj($o_object) Then $o_object.visible = $f_visible SetError(0) Return $o_object Else SetError(1) Return 0 EndIf EndFunc ;==>_IECreate ;=============================================================================== ; ; Function Name: _IENavigate() ; Description: Directs an existing browser window to navigate to the specified URL ; Parameter(s): $o_object - InternetExplorer.Application, Window or Frame object ; $s_Url - url to navigate to (e.g. "http://www.autoitscript.com") ; $f_wait - 1 = wait for page load to complete before returning ; - 0 = return immediately ; Requirement(s): AutoIt3 Beta with COM support (post 3.1.1) ; Return Value(s): On Success - Returns -1 (the Navigate method actually has no return value - all we know is that we tried) ; On Failure - 0 and sets @ERROR = 1 ; Author(s): Dale Hohm ; ;=============================================================================== ; Func _IENavigate($o_object, $s_url, $f_wait = 1) If IsObj($o_object) Then $o_object.navigate ($s_url) If ($f_wait = 1) Then _IELoadWait($o_object) SetError(0) Return -1 Else SetError(1) Return 0 EndIf EndFunc ;==>_IENavigate ;=============================================================================== ; ; Function Name: _IELoadWait() ; Description: Wait for a browser page load to complete before returning ; Parameter(s): $o_object - InternetExplorer.Application object ; $i_delay - wait this many milliseconds before checking status ; Requirement(s): AutoIt3 Beta with COM support (post 3.1.1) ; Return Value(s): On Success - Returns an object variable pointing to ; On Failure - 0 and sets @ERROR = 1 ; Author(s): Dale Hohm ; ;=============================================================================== ; Func _IELoadWait($o_object, $i_delay = 0) If IsObj($o_object) Then $s_oname = ObjName($o_object) Sleep($i_delay) While ($o_object.document.readyState <> "complete") and ($o_object.document.readyState <> 4) Sleep(100) WEnd SetError(0) Return 1 Else SetError(1) Return 0 EndIf EndFunc ;==>_IELoadWait Func COMBOMAPSelected() $MapComboText = GUICtrlRead($GUIMAP) IF $MapComboText = " FFA_Bespin" Then $MAPSelected = "ffa_bespin" EndIf If $MapComboText = " FFA_Deathstar" Then $MAPSelected = "ffa_deathstar" EndIf If $MapComboText = " FFA_Imperial" Then $MAPSelected = "ffa_imperial" EndIf If $MapComboText = " FFA_NS_Hideout" Then $MAPSelected = "ffa_ns_hideout" EndIf If $MapComboText = " FFA_NS_Streets" Then $MAPSelected = "ffa_ns_streets" EndIf If $MapComboText = " FFA_Raven" Then $MAPSelected = "ffa_raven" EndIf If $MapComboText = " FFA_Yavin" Then $MAPSelected = "ffa_yavin" EndIf If $MapComboText = " CTF_Bespin" Then $MAPSelected = "ctf_bespin" EndIf If $MapComboText = " CTF_Imperial" Then $MAPSelected = "ctf_imperial" EndIf If $MapComboText = " CTF_NS_Streets" Then $MAPSelected = "ctf_ns_streets" EndIf If $MapComboText = " CTF_Yavin" Then $MAPSelected = "ctf_yavin" EndIf If $MapComboText = " Duel_Bay" Then $MAPSelected = "duel_bay" EndIf If $MapComboText = " Duel_Jedi" Then $MAPSelected = "duel_jedi" EndIf If $MapComboText = " Duel_Pit" Then $MAPSelected = "duel_pit" EndIf If $MapComboText = " Duel_Carbon" Then $MAPSelected = "duel_carbon" EndIf If $MapComboText = "Or custom map" Then MsgBox(6, "Error", "Error.. Invalid map!" EndIf If $MapComboText = " Jedi Council " Then $MAPSelected = "jedicouncilgc" EndIf If $MapComboText = " Country Academy " Then $MAPSelected = "countryacademy" EndIf If $MapComboText = " Country Roads " Then $MAPSelected = "country" EndIf If $MapComboText = " FFA_Koa " Then $MAPSelected = "ffa_koa" EndIf If $MapComboText = " Naboo City " Then $MAPSelected = "ffa_naboocity1" EndIf If $MapComboText = " Cloud City Morning " Then $MAPSelected = "cloudmorning" EndIf If $MapComboText = " Cloud City Noon " Then $MAPSelected = "cloudnoon" EndIf If $MapComboText = " New FFA_Bespin " Then $MAPSelected = "FFA_new_bespin" EndIf EndFunc Okay, there are some commments: I have several different things under construction .. Dont mind other stuff than this (really); Case $msg = $BTNPreview ; NOTE!! Its from here to If GUICtrlRead($GUIGTYPE) <> "Choose gametype" And _ GUICtrlRead($GUIMAP) <> "Choose default map" Then MsgBox(4096, "Map change preview", "Will change the map to " & _ GUICtrlRead($GUIGTYPE) & "in " & $MAPSelected & @LF & " with --> " & GUICtrlRead($GUIPASS) & " <-- as password.") ; here i am trying my combo selections! I dont know how to get it to show the $MAPSelected.. Link to comment Share on other sites More sharing options...
Chobby Posted April 23, 2006 Author Share Posted April 23, 2006 I think i found a way .. I just cant get it working Can someone debug it, for me? :"> expandcollapse popup#NoTrayIcon ; Script Start #include <GUIConstants.au3> #include <Misc.au3> Opt("SendKeyDelay", 1) GUICreate("Ca Server Commands - By Chobby", 440, 320, 100, 100) $filemenu = GUICtrlCreateMenu("Files") $fileupdates = GUICtrlCreateMenuitem("Updates", $filemenu) $seperator2 = GUICtrlCreateMenuitem("", $filemenu) $fileexit = GUICtrlCreateMenuitem("Exit", $filemenu) $linkmenu = GUICtrlCreateMenu("Links") $link1 = GUICtrlCreateMenuitem("Clan Apathy Forum", $linkmenu) $seperator1 = GUICtrlCreateMenuitem("", $linkmenu) $link2 = GUICtrlCreateMenuitem("AutoIt HP", $linkmenu) $link3 = GUICtrlCreateMenuitem("AutoIt Forum", $linkmenu) $helpmenu = GUICtrlCreateMenu("Help") $helpfile = GUICtrlCreateMenuitem("Help...", $helpmenu) $helpabout = GUICtrlCreateMenuitem("About", $helpmenu) $helpversion = GUICtrlCreateMenuitem("Version", $helpmenu) ;GUICtrlCreateLabel("For more information and/or more programs see www.ipshare.5gigs.com! (Soon up) ", 10, 10, 400);Add the main label GUICtrlCreateTab(0, 0, 442, 310) GUICtrlCreateTabItem("Change map") GUICtrlCreateGroup("", 10, 20, 420, 112) GUICtrlCreateGroup("Choose Map:", 20, 32, 140, 40) $GUIMAP = GUICtrlCreateCombo("Choose default map", 30, 45, 120, 20) GUICtrlSetData(-1, " FFA_Bespin | FFA_Deathstar | FFA_Imperial | FFA_NS_Hideout | FFA_NS_Streets | FFA_Raven | FFA_Yavin | CTF_Bespin | CTF_Imperial | CTF_NS_Streets | CTF_Yavin | Duel_Bay | Duel_Jedi | Duel_Pit | Duel_Carbon | |Or custom map| Jedi Council | Country Academy | Country Roads | FFA_Koa | Naboo City | Cloud City Morning | Cloud City Noon", "Select") GUICtrlSetOnEvent(-1, "COMBOMAPSelected") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Choose Gametype:", 170, 32, 120, 40) $GUIGTYPE = GUICtrlCreateCombo("Choose gametype", 180, 45, 100, 20) GUICtrlSetData(-1, " FFA| Holocron| Jedimaster| Duel| TFFA| CTF", "Select") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Password*", 300, 32, 120, 40) $GUIPASS = GUICtrlCreateInput("", 310, 45, 100, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Tele in bespin", 10, 135, 420, 120) GUICtrlCreateLabel("Tele who?", 30, 155, 50, 20) $TELEwho = GUICtrlCreateInput("SELF", 90, 152, 40, 20) GUICtrlCreateLabel("To where?", 30, 180, 70, 20) $TELEwhere = GUICtrlCreateCombo("Choose place", 90, 177, 100, 20) GUICtrlSetData(-1, "Roof|Pad|Above Pad|Admin Shelter|Streets|Building|Sniper Tower") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateLabel("*) You don't HAVE to set a password. If not, leave box blank! If you put a password on your server," _ & "then be sure to remember it, as it's NOT recoverable with this program!", 20, 75, 400, 40) $BTNPreview = GUICtrlCreateButton("&Preview", 180, 105, 100, 20) GUICtrlSetTip(-1, "Show the options") $BTNSend = GUICtrlCreateButton("&Send", 30, 105, 120, 20) GUICtrlSetTip(-1, "Switch Map") GUICtrlSetState(-1, $GUI_DEFBUTTON) $BTNExit = GUICtrlCreateButton("&Exit", 310, 105, 100, 20) GUICtrlSetTip(-1, "Exit the program") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateLabel("You should have JK2 running, and then open the console. After that you switch to this window with <ALT> + <TAB>. Select your options, and hit Send!", 10, 260, 420, 30) GUICtrlCreateTabItem("Rcon And Admin") GUICtrlCreateLabel("You should have JK2 running, and then open the console. After that you switch to this window with <ALT> + <TAB>. Select your options, and hit Send!", 10, 260, 420, 30) GUICtrlCreateGroup("Rcon", 10, 25, 420, 45) $RCONspeed = GUICtrlCreateButton("Speed", 15, 40, 45, 20) $RCONfriendlyf = GUICtrlCreateButton("Friendly Fire", 130, 40, 70, 20) $RCONgrav = GUICtrlCreateButton("Gravity", 70, 40, 50, 20) $RCONfragl = GUICtrlCreateButton("Fraglimit", 210, 40, 60, 20) $RCONtimel = GUICtrlCreateButton("Timelimit", 280, 40, 60, 20) $RCONfriendlys = GUICtrlCreateButton("Friendly Saber", 350, 40, 75, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) ; - - - Define actions beneath - - - While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $BTNExit Or $msg = $fileexit Exit Case $msg = $fileupdates MsgBox(64, "Updates..", "Updates since Version 1 are:" & @CRLF & @CRLF & " - Added new system to maps and gametype" & _ @CRLF & " - Added custom maps (still as beta test)" & @CRLF & " - Added password ability for changing map" & _ @CRLF & " - Will add more commands and some tabs to switch between") Case $msg = $link1 $IE1 = _IECreate () _IENavigate ($IE1, "Http://clanapathy.13.forumer.com", 0) $IE1 = 0 Case $msg = $link2 $IE2 = _IECreate () _IENavigate ($IE2, "Http://www.autoitscript.com", 0) $IE2 = 0 Case $msg = $link3 $IE3 = _IECreate () _IENavigate ($IE3, "http://www.autoitscript.com/forum/index.php", 0) $IE3 = 0 Case $msg = $helpfile MsgBox(16, "Helpfile", "NOTE:" & @LF & "The helpfile is not avaliable yet.. If not in the next version, then it will be added in one of the following ones.. Please be patient :)" & @LF & @LF & "Thanks, Chobby..") Case $msg = $helpabout MsgBox(64, "About...", "I wrote this little program in AutoIt, 100% (Look in links).. The purpose of it is to help mainly new admins remember the admincommands like changing map (which is the first feature of this program, as well).. When more features are being added, it might be more useful for older admins as well :)" & _ @LF & @LF & "I would like, mainly to give credit to AutoIt and the creators behind that scripting-language.. Secondly, the persons who has been helping me with various stuff about the scripting and testing, should have my credit.. Besides those persons, I would like to thank the people that has been testing this program, and the people that are using it.. Also, I would like to thank (and give some focus) to the whole Clan Apathy clan :)" & _ @CRLF & @CRLF & "Created by <Ca>CHOBBY," & @CRLF & "MSN: Chobby_san@hotmail.com") Case $msg = $helpversion MsgBox(0, "Version", "The current version is:" & @LF & " Version 1.1a") Case $msg = $BTNSend If GUICtrlRead($GUIGTYPE) <> "Choose gametype" And _ GUICtrlRead($GUIMAP) <> "Choose default map" Then If WinExists("Jedi Knight 2: Jedi Outcast MP") Then Opt("SendKeyDelay", 0) WinActivate("Jedi Knight 2: Jedi Outcast MP") WinWaitActive("Jedi Knight 2: Jedi Outcast MP", "", 10) Send("/gametype" & GUICtrlRead($GUIGTYPE) & GUICtrlRead($GUIMAP) & GUICtrlRead($GUIPASS)) ;Send("{ENTER}") Else MsgBox(48, "Error", "You don't have JK2 open!"); you could start your game here EndIf Else ContinueLoop EndIf Case $msg = $BTNPreview ; NOTE!! Its from here to If GUICtrlRead($GUIGTYPE) <> "Choose gametype" And _ GUICtrlRead($GUIMAP) <> "Choose default map" Then MsgBox(4096, "Map change preview", "Will change the map to " & _ GUICtrlRead($GUIGTYPE) & "in " & $MAPSelected & @LF & " with --> " & GUICtrlRead($GUIPASS) & " <-- as password.") ; here i am trying my combo selections! Else MsgBox(48, "Error", "You must select the options first.") EndIf EndSelect WEnd ;=============================================================================== ; ; Function Name: _IECreate() ; Description: Create an Internet Explorer Browser Window ; Parameter(s): $f_visible - 1 sets visible (default), 0 sets invisible ; Requirement(s): AutoIt3 Beta with COM support (post 3.1.1) ; Return Value(s): On Success - Returns an object variable pointing to a new InternetExplorer.Application object ; On Failure - 0 and sets @ERROR = 1 ; Author(s): Dale Hohm ; ;=============================================================================== ; Func _IECreate($f_visible = 1) $o_object = ObjCreate("InternetExplorer.Application") If IsObj($o_object) Then $o_object.visible = $f_visible SetError(0) Return $o_object Else SetError(1) Return 0 EndIf EndFunc ;==>_IECreate ;=============================================================================== ; ; Function Name: _IENavigate() ; Description: Directs an existing browser window to navigate to the specified URL ; Parameter(s): $o_object - InternetExplorer.Application, Window or Frame object ; $s_Url - url to navigate to (e.g. "http://www.autoitscript.com") ; $f_wait - 1 = wait for page load to complete before returning ; - 0 = return immediately ; Requirement(s): AutoIt3 Beta with COM support (post 3.1.1) ; Return Value(s): On Success - Returns -1 (the Navigate method actually has no return value - all we know is that we tried) ; On Failure - 0 and sets @ERROR = 1 ; Author(s): Dale Hohm ; ;=============================================================================== ; Func _IENavigate($o_object, $s_url, $f_wait = 1) If IsObj($o_object) Then $o_object.navigate ($s_url) If ($f_wait = 1) Then _IELoadWait($o_object) SetError(0) Return -1 Else SetError(1) Return 0 EndIf EndFunc ;==>_IENavigate ;=============================================================================== ; ; Function Name: _IELoadWait() ; Description: Wait for a browser page load to complete before returning ; Parameter(s): $o_object - InternetExplorer.Application object ; $i_delay - wait this many milliseconds before checking status ; Requirement(s): AutoIt3 Beta with COM support (post 3.1.1) ; Return Value(s): On Success - Returns an object variable pointing to ; On Failure - 0 and sets @ERROR = 1 ; Author(s): Dale Hohm ; ;=============================================================================== ; Func _IELoadWait($o_object, $i_delay = 0) If IsObj($o_object) Then $s_oname = ObjName($o_object) Sleep($i_delay) While ($o_object.document.readyState <> "complete") and ($o_object.document.readyState <> 4) Sleep(100) WEnd SetError(0) Return 1 Else SetError(1) Return 0 EndIf EndFunc ;==>_IELoadWait Func COMBOMAPSelected() $MapComboText = GUICtrlRead($GUIMAP) IF $MapComboText = " FFA_Bespin" Then $MAPSelected = "ffa_bespin" EndIf If $MapComboText = " FFA_Deathstar" Then $MAPSelected = "ffa_deathstar" EndIf If $MapComboText = " FFA_Imperial" Then $MAPSelected = "ffa_imperial" EndIf If $MapComboText = " FFA_NS_Hideout" Then $MAPSelected = "ffa_ns_hideout" EndIf If $MapComboText = " FFA_NS_Streets" Then $MAPSelected = "ffa_ns_streets" EndIf If $MapComboText = " FFA_Raven" Then $MAPSelected = "ffa_raven" EndIf If $MapComboText = " FFA_Yavin" Then $MAPSelected = "ffa_yavin" EndIf If $MapComboText = " CTF_Bespin" Then $MAPSelected = "ctf_bespin" EndIf If $MapComboText = " CTF_Imperial" Then $MAPSelected = "ctf_imperial" EndIf If $MapComboText = " CTF_NS_Streets" Then $MAPSelected = "ctf_ns_streets" EndIf If $MapComboText = " CTF_Yavin" Then $MAPSelected = "ctf_yavin" EndIf If $MapComboText = " Duel_Bay" Then $MAPSelected = "duel_bay" EndIf If $MapComboText = " Duel_Jedi" Then $MAPSelected = "duel_jedi" EndIf If $MapComboText = " Duel_Pit" Then $MAPSelected = "duel_pit" EndIf If $MapComboText = " Duel_Carbon" Then $MAPSelected = "duel_carbon" EndIf If $MapComboText = "Or custom map" Then MsgBox(6, "Error", "Error.. Invalid map!" EndIf If $MapComboText = " Jedi Council " Then $MAPSelected = "jedicouncilgc" EndIf If $MapComboText = " Country Academy " Then $MAPSelected = "countryacademy" EndIf If $MapComboText = " Country Roads " Then $MAPSelected = "country" EndIf If $MapComboText = " FFA_Koa " Then $MAPSelected = "ffa_koa" EndIf If $MapComboText = " Naboo City " Then $MAPSelected = "ffa_naboocity1" EndIf If $MapComboText = " Cloud City Morning " Then $MAPSelected = "cloudmorning" EndIf If $MapComboText = " Cloud City Noon " Then $MAPSelected = "cloudnoon" EndIf If $MapComboText = " New FFA_Bespin " Then $MAPSelected = "FFA_new_bespin" EndIf EndFunc Okay, there are some commments: I have several different things under construction .. Dont mind other stuff than this (really); Case $msg = $BTNPreview ; NOTE!! Its from here to If GUICtrlRead($GUIGTYPE) <> "Choose gametype" And _ GUICtrlRead($GUIMAP) <> "Choose default map" Then MsgBox(4096, "Map change preview", "Will change the map to " & _ GUICtrlRead($GUIGTYPE) & "in " & $MAPSelected & @LF & " with --> " & GUICtrlRead($GUIPASS) & " <-- as password.") ; here i am trying my combo selections! I dont know how to get it to show the $MAPSelected.. No one can help me?? Please? Link to comment Share on other sites More sharing options...
GaryFrost Posted April 23, 2006 Share Posted April 23, 2006 requires beta #include <GuiConstants.au3> #include <GuiCombo.au3> Opt('MustDeclareVars',1) Dim $Combo,$ret,$Btn_Exit,$msg, $s_text GuiCreate("ComboBox Get Current Selection", 392, 254) $Combo = GuiCtrlCreateCombo("Make A Choice", 70, 10, 270, 120) GUICtrlSetData($Combo,"Item1|Item2|Item3") $Btn_Exit = GuiCtrlCreateButton("Exit", 150, 180, 90, 30) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit ExitLoop Case $msg = $Combo _GUICtrlComboGetLBText ($Combo,_GUICtrlComboGetCurSel($Combo), $s_text) Select Case $s_text = "Item1" MsgBox(0,"test","Item1 was selected") Case $s_text = "Item2" MsgBox(0,"test","Item2 was selected") Case $s_text = "Item3" MsgBox(0,"test","Item3 was selected") EndSelect EndSelect WEnd Exit SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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