Sign in to follow this  
Followers 0
Hendricius

Need Help On Creating A Simple Script

10 posts in this topic

I am totally new to programming.

I want to create a script wich switches between my 2 audio inputs, a headset and a Dolby 5.1 Surround Sound System.

The Headset is named: C-MEDIA USB DEVICE

The Surround: CREATIVE SB LIVE SERIES

here 2 screenshots i took to understand it more easy:

http://img97.imageshack.us/img97/9454/16ql.jpg

http://img97.imageshack.us/img97/1181/24eu1.jpg

I first simply used this script:

MouseClick( "left", 45,752,1,0)

MouseClick( "left", 291,465,1,10)

Sleep(1000)

Send("{S 5}, {ENTER}")

Sleep(500)

MouseClick( "left", 314,186,1,10)

MouseClick( "left", 458,257,1,10)

MouseClick( "left", 302,285,1,10)

MouseClick( "left", 454,570,1,10)

MouseClick( "left", 316,569,1,10)

Sleep(200)

Send("!{F4}")

But The Sound Window in Systemcontrols Always Moves so that doesn't work.

I Tried this then:

ControlClick("Eigenschaften von Sounds und Audiogeräte", "Audio", "ComboBox1"), But she script won't even run. Would be nice if you could hook me up with some hints, wich i know you guys have.

Then i Discovered some more options in the AutoIT v.3 Active Window like "Hidden Window Text", but I don't know the Commands how to use that. The script must switch to the Hidden Window Text "Audio" that should propably fix my problems.

What i wonderd about too is, if the Windows have coordinates in it self. Means: That whereever the Windows are, that the the coordinates in that window for buttons are the same.

Feel free to add me in msn: laggingtime@hotmail.com if you want to help me or just post in this forum

Thanks alot

Hendrik

Share this post


Link to post
Share on other sites



if you want to use mouse movements... put this at the top of your script

Opt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=client

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

thanks and what exactly does it do ?

Share this post


Link to post
Share on other sites

thanks and what exactly does it do ?

It's in the help file...

MouseCoordMode Sets the way coords are used in the mouse functions, either absolute coords or coords relative to the current active window:

0 = relative coords to the active window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the active window


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

yay thanks alot guys :). But where can i see the coordinates for the active window ?

Share this post


Link to post
Share on other sites

thanks alot, and my last question. It works :) ! No more annoying clicking

How can I let a msg box pop up wich tells me what card was selected?

Share this post


Link to post
Share on other sites

what do you mean by "Card"?

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

what do you mean by "Card"?

8)

the screenshots above I posted. there is one C MEDIA USB DEVICE and another one CREATIVE SB LIVE!.

I want a message box to open wich tells me wich of those is selected.

Thanks :)

Share this post


Link to post
Share on other sites

Look at ControlCommand() and "GetCurrentSelection", "" in the help file.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0