Hendricius Posted October 22, 2006 Share Posted October 22, 2006 $cm = 8902893; my headset $cr = 0; my surroundsystem $ib = InputBox("Inputbox","cm=headset, cr=surroundsystem",) Sleep(2000); Mouseclick("left",16,755,1,0); Startmenu Sleep(500); Send("y"); Systemcontrols Sleep(3000); Send("S"); Send("O"); Send("U"); Sound Options Send("{ENTER}"); Sleep(2000); AutoItSetOption ( "MouseCoordMode",0) MouseClick("left",185,46,1,0); at the place where you can change audio options Sleep(2000); If $ib = "cr" Then If PixelGetColor(206, 117) = $cm Then Send("{DOWN}"); <-------------- dont know if this is correct Send("{ENTER}"); EndIf ElseIf PixelGetColor(206, 117) = $cr Then MsgBox(0,"programm","nothing changed"); EndIf If $ib = "cm" Then If PixelGetColor(206, 117) = $cr Then Send("{DOWN}"); Send("{ENTER}"); EndIf ElseIf PixelGetColor(206, 117) = $cm Then MsgBox(0,"programm","nothing changed"); EndIf Basically what this prgoramm should do is: Change the Sound input device in my systemcontrols. Thanks for the help . Link to comment Share on other sites More sharing options...
theguy0000 Posted October 22, 2006 Share Posted October 22, 2006 http://www.autoitscript.com/fileman/users/gafrost/cbemoticon.gifdarnit, crystal ball isn't working. I guess you're going to have to tell us what's wrong.Does it freeze your computer? give you a bsod? do nothing at all? make your computer smoke? take control of your friends and family and turn them into zombies? The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
PaulIA Posted October 22, 2006 Share Posted October 22, 2006 Basically what this prgoramm should do is: Change the Sound input device in my systemcontrols.@Hendricius: I see where you might be having some problems. First, I would open the Sound dialog using the RunDll32 method. Take a look at Dx21 for a reference on how to use RunDll32 to open this dialog. Next, I would use ControlClick and ControlSend to send clicks/text directly to the controls. With the Send function, you have to make sure the correct control is focused first before sending the text. Finally, see if you can get rid of all the sleep statements. They are a crutch and you should be writing the proper code to determine if the control/window is active and ready for input. Look at ControlCommand and in particular the section on "IsVisible" and "IsEnabled". Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Hendricius Posted October 28, 2006 Author Share Posted October 28, 2006 sorry have been on vacations. the programm just stops running If $ib = "cr" Then If PixelGetColor(206, 117) = $cm Theni think this is wrong. please tell me if yes or now . double if function. Link to comment Share on other sites More sharing options...
PaulIA Posted October 28, 2006 Share Posted October 28, 2006 I think you are confused about how to use an if/then/else statement. Either that, or you don't know how to format your code so that it follows the execution flow: If $ib = "cr" Then If PixelGetColor(206, 117) = $cm Then Send("{DOWN}"); Send("{ENTER}"); EndIf ElseIf PixelGetColor(206, 117) = $cr Then <-- Executed if $ib <> "cr" MsgBox(0,"programm","nothing changed"); EndIfoÝ÷ Ù©Ýjëh×6If $ib = "cm" Then If PixelGetColor(206, 117) = $cr Then Send("{DOWN}"); Send("{ENTER}"); EndIf ElseIf PixelGetColor(206, 117) = $cm Then <-- Executed if $ib <> "cm" MsgBox(0,"programm","nothing changed"); EndIf Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
tresa Posted October 28, 2006 Share Posted October 28, 2006 I think the simplest way to go to sounds is to do start menu >>> execute >>> mmsys.cpl >>> shift+tab >>> right and you are on the sound tab ! Link to comment Share on other sites More sharing options...
tresa Posted October 28, 2006 Share Posted October 28, 2006 I think the simplest way to go to sounds is to dostart menu >>> execute >>> mmsys.cpl >>> shift+tab >>> rightand you are on the sound tab !If you want to change something in the audio tab code like this to arrive to the correct tabrun("control.exe mmsys.cpl 0,2") ; where 2 is the tab number-1 (I have volume,sounds,audio,...)...code to do what you want... 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