Sign in to follow this  
Followers 0
onedayillpay

loops

2 posts in this topic

im nnot sure how to explain what im trying to do soo...

soundsetwavevolume is just an example...

#include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
    if _IsPressed("26",$dll) Then
        SoundSetWaveVolume(25)
    Else
        
        If _IsPressed("26",$dll) Then
            SoundSetWaveVolume(50)
        Else
            If _IsPressed("26",$dll) Then
                SoundSetWaveVolume(75)
            Else
                If _IsPressed("26",$dll) Then
                    SoundSetWaveVolume(100)
                Else
                    
                    if _IsPressed("28",$dll) Then
                        SoundSetWaveVolume(0)
                    Else
                        if _IsPressed("28",$dll) Then
                            SoundSetWaveVolume(-25)
                        Else
                            if _IsPressed("28",$dll) Then
                                SoundSetWaveVolume(-50)
                            Else
                                if _IsPressed("28",$dll) Then
                                    SoundSetWaveVolume(-75)
                                Else
                                    if _IsPressed("28",$dll) Then
                                        SoundSetWaveVolume(-100)
                                    Else
                                    EndIf
                                EndIf
                            EndIf
                        EndIf
                    EndIf
                EndIf
            EndIf
        EndIf
    EndIf
WEnd

increas or decreas a setting.... like i sed volume is just for a example so dont try to explain to me y volume wont go past 0 ;)

Share this post


Link to post
Share on other sites



First of all, i am having trouble figuring out what you are doing. You have the same keycode in the ispressed function. You have to realize that the first instance that the if statement is true, it then executes that part of the if statement and then exits out of the if statement completely.

Your better bet for that many if statements would be a select case statement.

#include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
    Select
        Case _IsPressed("26",$dll)
            SoundSetWaveVolume(25)
        Case _IsPressed("28",$dll)
            SoundSetWaveVolume(0)
    EndSelect
WEnd
Func OnAutoItExit()
    DllClose($dll)
Endfunc
oÝ÷ ØÚq«²Ö­zg§¶;¬¶X¤y©È~ËZµéÛayø«²ÚeiÇ­ë-jצz{b²Úîz+-ê'zØZ¶+¢w¢'ò¢èZ½ëaÆ®¶­s` 6VÆV7@ 66Rô5&W76VBgV÷C³#bgV÷C²Âb33c¶FÆ 6÷VæE6WEvfUföÇVÖR#R 66Rô5&W76VBgV÷C³#gV÷C²Âb33c¶FÆ 6÷VæE6WEvfUföÇVÖR 66Rô5&W76VBgV÷C³#gV÷C²Âb33c¶FÆ 6÷VæE6WEvfUföÇVÖR·F2vÆÂæWfW"&RWV7WFVBÂöæÇFR7FFVÖVçB&÷fRvÆÂ&P VæE6VÆV7@

It does it on a first come first match basis. The first statement that rings true is performed and all statements following that one are completely ignored as it jumps to the end of the if statement or select statement.


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

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