Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; taper dans vos main il dit le nombre de tape. pour l'aretter taper plus de 4 fois.
- #Include <string.au3>
- ;--------------------
- $cde1=""
- $cde2=""
- $cde3=""
- ;--------------------
- if $CmdLine[0]>0 then
- $cde1=$CmdLine[1]
- endif
- if $CmdLine[0]>1 then
- $cde2=$CmdLine[2]
- endif
- if $CmdLine[0]>2 then
- $cde3=$CmdLine[3]
- endif
- ;--------------------
- $VoiceActivationLevel = 40
- $level=0
- ;--------------------
- Func _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, $hwndCallback)
- Return DllCall("winmm.dll", "long", "mciSendStringA", "str", $lpszCommand, "str", $lpszReturnString, "long", $cchReturn, "long", 0)
- EndFunc
- ;--------------------
- Func _mciShowError($mciError,$add = "test")
- Dim $errStr
- $errStr = _StringRepeat(" ", 256)
- $Result = DllCall("winmm.dll", "long", "mciGetErrorStringA", "long", $mciError, "string", $errStr, "long", StringLen($errStr))
- MsgBox(0, "MCI "&$add, "MCI Error Number " & $mciError & ":" & $Result[2])
- EndFunc
- ;--------------------
- Func ClapCheck()
- Global $lpszCommand,$lpszReturnString,$cchReturn,$level
- $level=0
- $mciError = _mciSendString("status tempwave level", $lpszReturnString, $cchReturn, 0)
- If $mciError[0]<>0 Then
- MsgBox(0,"Erreur MCI 37 ; ",$mciError[0])
- EndIf
- If $mciError[2]>0 Then
- $level=$mciError[2]
- EndIf
- If $level >= $VoiceActivationLevel Then
- $retombe=$level
- While $retombe >= $VoiceActivationLevel
- $mciError = _mciSendString("status tempwave level", $lpszReturnString, $cchReturn, 0)
- $retombe = $mciError[2]
- sleep(6)
- WEnd
- EndIf
- EndFunc
- ;--------------------
- $lpszReturnString = _StringRepeat(" ", 256)
- $cchReturn = StringLen($lpszReturnString)
- $mciError = _mciSendString("open new type waveaudio alias tempwave", $lpszReturnString, $cchReturn, 0);
- If $mciError[0] <> 0 Then
- _mciShowError($mciError[0],"Startup Error")
- Exit
- EndIf
- ;--------------------
- $interv=20
- $delaimaxientre2clics = Int(600/$interv)
- $ClapCount = 0
- $i=$delaimaxientre2clics
- Global $level
- $level=0
- ;--------------------
- While 1
- Sleep($interv)
- $i-=1
- If $i<=0 Then
- If $ClapCount>0 Then
- If $ClapCount>3 Then
- MsgBox(0,"Flytape","Fin du programme",2)
- ExitLoop
- EndIf
- MsgBox(0,"flytape","nombre de tape "&$ClapCount,1)
- EndIf
- $i=$delaimaxientre2clics
- $ClapCount=0
- EndIf
- $level=0
- ClapCheck()
- If $level >= $VoiceActivationLevel Then
- $ClapCount +=1
- $i=$delaimaxientre2clics
- EndIf
- WEnd
- Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement