Prodigy Posted September 5, 2007 Share Posted September 5, 2007 I recently created this little script to connect to a call of duty 2 server by typing the ip and password (handy when you search wars on mirc) anyways, I'm still quite new at auto it so if any of you guys has a suggestion to improve my script, i'd be glad to hear it. Code: expandcollapse popupdim $run dim $exit dim $status1 dim $status2 dim $input1 dim $input2 dim $status3 dim $box dim $browse dim $folder dim $dir dim $var dim $poly dim $multi dim $ping dim $menu #include <GUIConstants.au3> ;this is required for a GUI to work if fileexists(@documentscommondir & "\cod2dir.ini") then inireadsection(@documentscommondir & "\cod2dir.ini","directory") else $dir = fileselectfolder("Point to the Call of Duty 2 folder","","") iniwritesection("cod2dir.ini","Directory",$dir) filemove("cod2dir.ini",@documentscommondir) filemove("connect.exe",$dir) inireadsection(@documentscommondir & "\cod2dir.ini","directory") endif $box = GUICreate ("Call of Duty 2 server connecter",750,350) GUISetFont(14,600) GUICtrlCreateLabel("Call of Duty 2 server connecter by Sven""Prodigy""Heusequin",10,15) GUISetFont(12,400) $input1 = GUICtrlCreateInput("Ip-adress",85,100,150,30) $input2 = GUICtrlcreateinput("Password",85,135,150,30) $RUN = GUICtrlCreateButton("Connect",10,300,120,30) $EXIT = GUICtrlCreateButton("Exit",600,300,120,30) $poly = GUICtrlCreateCheckbox("Turn on Polygon Tweaks?",400,100) $Multi = GUICtrlCreateCheckbox("Turn on multi gpu for more fps?",400,120) GUISetState() If $run Then filedelete(@desktopdir & "\connect.exe") do $msg = guigetmsg() $status1 = guictrlread($input1) $status2 = guictrlread($input2) $status3 = GUICtrlRead($poly) $status4 = GUICTRLread($multi) until $msg = $run or $msg = $exit if $msg = $exit then Exit endif if $run then if fileexists ($dir & "\CoD2MP_s") then shellexecute("CoD2MP_s","",$dir,"","") else shellexecute("CoD2MP_s.exe","",$dir,"","") endif if fileexists ($dir & "\CoD2mp_s.exe") then shellexecute("CoD2MP_s.exe","",$dir,"","") Else shellexecute("CoD2MP_s","",$dir,"","") endif sleep(5500) send("²") send("{backspace}") IF $status3 = 1 then send("/r_polygonoffsetbias 16") send("{enter}") send("/r_polygonoffsetscale 4") send("{enter}") IF $status4 = 1 then send("/r_multigpu 1") send("{enter}") send("/password ") send($status2) send("{enter}") send("/connect ") send($status1) send("{enter}") endif And does any of you guys by any chance know if it is possible to put this into teamspeak so that I could connect through teamspeak?? Thanks in advance, Link to comment Share on other sites More sharing options...
Prodigy Posted September 6, 2007 Author Share Posted September 6, 2007 (edited) Ow and i have another question, when i add A background image with guictrlcreatepic, my buttons don't work anymore. Any help is welcome Edited September 6, 2007 by Prodigy Link to comment Share on other sites More sharing options...
weaponx Posted September 6, 2007 Share Posted September 6, 2007 I take it you don't like X-Fire? Link to comment Share on other sites More sharing options...
Prodigy Posted September 6, 2007 Author Share Posted September 6, 2007 Yeah i do like xfire but every time i start it up my internet connection disconnects. + I'ts way faster with my little script. So does any one know why i cant use my buttons? Link to comment Share on other sites More sharing options...
Gif Posted September 6, 2007 Share Posted September 6, 2007 i think you must first create the pic and then the buttons in order to work Link to comment Share on other sites More sharing options...
Prodigy Posted September 6, 2007 Author Share Posted September 6, 2007 I put guictrlcreatepic right after guicreate. So i dont think thats the problem Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 6, 2007 Share Posted September 6, 2007 I've had this problem as well but I can't quite remember how I resolved it (if I did). Try using Koda to move the picture to the back and bringing all the buttons to the front, that may work in conjunction with the creation order. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Prodigy Posted September 6, 2007 Author Share Posted September 6, 2007 What's a Koda? Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 6, 2007 Share Posted September 6, 2007 It's the built in Scite GUI editor, one of them at least. It's in tools or you can just press alt+M to open it. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
AzKay Posted September 6, 2007 Share Posted September 6, 2007 Add this in after the GUICtrlCreatePic(); GUICtrlSetState(-1, $GUI_DISABLE) # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Prodigy Posted September 6, 2007 Author Share Posted September 6, 2007 Thanks a lot AzKay. You too dbzfanatic (pretty cool this koda thingy) Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 6, 2007 Share Posted September 6, 2007 No problem, and Koda really comes in handy doesn't it? Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Prodigy Posted September 6, 2007 Author Share Posted September 6, 2007 Yeah it's Waaay faster. Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 6, 2007 Share Posted September 6, 2007 Quick warning though, watch out when you press "Insert into Scite" It will insert wherever your cursor is and overwrite any highlighted text so be wary of this, and it doesn't check to see if there's a GUI declaration already so you may end up with multiple While 1 statements and #include <GUIConstants.au3> statments. These won't cause a problem really but the extra while 1s may if you have it set so there's a notify event. So if you have While 1 $nmsg = GUIGetMsg() Switch $nmsg Case $button1 *Do something here* EndSwitch WEnd and also While 1 $nmsg = GUIGetMsg() Switch $nmsg Case $button1 EndSwitch WEnd it may contradict the first function and instead tell the program to do nothing. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Gif Posted September 6, 2007 Share Posted September 6, 2007 Prodigy play cod on EsM servers Link to comment Share on other sites More sharing options...
Prodigy Posted September 6, 2007 Author Share Posted September 6, 2007 btw does any one know to enable the X button that it actually exits? Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 6, 2007 Share Posted September 6, 2007 (edited) Please clarify, did YOU make an x button and you want it to be the new exit button or are you referring to the original GUI x button? If you made one just do While 1 $nmsg = GUIGetMsg() Switch $nmsg Case $buttonname Exit EndSwitch WEnd Edited September 6, 2007 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Prodigy Posted September 6, 2007 Author Share Posted September 6, 2007 I'm referring to the original GUI x button Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 6, 2007 Share Posted September 6, 2007 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd won't work? Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Prodigy Posted September 7, 2007 Author Share Posted September 7, 2007 k, thanks a lot 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