#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=ico.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Res_Language=1027 #AutoIt3Wrapper_Res_File_Add=logo.jpg, rt_rcdata, TEST_JPG_1 #AutoIt3Wrapper_Res_File_Add=banner.jpg, rt_rcdata, TEST_JPG_2 #AutoIt3Wrapper_Res_File_Add=llave.gif, rt_rcdata, TEST_GIF_1 #AutoIt3Wrapper_Res_File_Add=beep.gif, rt_rcdata, TEST_GIF_2 #AutoIt3Wrapper_Res_File_Add=random.gif, rt_rcdata, TEST_GIF_3 #AutoIt3Wrapper_Res_File_Add=micro.gif, rt_rcdata, TEST_GIF_4 #AutoIt3Wrapper_Res_File_Add=waves.gif, rt_rcdata, TEST_GIF_6 #AutoIt3Wrapper_Res_File_Add=warning.gif, rt_rcdata, TEST_GIF_7 #AutoIt3Wrapper_Res_File_Add=battery.gif, rt_rcdata, TEST_GIF_8 #AutoIt3Wrapper_Res_File_Add=webcam.bmp, rt_bitmap, webcam #AutoIt3Wrapper_Res_File_Add=photo.gif, rt_rcdata, TEST_GIF_10 #AutoIt3Wrapper_Res_File_Add=webcam2.gif, rt_rcdata, TEST_GIF_12 #AutoIt3Wrapper_Res_File_Add=vibrator.gif, rt_rcdata, TEST_GIF_13 #AutoIt3Wrapper_Res_File_Add=warning2.gif, rt_rcdata, TEST_GIF_14 #AutoIt3Wrapper_Res_File_Add=vigilancia.gif, rt_rcdata, TEST_GIF_140 #AutoIt3Wrapper_Res_File_Add=slate.gif, rt_rcdata, TEST_GIF_150 #AutoIt3Wrapper_Res_File_Add=magnifyingglass.gif, rt_rcdata, TEST_GIF_250 #AutoIt3Wrapper_Res_File_Add=song.wav, sound, TEST_WAV_1 #AutoIt3Wrapper_Res_File_Add=song2.wav, sound, TEST_WAV_2 #AutoIt3Wrapper_Res_File_Add=song3.wav, sound, TEST_WAV_3 #AutoIt3Wrapper_Res_File_Add=song4.wav, sound, TEST_WAV_4 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include ;~ vars that must be declared Global $minVal = 0, $maxVal = 901 Global $microfono Global $percent Global $VolumeLabel Global $VolumeLabel2 Global $ProgressBar Global $ProgressBar10 Global $ExitButton Global $Result Global $msg Global $TBS_NOTICKS = 0x0010 Global $lpszCommand Global $sonidoporcentage Global $TBS_REVERSED = 0x0020 Global $pedro Global $pedro2 Global $A Global $input3 Global $TT Global $var Global $Volume Global $gi_Drive Global $cboDrive Global $U Global Const $WM_POWERBROADCAST = 0x0218 Global Const $WM_POWERBROADCAST2 = 0x0218 Global Const $WM_POWERBROADCAST3 = 0x0218 Global Const $WM_POWERBROADCAST4 = 0x0218 Global Const $PBT_APMQUERYSUSPEND = 0x0000 Global $PBT_APMSUSPEND = 0x0004 Global $PBT_APMSTANDBY = 0x0005 Global $PBT_APMBATTERYLOW = 0x0009 Global $PBT_APMPOWERSTATUSCHANGE = 0x000A Global Const $ENDSESSION_CLOSEAPP = 0x00000001 Global Const $ENDSESSION_CRITICAL = 0x40000000 Global Const $ENDSESSION_LOGOFF = 0x80000000 Global Const $shutdown_or_restart = 0x0 Global $array Global $Result Global $hwnd Global $altura Global $posicion Global $bateria Global $pos Global $CHECKBOX11 Global $CHECKBOX12 Global $INPUT12 Global $STATE10 Global $dlldelacamara Global $dlldelacamaraok Global $dlldeluser Global $dlldeluserok Global $putacap Global $cap Global $cap2 Global $gui4 Global $gui2 Global $aTaskBar_Pos[3] Global $okbtn Global $camerabtn Global $On Global $count Global $Alien1 Global $Alien2 Global $Alien3 Global $Alien4 Global $Alien5 Global $Alien6 Global $Alien7 Global $Alien8 Global $estadodelinputrandom Global $range = 1100000; Range / Sensivity( Default 2400000) Global $snapfile = @DesktopDir & "\screenshots" & "\photo" & $count & ".bmp" Global $var8 Global $var9 Global $var10 Global $var11 Global $var12 Global $var15 Global $var16 Global $var17 Global $var18 Global $var19 Global $var22 Global $var23 Global $var24 Global $var25 Global $var26 Global $var29 Global $var30 Global $var31 Global $var32 Global $var33 Global $var36 Global $var37 Global $var38 Global $var39 Global $var40 Global $firstvar8 = $var8 + $range Global $lastvar8 = $var8 - $range Global $firstvar9 = $var9 + $range Global $lastvar9 = $var9 - $range Global $firstvar10 = $var10 + $range Global $lastvar10 = $var10 - $range Global $firstvar11 = $var11 + $range Global $lastvar11 = $var11 - $range Global $firstvar12 = $var12 + $range Global $lastvar12 = $var12 - $range Global $firstvar15 = $var15 + $range Global $lastvar15 = $var15 - $range Global $firstvar16 = $var16 + $range Global $lastvar16 = $var16 - $range Global $firstvar17 = $var17 + $range Global $lastvar17 = $var17 - $range Global $firstvar18 = $var18 + $range Global $lastvar18 = $var18 - $range Global $firstvar19 = $var19 + $range Global $lastvar19 = $var19 - $range Global $firstvar22 = $var22 + $range Global $lastvar22 = $var22 - $range Global $firstvar23 = $var23 + $range Global $lastvar23 = $var23 - $range Global $firstvar24 = $var24 + $range Global $lastvar24 = $var24 - $range Global $firstvar25 = $var25 + $range Global $lastvar25 = $var25 - $range Global $firstvar26 = $var26 + $range Global $lastvar26 = $var26 - $range Global $firstvar29 = $var29 + $range Global $lastvar29 = $var29 - $range Global $firstvar30 = $var30 + $range Global $lastvar30 = $var30 - $range Global $firstvar31 = $var31 + $range Global $lastvar31 = $var31 - $range Global $firstvar32 = $var32 + $range Global $lastvar32 = $var32 - $range Global $firstvar33 = $var33 + $range Global $lastvar33 = $var33 - $range Global $firstvar36 = $var36 + $range Global $lastvar36 = $var36 - $range Global $firstvar37 = $var37 + $range Global $lastvar37 = $var37 - $range Global $firstvar38 = $var38 + $range Global $lastvar38 = $var38 - $range Global $firstvar39 = $var39 + $range Global $lastvar39 = $var39 - $range Global $firstvar40 = $var40 + $range Global $lastvar40 = $var40 - $range Local $count = 0 $WM_CAP_START = 0x400 $WM_CAP_UNICODE_START = $WM_CAP_START + 100 $WM_CAP_PAL_SAVEA = $WM_CAP_START + 81 $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81 $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW $WM_CAP_ABORT = $WM_CAP_START + 69 $WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46 $WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43 $WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41 $WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42 $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10 $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11 $WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14 $WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12 $WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12 $WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13 $WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13 $WM_CAP_EDIT_COPY = $WM_CAP_START + 30 $WM_CAP_END = $WM_CAP_UNICODE_END $WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22 $WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21 $WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21 $WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23 $WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23 $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25 $WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25 $WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20 $WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20 $WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24 $WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36 $WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1 $WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67 $WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67 $WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65 $WM_CAP_GET_STATUS = $WM_CAP_START + 54 $WM_CAP_GET_USER_DATA = $WM_CAP_START + 8 $WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44 $WM_CAP_GRAB_FRAME = $WM_CAP_START + 60 $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61 $WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83 $WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84 $WM_CAP_PAL_OPENA = $WM_CAP_START + 80 $WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80 $WM_CAP_PAL_PASTE = $WM_CAP_START + 82 $WM_CAP_SEQUENCE = $WM_CAP_START + 62 $WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63 $WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35 $WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85 $WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2 $WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2 $WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5 $WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3 $WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3 $WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6 $WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7 $WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4 $WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66 $WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66 $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51 $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50 $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52 $WM_CAP_SET_SCALE = $WM_CAP_START + 53 $WM_CAP_SET_SCROLL = $WM_CAP_START + 55 $WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64 $WM_CAP_SET_USER_DATA = $WM_CAP_START + 9 $WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45 $WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72 $WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71 $WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70 $WM_CAP_STOP = $WM_CAP_START + 68 Opt("PixelCoordMode", 2) Global $resolucionvertical = 640 Global $resolucionhorizontal = $resolucionvertical * 1.32 Global $coordenadasX = $resolucionhorizontal / 11 Global $coordenadasY = $resolucionvertical / 11 ;~ only one Selfbondage CD Tray Opener at time _Singleton("Unique String Here") ;~ the main window of the program $myGUI = GUICreate(" Selfbondage CD Tray Opener 3.0", 420, 635, 483, -1) GUISetState(@SW_SHOW) Func On_Exit() CDTray($U, "open") Sleep(300) CDTray($U, "open") Exit EndFunc ;==>On_Exit ; http://msdn.microsoft.com/en-us/library/aa969510%28VS.85%29.aspx Global Const $DWM_EC_DISABLECOMPOSITION = 0 DllCall("dwmapi.dll", "hwnd", "DwmEnableComposition", "uint", $DWM_EC_DISABLECOMPOSITION) Sleep(50) Func _BatteryQueryEx() Local $SystemPower, $ret, $array[5] ; Setup $array and $SystemPower $SystemPower = DllStructCreate("ubyte;ubyte;ubyte;ubyte;ulong;ulong") If @error Then SetError(-1) Return $array EndIf ; make the DllCall $ret = DllCall("kernel32.dll", "int", "GetSystemPowerStatus", "ptr", DllStructGetPtr($SystemPower)) If @error Then;DllCall Failed SetError(-2) $SystemPower = 0 Return $array EndIf If Not $ret[0] Then; GetSystemPowerStatus Failed SetError(-3) $SystemPower = 0 Return $array EndIf ; Fill the array $array[0] = DllStructGetData($SystemPower, 1); AC $array[1] = DllStructGetData($SystemPower, 2); Battery Charge $array[2] = DllStructGetData($SystemPower, 3); Battery Charge % $array[3] = DllStructGetData($SystemPower, 5); Sec Battery Left $array[4] = DllStructGetData($SystemPower, 6); Sec Battery Capacity @ Full Charge If $array[2] < $bateria Then MsgBox(4096, "WARNING!", "Opening tray due to low battery level", 10) Sleep(10) On_Exit() EndIf ; free the struct $SystemPower = 0 Return $array EndFunc ;==>_BatteryQueryEx $WM_QUERYENDSESSION = 0x11 GUIRegisterMsg($WM_QUERYENDSESSION, "Cancel_Shutdown") Func _ShutdownBlockReasonCreate($hwnd, $wStr) ; http://msdn.microsoft.com/en-us/library/ms...28VS.85%29.aspx ; Prog@ndy Local $aResult = DllCall("User32.dll", "int", "ShutdownBlockReasonCreate", "hwnd", $hwnd, "wstr", $wStr) If @error Then Return SetError(1, 0, 0) Return $aResult[0] EndFunc ;==>_ShutdownBlockReasonCreate Func _ShutdownBlockReasonDestroy($hwnd) Local $aResult = DllCall("User32.dll", "int", "ShutdownBlockReasonDestroy", "hwnd", $hwnd) If @error Then Return SetError(1, 0, 0) Return $aResult[0] EndFunc ;==>_ShutdownBlockReasonDestroy Func Cancel_Shutdown($hWndGUI, $MsgID, $WParam, $LParam) ; This HAS to be here to capture the endsession... AdlibRegister("Cancel_ShutdownResolver", 50) Return False EndFunc ;==>Cancel_Shutdown Func Cancel_ShutdownResolver() Local $iOpt = Opt("WinTitleMatchMode", 4), $hwnd = WinGetHandle("[CLASS:BlockedShutdownResolver]") Opt("WinTitleMatchMode", $iOpt) If $hwnd Then If @OSVersion = "WIN_7" Then ControlClick($hwnd, "", "[CLASS:Button; INSTANCE:1]") If @OSVersion <> "WIN_7" Then ControlClick($hwnd, "", "[CLASS:Button; INSTANCE:2]") AdlibUnRegister("Cancel_ShutdownResolver") EndIf EndFunc ;==>Cancel_ShutdownResolver ;~ link with the email $c_Hyperlink_FunkEu = GUICtrlCreateLabel("contact", 3, 608) GUICtrlSetFont(-1, 9, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000FF) GUICtrlSetCursor(-1, 0) GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GUISetState(@SW_SHOW); will display an empty dialog box ;~ Labels with the security warnings and the time input $Label = GUICtrlCreateLabel("", 10, 405) GUICtrlCreateLabel("» Use only with laptops or computers connected to an UPS system !", 51, 125) GUICtrlCreateLabel("» Do NOT use without an alternative release method !! Visit to learn more:", 38, 140) GUICtrlCreateLabel("Type how many MINUTES you want to wait and press START: ", 48, 218) GUICtrlSetFont(9, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000AE) ;~ time input box $input = GUICtrlCreateInput("", 350, 214, 45, 20, $ES_NUMBER) $updown = GUICtrlCreateUpdown($input) ;~ we press the tab button to get the cursor on the time input Send("{TAB}") ;~ battery input box $input10 = GUICtrlCreateInput("", 322, 276, 42, 20, $ES_NUMBER) $updown10 = GUICtrlCreateUpdown($input10) GUICtrlSetLimit($input10, 90, 10) GUICtrlSetData($input10, 15) ;~ the program asks if play a beep during the countdown $CHECKBOX = GUICtrlCreateCheckbox(" Beep during the countdown?", 140, 312, 180, 20) GUICtrlSetState(-1, $GUI_CHECKED) ;~ the program asks if use the random time function $CHECKBOX2 = GUICtrlCreateCheckbox("Play with random time? (If so, type the max. and the min. time)", 55, 336, 309, 20) GUICtrlSetState(0, $GUI_CHECKED) $inputrandom = GUICtrlCreateInput("30", 370, 335, 42, 20, $ES_NUMBER) $updownrandom = GUICtrlCreateUpdown($inputrandom) ;~ the program looks how many cd drives we have on the computer Local $a_DriveList = DriveGetDrive('CDROM'), $s_DriveList For $i_aDriveList = 1 To UBound($a_DriveList) - 1 $s_DriveList &= StringUpper($a_DriveList[$i_aDriveList]) & '|' Next Local $cboDrive = GUICtrlCreateCombo("", 323, 245, 40, 30, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, $s_DriveList) _GUICtrlComboBox_SetCurSel($cboDrive, 0) GUISetState(@SW_SHOW) GUICtrlCreateLabel("Choose what CD Drive must be opened during the session:", 37, 250) GUICtrlSetFont(9, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000AE) $testbtn = GUICtrlCreateButton("Test", 366, 244, 33, 23) $U = GUICtrlRead($cboDrive) GUICtrlCreateLabel("%", 370, 280) GUICtrlCreateLabel("Please input the LOWER battery level allowed:", 92, 280) GUICtrlSetFont(9, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000AE) ;~ the program asks if play with teasing mode (every time the microphone gets a noise it will play a sound that will move the vibrator) $CHECKBOX3 = GUICtrlCreateCheckbox("Play with teasing? (Microphone and activated by sound devices required)", 34, 363, 375, 20) GUICtrlSetState(0, $GUI_CHECKED) ;~ the programs asks if we want the vibrator to play randomly $CHECKBOX4 = GUICtrlCreateCheckbox("Play with random teasing? (Activated by sound devices are required)", 48, 492, 375, 20) GUICtrlSetState(0, $GUI_CHECKED) ;~ We create the START and EXIT buttons (START is by default remarked) $okbtn = GUICtrlCreateButton("START", 110, 595, 80, 30) GUICtrlSetState(-1, 512) $exitbtn = GUICtrlCreateButton("EXIT", 230, 595, 80, 30) ;~ the logo of the program, when compiling all the stuff must be in the same directory as the source $Pic1 = GUICtrlCreatePic("", 20, 0, 400, 111) _ResourceSetImageToCtrl($Pic1, "TEST_JPG_1") ;~ the boundanna banner Global $Pic2 = GUICtrlCreatePic("", 40, 163, 400, 44) _ResourceSetImageToCtrl($Pic2, "TEST_JPG_2") GUICtrlSetCursor($Pic2, 0) ;~ the key pic $Pic3 = GUICtrlCreatePic("", 20, 214, 22, 22) _ResourceSetImageToCtrl($Pic3, "TEST_GIF_1") ;~ the beep pic $Pic4 = GUICtrlCreatePic("", 110, 310, 22, 22) _ResourceSetImageToCtrl($Pic4, "TEST_GIF_2") ;~ the random pic $Pic5 = GUICtrlCreatePic("", 25, 330, 20, 25) _ResourceSetImageToCtrl($Pic5, "TEST_GIF_3") ;~ the mic pic $Pic6 = GUICtrlCreatePic("", 20, 400, 25, 26) _ResourceSetImageToCtrl($Pic6, "TEST_GIF_4") ;~ the waves pic $Pic8 = GUICtrlCreatePic("", 18, 490, 23, 23) _ResourceSetImageToCtrl($Pic8, "TEST_GIF_6") ;~ the battery pic $Pic10 = GUICtrlCreatePic("", 58, 270, 26, 26) _ResourceSetImageToCtrl($Pic10, "TEST_GIF_8") ;~ the vibrator pic $Pic120 = GUICtrlCreatePic("", 15, 550, 24, 35) _ResourceSetImageToCtrl($Pic120, "TEST_GIF_13") ;~ the warning 2 pic $Pic240 = GUICtrlCreatePic("", 205, 555, 26, 22) _ResourceSetImageToCtrl($Pic240, "TEST_GIF_14") ;~ button that opens the webcam options $webcamguibtn = GUICtrlCreateButton("", 380, 590, 35, 35, $BS_BITMAP) _ResourceSetImageToCtrl($webcamguibtn, "webcam", $RT_BITMAP) ;~ We give it a little pause and force the program to read the input time value Sleep(20) GUICtrlSetData($Label, GUICtrlRead($input)) Sleep(100) GUICtrlCreateLabel("Choose how long must be the teasing according to the devices you're using:", 36, 530) $Radio1 = GUICtrlCreateRadio("Long Teasing (vibrator)", 48, 560, 150, 15) GUICtrlSetState($Radio1, $GUI_CHECKED) $Radio2 = GUICtrlCreateRadio("Short Teasing (barking collar)", 240, 560, 158, 15) ;~ this is the function that works when we press the email link Func MY_WM_COMMAND($hwnd, $msg, $WParam, $LParam) Local $iIDFrom = BitAND($WParam, 0xFFFF);LoWord Switch $iIDFrom Case $c_Hyperlink_FunkEu ShellExecute("mailto:qwertybcn121@gmail.com") EndSwitch EndFunc ;==>MY_WM_COMMAND ;~ looking for microhone values Dim $lpszDevice ; Identifier of an MCI device or device driver. Dim $lpszDeviceID ; Identifier of an MCI device. ; This identifier or alias is assigned when the device is opened. Dim $lpszOpenFlags ; Flag that identifies what to initialize. Dim $lpszRequest ; Flag for requesting status information. See table on the web page mentioned above. ; Source: http://msdn.microsoft.com/library/en-us/multimed/htm/_win32_the_wait_notify_and_test_flags.asp Dim $lpszFlags ; Can be "wait", "notify", or both. ; For digital-video and VCR devices, "test" can also be specified. Dim $lpszCommand ; mciCommand string to send. Dim $lpszReturnString ; information will be returned into this string. Reserve enough space! Dim $cchReturn ; Length of returnstring Dim $mciError ; mci error code ; STEP 1: Open the device we want to monitor ; Source: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_open.asp ;$lpszDevice = "waveaudio" $lpszDevice = "new type waveaudio" $lpszOpenFlags = "alias mywave" ; For all possible flags, see table on web page mentioned above. $lpszFlags = "" $lpszCommand = StringFormat("open %s %s %s", $lpszDevice, $lpszOpenFlags, $lpszFlags); $lpszReturnString = _StringRepeat(" ", 100) ; Information will return in this string $cchReturn = StringLen($lpszReturnString) ; Size, in characters, of the return buffer specified ; by the lpszReturnString parameter. $mciError = _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, 0); If $mciError[0] <> 0 Then _mciShowError($mciError[0]) ; STEP 2: Obtain the audio levels ; Source: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_status_mm.asp $lpszDeviceID = "mywave" $lpszRequest = "level" ; Returns the current PCM audio sample value. ; See table on web page mentioned above. $lpszFlags = "" $lpszCommand = StringFormat("status %s %s %s", $lpszDeviceID, $lpszRequest, $lpszFlags); ;mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm GUICtrlCreateLabel("%", 398, 419) $VolumeLabel2 = GUICtrlCreateInput("", 365, 415, 30, 20, BitOR($ES_AUTOHSCROLL, $ES_READONLY)) $ProgressBar = GUICtrlCreateProgress(55, 415, 300, 20, $PBS_SMOOTH) $slide1 = GUICtrlCreateSlider(46, 385, 316, 30, $TBS_NOTICKS) GUICtrlSetLimit($slide1, 100, 1) GUICtrlSetData($slide1, 100) $input3 = GUICtrlCreateInput("", 364, 386, 32, 20, BitOR($ES_AUTOHSCROLL, $ES_READONLY)) GUICtrlCreateLabel("%", 398, 389) Func _Manual() GUICtrlSetData($input3, GUICtrlRead($slide1)) EndFunc ;==>_Manual GUICtrlCreateLabel("Choose a threshold of sound with the slider.", 109, 440) GUICtrlSetFont(9, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x8B0000) GUICtrlCreateLabel("If you make any sound louder than that level during the session...", 60, 455) GUICtrlSetFont(9, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x8B0000) GUICtrlCreateLabel("...program will play a sound that will activate any sound activated device.", 45, 470) GUICtrlSetFont(9, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x8B0000) ; USER DEFINED FUNCTIONS Func _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, $hwndCallback) ;VB-style declaration: ; ;Declare Function mciSendString ; Lib "winmm.dll" ; Alias "mciSendStringA" ; (ByVal lpstrCommand As String, ; ByVal lpstrReturnString As String, ; ByVal uReturnLength As Long, ; ByVal hwndCallback As Long) ; As Long ; mciSendString returns information in the lpszReturnString parameter of mciSendString. ; The information is dependent on the request type. Return DllCall("winmm.dll", "long", "mciSendStringA", "str", $lpszCommand, "str", $lpszReturnString, "long", $cchReturn, "long", 0) EndFunc ;==>_mciSendString Func _mciShowError($mciError) ; To show a "readable" mci error. ; ;VB-style declaration: ; ;Declare Function mciGetErrorString ; Lib "winmm.dll" ; Alias "mciGetErrorStringA" ; (ByVal dwError As Long, ; ByVal lpstrBuffer As String, ; ByVal uLength As Long) ; As Long Dim $errStr ; Error message $errStr = _StringRepeat(" ", 100) ; Reserve some space for the error message $Result = DllCall("winmm.dll", "long", "mciGetErrorStringA", "long", $mciError, "string", $errStr, "long", StringLen($errStr)) EndFunc ;==>_mciShowError $resolucionvertical = 480 $resolucionhorizontal = 360 $On = 1 Func UpdateActiveColors() Global $coordenadasX = $resolucionhorizontal / 11 Global $coordenadasY = $resolucionvertical / 11 Global $var8 = PixelGetColor($coordenadasX * 4, $coordenadasY * 4) Global $var9 = PixelGetColor($coordenadasX * 4, $coordenadasY * 5) Global $var10 = PixelGetColor($coordenadasX * 4, $coordenadasY * 6) Global $var11 = PixelGetColor($coordenadasX * 4, $coordenadasY * 7) Global $var12 = PixelGetColor($coordenadasX * 4, $coordenadasY * 8) Global $var15 = PixelGetColor($coordenadasX * 5, $coordenadasY * 4) Global $var16 = PixelGetColor($coordenadasX * 5, $coordenadasY * 5) Global $var17 = PixelGetColor($coordenadasX * 5, $coordenadasY * 6) Global $var18 = PixelGetColor($coordenadasX * 5, $coordenadasY * 7) Global $var19 = PixelGetColor($coordenadasX * 5, $coordenadasY * 8) Global $var22 = PixelGetColor($coordenadasX * 6, $coordenadasY * 4) Global $var23 = PixelGetColor($coordenadasX * 6, $coordenadasY * 5) Global $var24 = PixelGetColor($coordenadasX * 6, $coordenadasY * 6) Global $var25 = PixelGetColor($coordenadasX * 6, $coordenadasY * 7) Global $var26 = PixelGetColor($coordenadasX * 6, $coordenadasY * 8) Global $var29 = PixelGetColor($coordenadasX * 7, $coordenadasY * 4) Global $var30 = PixelGetColor($coordenadasX * 7, $coordenadasY * 5) Global $var31 = PixelGetColor($coordenadasX * 7, $coordenadasY * 6) Global $var32 = PixelGetColor($coordenadasX * 7, $coordenadasY * 7) Global $var33 = PixelGetColor($coordenadasX * 7, $coordenadasY * 8) Global $var36 = PixelGetColor($coordenadasX * 8, $coordenadasY * 4) Global $var37 = PixelGetColor($coordenadasX * 8, $coordenadasY * 5) Global $var38 = PixelGetColor($coordenadasX * 8, $coordenadasY * 6) Global $var39 = PixelGetColor($coordenadasX * 8, $coordenadasY * 7) Global $var40 = PixelGetColor($coordenadasX * 8, $coordenadasY * 8) EndFunc ;==>UpdateActiveColors Func CalculateRange() Global $firstvar8 = $var8 + $range Global $lastvar8 = $var8 - $range Global $firstvar9 = $var9 + $range Global $lastvar9 = $var9 - $range Global $firstvar10 = $var10 + $range Global $lastvar10 = $var10 - $range Global $firstvar11 = $var11 + $range Global $lastvar11 = $var11 - $range Global $firstvar12 = $var12 + $range Global $lastvar12 = $var12 - $range Global $firstvar15 = $var15 + $range Global $lastvar15 = $var15 - $range Global $firstvar16 = $var16 + $range Global $lastvar16 = $var16 - $range Global $firstvar17 = $var17 + $range Global $lastvar17 = $var17 - $range Global $firstvar18 = $var18 + $range Global $lastvar18 = $var18 - $range Global $firstvar19 = $var19 + $range Global $lastvar19 = $var19 - $range Global $firstvar22 = $var22 + $range Global $lastvar22 = $var22 - $range Global $firstvar23 = $var23 + $range Global $lastvar23 = $var23 - $range Global $firstvar24 = $var24 + $range Global $lastvar24 = $var24 - $range Global $firstvar25 = $var25 + $range Global $lastvar25 = $var25 - $range Global $firstvar26 = $var26 + $range Global $lastvar26 = $var26 - $range Global $firstvar29 = $var29 + $range Global $lastvar29 = $var29 - $range Global $firstvar30 = $var30 + $range Global $lastvar30 = $var30 - $range Global $firstvar31 = $var31 + $range Global $lastvar31 = $var31 - $range Global $firstvar32 = $var32 + $range Global $lastvar32 = $var32 - $range Global $firstvar33 = $var33 + $range Global $lastvar33 = $var33 - $range Global $firstvar36 = $var36 + $range Global $lastvar36 = $var36 - $range Global $firstvar37 = $var37 + $range Global $lastvar37 = $var37 - $range Global $firstvar38 = $var38 + $range Global $lastvar38 = $var38 - $range Global $firstvar39 = $var39 + $range Global $lastvar39 = $var39 - $range Global $firstvar40 = $var40 + $range Global $lastvar40 = $var40 - $range EndFunc ;==>CalculateRange Func CheckForChange() if ($var8 < $firstvar8 And $var8 > $lastvar8) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var9 < $firstvar9 And $var9 > $lastvar9) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var10 < $firstvar10 And $var10 > $lastvar10) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var11 < $firstvar11 And $var11 > $lastvar11) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var12 < $firstvar12 And $var12 > $lastvar12) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var15 < $firstvar15 And $var15 > $lastvar15) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var16 < $firstvar16 And $var16 > $lastvar16) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var17 < $firstvar17 And $var17 > $lastvar17) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var18 < $firstvar18 And $var18 > $lastvar18) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var19 < $firstvar19 And $var19 > $lastvar19) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var22 < $firstvar22 And $var22 > $lastvar22) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var23 < $firstvar23 And $var23 > $lastvar23) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var24 < $firstvar24 And $var24 > $lastvar24) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var25 < $firstvar25 And $var25 > $lastvar25) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var26 < $firstvar26 And $var26 > $lastvar26) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var29 < $firstvar29 And $var29 > $lastvar29) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var30 < $firstvar30 And $var30 > $lastvar30) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var31 < $firstvar31 And $var31 > $lastvar31) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var32 < $firstvar32 And $var32 > $lastvar32) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var33 < $firstvar33 And $var33 > $lastvar33) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var36 < $firstvar36 And $var36 > $lastvar36) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var37 < $firstvar37 And $var37 > $lastvar37) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var38 < $firstvar38 And $var38 > $lastvar38) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var39 < $firstvar39 And $var39 > $lastvar39) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf if ($var40 < $firstvar40 And $var40 > $lastvar40) Then UpdateActiveColors() Else _ResourcePlaySound("TEST_WAV_1", 1) UpdateActiveColors() CalculateRange() EndIf EndFunc ;==>CheckForChange $gui2 = GUICreate("Video Mode Setup", 483, 600, 0, -1, $DS_MODALFRAME) GUISetState(@SW_HIDE, $gui2) ;~ the slate pic $Pic150 = GUICtrlCreatePic("", 120, 370, 30, 30) _ResourceSetImageToCtrl($Pic150, "TEST_GIF_150") ;~ checkbox that asks if you want to see the video of the webcam with the countdown screen $CHECKBOX11 = GUICtrlCreateCheckbox("Show video during the countdown?", 160, 380, 195, 20) GUICtrlSetState(0, $GUI_CHECKED) If GUICtrlRead($CHECKBOX11) = 1 Then $STATE11 = "CHECK" Else $STATE11 = "UNCHECK" EndIf ;~ the photo pic $Pic13 = GUICtrlCreatePic("", 135, 417, 26, 20) _ResourceSetImageToCtrl($Pic13, "TEST_GIF_10") ;~ checkbox that asks if you want to save pictures taken with the webcam and how often they must be taken $CHECKBOX12 = GUICtrlCreateCheckbox("Take pictures of your session?", 175, 418, 350, 20) GUICtrlSetState(0, $GUI_CHECKED) $CHECKBOX15 = GUICtrlCreateCheckbox("Motion Detection? (Devices activated by sound are required)", 100, 455, 350, 20) $camerabtn = GUICtrlCreateButton("Stop Camera", 199, 535, 90, 25) ;~ the vigilancia pic $Pic140 = GUICtrlCreatePic("", 61, 445, 30, 30) _ResourceSetImageToCtrl($Pic140, "TEST_GIF_140") ;~ the time pic $Pic250 = GUICtrlCreatePic("", 22, 485, 20, 25) _ResourceSetImageToCtrl($Pic250, "TEST_GIF_3") $sensoradjust = GUICtrlCreateLabel("Input the time that you need before the motion detector starts teasing you", 50, 493) $INPUT120 = GUICtrlCreateInput("0", 400, 490, 45, 20, $ES_NUMBER) $updown120 = GUICtrlCreateUpdown($INPUT120) GUICtrlCreateLabel("Min.", 450, 493) $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") Func cerrarcamaraweb() GUICtrlRead($STATE11) $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_END, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) DllClose($user) GUISetState(@SW_HIDE, $gui2) EndFunc ;==>cerrarcamaraweb ;nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn While 1 ;~ force the gui to still opened: $msg = GUIGetMsg() _Manual() $TT = GUICtrlRead($input3) $bateria = GUICtrlRead($input10) $U = GUICtrlRead($cboDrive) $DELAY = GUICtrlRead($INPUT120) ;~ microphone stuff, to make it read the mic input values $mciError = _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, 0); If GUICtrlRead($CHECKBOX3) = 1 Then $STATE3 = "CHECK" Else $STATE3 = "UNCHECK" EndIf If GUICtrlRead($CHECKBOX11) = 1 Then $STATE11 = "CHECK" Else $STATE11 = "UNCHECK" EndIf If GUICtrlRead($CHECKBOX12) = 1 Then $STATE12 = "CHECK" Else $STATE12 = "UNCHECK" EndIf If $STATE3 = "UNCHECK" Then GUICtrlSetData($ProgressBar, 0) EndIf If $STATE3 = "UNCHECK" Then GUICtrlSetData($VolumeLabel2, "" & 0) EndIf If $STATE3 = "CHECK" Then GUICtrlSetData($ProgressBar, $mciError[2]) _probamossonido() EndIf If $STATE3 = "CHECK" Then GUICtrlSetData($VolumeLabel2, "" & $A) EndIf $TT = GUICtrlRead($input3) If $mciError[0] <> 0 Then _mciShowError($mciError[0]) ;~ We indicate to the program where it may take the microphone values GUICtrlSetData($VolumeLabel, "" & $mciError[2]) $pedro = ($mciError[2]) * 0.78125 $A = Round($pedro, 0) If GUICtrlRead($CHECKBOX15) = 1 Then $STATE15 = "CHECK" Else $STATE15 = "UNCHECK" EndIf If $STATE12 = "CHECK" Then GUICtrlSetState($CHECKBOX11, $GUI_CHECKED) EndIf If $STATE15 = "CHECK" And $On = 1 Then UpdateActiveColors() CalculateRange() CheckForChange() EndIf Select ;~ here we tell the program that if exit button is pressed it may close the program Case $msg = $exitbtn Or $msg = $GUI_EVENT_CLOSE Exit Case $msg = $testbtn CDTray($U, "open") Case $msg = $webcamguibtn $On = 1 $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD, $WS_VISIBLE), "int", 0, "int", 0, "int", 480, "int", 360, "hwnd", $gui2, "int", 1) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEOSOURCE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEOFORMAT, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0) Sleep(20) GUISetState(@SW_SHOW, $gui2) Sleep(20) Case $msg = $camerabtn $On = 2 GUISetState(@SW_HIDE, $gui2) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_END, "int", 0, "int", 0) Sleep(20) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) DllClose($user) Sleep(20) GUICtrlSetData($INPUT120, 0) Sleep(20) GUICtrlSetState($CHECKBOX11, $GUI_UNCHECKED) Sleep(20) GUICtrlSetState($CHECKBOX15, $GUI_UNCHECKED) Sleep(20) GUICtrlSetState($CHECKBOX12, $GUI_UNCHECKED) Sleep(20) GUISetState(@SW_HIDE, $gui2) $RTR = GUICtrlRead($INPUT120) If $RTR > 60 Then GUICtrlSetData($INPUT120, 59) EndIf ;~ link to boundanna Case $msg = $Pic2 ShellExecute("http://www.boundanna.com") Case $msg = $okbtn If $bateria > 90 Then GUICtrlSetData($input10, 90) MsgBox(48, "WARNING!", "The LOWER allowed battery level" & @CRLF & "before opening the CD Tray" & @CRLF & "must be less than 90%" & @CRLF & " " & @CRLF & "For this sessions it will be set at 90%", 10) EndIf If $bateria < 10 Then GUICtrlSetData($input10, 10) MsgBox(48, "WARNING!", "The LOWER allowed battery level" & @CRLF & "before opening the CD Tray" & @CRLF & "must be bigger than 10%" & @CRLF & " " & @CRLF & "For this sessions it will be set at 10%", 10) EndIf If $STATE15 = "CHECK" And $INPUT120 > 0 Then $RTR = GUICtrlRead($INPUT120) EndIf $RTR = GUICtrlRead($INPUT120) If $RTR > 60 Then GUICtrlSetData($INPUT120, 59) EndIf If $STATE12 = "CHECK" Then DirCreate(@DesktopDir & "\Selfbondage Session") EndIf $read = GUICtrlRead($input) If $read < $minVal Or $read > $maxVal Then GUICtrlSetData($input, '') MsgBox(48, "Time limitation", "Due to safety reasons" & @CRLF & "this program only allows" & @CRLF & "selfbondage sessions" & @CRLF & "up to 900 minutes" & @CRLF & " " & @CRLF & "If you want a longuer limit" & @CRLF & "please contact me") ;~ If the input of time is lower than 900 it will read some of the inputs and will close the gui to let the coundown work Else $On = 2 GUICtrlRead($STATE3) GUICtrlRead($STATE15) GUICtrlRead($STATE12) GUICtrlRead($CHECKBOX11) $y = GUICtrlRead($input) ;reads the time in the input GUICtrlRead($inputrandom) $TT = GUICtrlRead($input3) ;reads the noise threashold $U = GUICtrlRead($cboDrive) ;reads what cd drive must be used on the session $bateria = GUICtrlRead($input10) $RTR = GUICtrlRead($INPUT120) GUICtrlRead($Radio1) GUICtrlRead($Radio2) Sleep(20) GUISetState(@SW_HIDE, $myGUI) Sleep(20) GUIDelete($gui2) Sleep(20) ExitLoop EndIf EndSelect WEnd ;~ we told the program to open the cd drive an exit with the function On_exit when the Esc button is pressed HotKeySet("{ESC}", "On_Exit") Func _probamossonido() $mciError = _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, 0) If $mciError[0] <> 0 Then _mciShowError($mciError[0]) $pedro = ($mciError[2]) * 0.78125 If $pedro > $TT Then _ResourcePlaySound("TEST_WAV_1", 1) Sleep(500) EndIf EndFunc ;==>_probamossonido ;~ here we check the state of the checkboxes to activate the beep (CHECKBOX) and to activate the Random time mode(CHECKBOX 2) If GUICtrlRead($CHECKBOX) = 1 Then $STATE = "CHECK" Else $STATE = "UNCHECK" EndIf If GUICtrlRead($CHECKBOX2) = 1 Then $STATE2 = "CHECK" Else $STATE2 = "UNCHECK" EndIf ;~ check the checkbox that controls the teasing mode If GUICtrlRead($CHECKBOX4) = 1 Then $STATE4 = "CHECK" Else $STATE4 = "UNCHECK" EndIf ;~ if the random time is checked, then we will use the input time * 60 (to pass from minutes to seconds) and we call this variable $Q If $STATE2 = "CHECK" Then $Q = 1 Else $Q = GUICtrlRead($input) * 60 EndIf Func _castigo() $mciError = _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, 0) If $mciError[0] <> 0 Then _mciShowError($mciError[0]) $pedro = ($mciError[2]) * 0.78125 If $pedro > $TT Then _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! Sleep(10) EndIf EndFunc ;==>_castigo Func _castigo2() $mciError = _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, 0) If $mciError[0] <> 0 Then _mciShowError($mciError[0]) $pedro = ($mciError[2]) * 0.78125 If $pedro > $TT Then _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! Sleep(10) EndIf EndFunc ;==>_castigo2 ; Find taskbar Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("classname=Shell_TrayWnd") AutoItSetOption("WinTitleMatchMode", $iPrevMode) $anchura = 680 $altura = 180 ;~ this changes the position of the danger image on the countdown screen $posicion = @DesktopHeight - $aTaskBar_Pos[3] - 150 $posicion2 = $posicion / 100 $posicion3 = $posicion2 * $TT $posicion4 = $posicion3 - 16 $posicion5 = $posicion - $posicion4 ;~ jugar con el valor de posición 4 para acabar de cuadrar la imagen If $STATE11 = "CHECK" Then cerrarcamaraweb() Sleep(20) camaradurantecountdown() EndIf $altogui4 = @DesktopHeight - $aTaskBar_Pos[3] $anchogui4 = $altogui4 * 1.333 $gui4 = GUICreate("SMILE! You're On TV!!", $anchogui4, $altogui4, 140, 0, $DS_MODALFRAME) GUISetState(@SW_HIDE, $gui4) Func camaradurantecountdown() $altogui4 = @DesktopHeight - $aTaskBar_Pos[3] $anchogui4 = $altogui4 * 1.333 Sleep(200) GUISetState(@SW_SHOW, $gui4) $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD, $WS_VISIBLE), "int", 0, "int", 0, "int", $anchogui4, "int", $altogui4, "hwnd", $gui4, "int", 1) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0) Sleep(20) EndFunc ;==>camaradurantecountdown If $STATE11 = "CHECK" Or $STATE15 = "CHECK" Then camaradurantecountdown() EndIf GUICtrlRead($STATE3) $gui3 = GUICreate("Noise Level", 140, @DesktopHeight - $aTaskBar_Pos[3], 0, 0, $DS_MODALFRAME) GUISetState(@SW_HIDE, $gui3) $Pic9 = GUICtrlCreatePic("", 60, $posicion5, 64, 76) _ResourceSetImageToCtrl($Pic9, "TEST_GIF_7") $ProgressBar10 = GUICtrlCreateProgress(5, 50, 50, @DesktopHeight - $aTaskBar_Pos[3] - 150, $PBS_VERTICAL, $PBS_SMOOTH) GUICtrlSetData($ProgressBar10, $pedro2) If $STATE3 = "CHECK" Then GUISetState(@SW_SHOW, $gui3) Else GUISetState(@SW_HIDE, $gui3) EndIf Func CLOSEClicked() On_Exit() EndFunc ;==>CLOSEClicked Func _aleatorio() $M = Random(1, 100) If $M > 96 Then _ResourcePlaySound("TEST_WAV_3", 1) Sleep(10) EndIf If $M < 3 Then _ResourcePlaySound("TEST_WAV_2", 1) Sleep(10) EndIf EndFunc ;==>_aleatorio Func _aleatorio2() $M = Random(1, 100) If $M > 96 Then _ResourcePlaySound("TEST_WAV_4", 1) Sleep(10) EndIf If $M < 3 Then _ResourcePlaySound("TEST_WAV_2", 1) Sleep(10) EndIf EndFunc ;==>_aleatorio2 Func Cerrargui5() $DELAY = 0 EndFunc ;==>Cerrargui5 Func UpdateActiveColors2() $resolucionvertical = $altogui4 $resolucionhorizontal = $altogui4 * 1.33333 Global $coordenadasX = $resolucionhorizontal / 11 Global $coordenadasY = $resolucionvertical / 11 Global $var8 = PixelGetColor($coordenadasX * 4, $coordenadasY * 4) Global $var9 = PixelGetColor($coordenadasX * 4, $coordenadasY * 5) Global $var10 = PixelGetColor($coordenadasX * 4, $coordenadasY * 6) Global $var11 = PixelGetColor($coordenadasX * 4, $coordenadasY * 7) Global $var12 = PixelGetColor($coordenadasX * 4, $coordenadasY * 8) Global $var15 = PixelGetColor($coordenadasX * 5, $coordenadasY * 4) Global $var16 = PixelGetColor($coordenadasX * 5, $coordenadasY * 5) Global $var17 = PixelGetColor($coordenadasX * 5, $coordenadasY * 6) Global $var18 = PixelGetColor($coordenadasX * 5, $coordenadasY * 7) Global $var19 = PixelGetColor($coordenadasX * 5, $coordenadasY * 8) Global $var22 = PixelGetColor($coordenadasX * 6, $coordenadasY * 4) Global $var23 = PixelGetColor($coordenadasX * 6, $coordenadasY * 5) Global $var24 = PixelGetColor($coordenadasX * 6, $coordenadasY * 6) Global $var25 = PixelGetColor($coordenadasX * 6, $coordenadasY * 7) Global $var26 = PixelGetColor($coordenadasX * 6, $coordenadasY * 8) Global $var29 = PixelGetColor($coordenadasX * 7, $coordenadasY * 4) Global $var30 = PixelGetColor($coordenadasX * 7, $coordenadasY * 5) Global $var31 = PixelGetColor($coordenadasX * 7, $coordenadasY * 6) Global $var32 = PixelGetColor($coordenadasX * 7, $coordenadasY * 7) Global $var33 = PixelGetColor($coordenadasX * 7, $coordenadasY * 8) Global $var36 = PixelGetColor($coordenadasX * 8, $coordenadasY * 4) Global $var37 = PixelGetColor($coordenadasX * 8, $coordenadasY * 5) Global $var38 = PixelGetColor($coordenadasX * 8, $coordenadasY * 6) Global $var39 = PixelGetColor($coordenadasX * 8, $coordenadasY * 7) Global $var40 = PixelGetColor($coordenadasX * 8, $coordenadasY * 8) EndFunc ;==>UpdateActiveColors2 Func CalculateRange2() Global $firstvar8 = $var8 + $range Global $lastvar8 = $var8 - $range Global $firstvar9 = $var9 + $range Global $lastvar9 = $var9 - $range Global $firstvar10 = $var10 + $range Global $lastvar10 = $var10 - $range Global $firstvar11 = $var11 + $range Global $lastvar11 = $var11 - $range Global $firstvar12 = $var12 + $range Global $lastvar12 = $var12 - $range Global $firstvar15 = $var15 + $range Global $lastvar15 = $var15 - $range Global $firstvar16 = $var16 + $range Global $lastvar16 = $var16 - $range Global $firstvar17 = $var17 + $range Global $lastvar17 = $var17 - $range Global $firstvar18 = $var18 + $range Global $lastvar18 = $var18 - $range Global $firstvar19 = $var19 + $range Global $lastvar19 = $var19 - $range Global $firstvar22 = $var22 + $range Global $lastvar22 = $var22 - $range Global $firstvar23 = $var23 + $range Global $lastvar23 = $var23 - $range Global $firstvar24 = $var24 + $range Global $lastvar24 = $var24 - $range Global $firstvar25 = $var25 + $range Global $lastvar25 = $var25 - $range Global $firstvar26 = $var26 + $range Global $lastvar26 = $var26 - $range Global $firstvar29 = $var29 + $range Global $lastvar29 = $var29 - $range Global $firstvar30 = $var30 + $range Global $lastvar30 = $var30 - $range Global $firstvar31 = $var31 + $range Global $lastvar31 = $var31 - $range Global $firstvar32 = $var32 + $range Global $lastvar32 = $var32 - $range Global $firstvar33 = $var33 + $range Global $lastvar33 = $var33 - $range Global $firstvar36 = $var36 + $range Global $lastvar36 = $var36 - $range Global $firstvar37 = $var37 + $range Global $lastvar37 = $var37 - $range Global $firstvar38 = $var38 + $range Global $lastvar38 = $var38 - $range Global $firstvar39 = $var39 + $range Global $lastvar39 = $var39 - $range Global $firstvar40 = $var40 + $range Global $lastvar40 = $var40 - $range EndFunc ;==>CalculateRange2 Func CheckForChange2() if ($var8 < $firstvar8 And $var8 > $lastvar8) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var9 < $firstvar9 And $var9 > $lastvar9) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var10 < $firstvar10 And $var10 > $lastvar10) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var11 < $firstvar11 And $var11 > $lastvar11) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var12 < $firstvar12 And $var12 > $lastvar12) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var15 < $firstvar15 And $var15 > $lastvar15) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var16 < $firstvar16 And $var16 > $lastvar16) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var17 < $firstvar17 And $var17 > $lastvar17) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var18 < $firstvar18 And $var18 > $lastvar18) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var19 < $firstvar19 And $var19 > $lastvar19) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var22 < $firstvar22 And $var22 > $lastvar22) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var23 < $firstvar23 And $var23 > $lastvar23) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var24 < $firstvar24 And $var24 > $lastvar24) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var25 < $firstvar25 And $var25 > $lastvar25) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var26 < $firstvar26 And $var26 > $lastvar26) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var29 < $firstvar29 And $var29 > $lastvar29) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var30 < $firstvar30 And $var30 > $lastvar30) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var31 < $firstvar31 And $var31 > $lastvar31) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var32 < $firstvar32 And $var32 > $lastvar32) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var33 < $firstvar33 And $var33 > $lastvar33) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var36 < $firstvar36 And $var36 > $lastvar36) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var37 < $firstvar37 And $var37 > $lastvar37) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var38 < $firstvar38 And $var38 > $lastvar38) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var39 < $firstvar39 And $var39 > $lastvar39) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var40 < $firstvar40 And $var40 > $lastvar40) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_3", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf EndFunc ;==>CheckForChange2 Func CheckForChange3() if ($var8 < $firstvar8 And $var8 > $lastvar8) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var9 < $firstvar9 And $var9 > $lastvar9) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var10 < $firstvar10 And $var10 > $lastvar10) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var11 < $firstvar11 And $var11 > $lastvar11) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var12 < $firstvar12 And $var12 > $lastvar12) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var15 < $firstvar15 And $var15 > $lastvar15) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var16 < $firstvar16 And $var16 > $lastvar16) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var17 < $firstvar17 And $var17 > $lastvar17) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var18 < $firstvar18 And $var18 > $lastvar18) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var19 < $firstvar19 And $var19 > $lastvar19) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var22 < $firstvar22 And $var22 > $lastvar22) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var23 < $firstvar23 And $var23 > $lastvar23) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var24 < $firstvar24 And $var24 > $lastvar24) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var25 < $firstvar25 And $var25 > $lastvar25) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var26 < $firstvar26 And $var26 > $lastvar26) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var29 < $firstvar29 And $var29 > $lastvar29) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var30 < $firstvar30 And $var30 > $lastvar30) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var31 < $firstvar31 And $var31 > $lastvar31) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var32 < $firstvar32 And $var32 > $lastvar32) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var33 < $firstvar33 And $var33 > $lastvar33) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var36 < $firstvar36 And $var36 > $lastvar36) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var37 < $firstvar37 And $var37 > $lastvar37) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var38 < $firstvar38 And $var38 > $lastvar38) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var39 < $firstvar39 And $var39 > $lastvar39) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf if ($var40 < $firstvar40 And $var40 > $lastvar40) Then UpdateActiveColors2() Else _ResourcePlaySound("TEST_WAV_4", 1) ;The "1" after the song makes the program doesn't stop executing VERY IMPORTANT!!!! UpdateActiveColors2() CalculateRange2() EndIf EndFunc ;==>CheckForChange3 ;~ if the random time is unchecked, then we use the input value * 60 (to pass from minutes to seconds) and we call this variable $Y If $STATE2 = "UNCHECK" Then Sleep(100) ; the countdown starts. Y value will be the waiting time in seconds $X = 0 $y = GUICtrlRead($input) * 60 $count = 0 $count2 = 0 $gui6 = GUICreate("Press Escape to close the program", $anchura, $altura - 50, -1, 0) $DELAY = $RTR * 60 $XX = 0 $message5 = "" $label5 = GUICtrlCreateLabel($message5, 15, 0, 640, 470, $SS_CENTER) GUICtrlSetFont(-1, 90, 700, 0, "MS Sans Serif") GUISetState(@SW_SHOW) GUISetBkColor(0xFFCC66, $gui6) Opt("GUIOnEventMode", 1) GUISetOnEvent($GUI_EVENT_CLOSE, "Cerrargui5") Opt("GUICloseOnESC", 1) While $DELAY > $XX $message5 = StringFormat("%02d:%02d\n", Mod(Floor($DELAY / 60), 60), Mod($DELAY, 60)) ControlSetText("Press Escape to close the program", "", "Static1", $message5) Sleep(1000) $DELAY = $DELAY - 1 _BatteryQueryEx() WEnd $message = "" GUICtrlCreateLabel($message, 5, 0, 640, 470, $SS_CENTER) GUICtrlSetFont(-1, 90, 700, 0, "MS Sans Serif") GUISetBkColor(0xFF0033, $gui6) Opt("GUIOnEventMode", 1) GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") Opt("GUICloseOnESC", 1) While $y > $X If $STATE3 = "CHECK" And GUICtrlRead($Radio1) = $GUI_CHECKED Then _castigo() EndIf If $STATE3 = "CHECK" And GUICtrlRead($Radio2) = $GUI_CHECKED Then _castigo2() EndIf If $STATE15 = "CHECK" And GUICtrlRead($Radio1) = $GUI_CHECKED Then UpdateActiveColors2() CalculateRange2() CheckForChange2() EndIf If $STATE15 = "CHECK" And GUICtrlRead($Radio2) = $GUI_CHECKED Then UpdateActiveColors2() CalculateRange2() CheckForChange3() EndIf $mciError = _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, 0) If $mciError[0] <> 0 Then _mciShowError($mciError[0]) $pedro2 = ($mciError[2]) * 0.78125 GUICtrlSetData($ProgressBar10, $pedro2) $message = StringFormat("%02d:%02d:%02d\n", Floor($y / 3600), Mod(Floor($y / 60), 60), Mod($y, 60)) ControlSetText("Press Escape to close the program", "", "Static1", $message) $pos = MouseGetPos() MouseMove($pos[0], $pos[1] + 1, 0) Sleep(500) $pos = MouseGetPos() MouseMove($pos[0], $pos[1] - 1, 0) Sleep(500) $y = $y - 1 _BatteryQueryEx() $count = $count + 1 If $STATE12 = "CHECK" Then $snapfile = @DesktopDir & "\Selfbondage Session" & "\Photo " & $count2 & ".bmp" photo($snapfile) EndIf If $STATE = "CHECK" Then Beep(600, 100) EndIf If $STATE4 = "CHECK" And GUICtrlRead($Radio1) = $GUI_CHECKED Then _aleatorio() EndIf If $STATE4 = "CHECK" And GUICtrlRead($Radio2) = $GUI_CHECKED Then _aleatorio2() EndIf WEnd Sleep(100) Beep(300, 20) Sleep(100) Beep(300, 20) Sleep(100) Beep(300, 20) Sleep(100) CDTray($U, "open") Sleep(300) CDTray($U, "open") Exit Else Sleep(100) ; Starts the countdown. Z value will be a number between Y (input)*60 and 30 $X = 0 $y = GUICtrlRead($input) * 60 $Z = Random(GUICtrlRead($inputrandom) * 60, GUICtrlRead($input) * 60, 1) $count = 0 $count2 = 0 $message = "" $gui6 = GUICreate("Press Escape to close the program", $anchura, $altura - 50, -1, 0) $DELAY = $RTR * 60 $XX = 0 $message5 = "" $label5 = GUICtrlCreateLabel($message5, 15, 0, 640, 470, $SS_CENTER) GUICtrlSetFont(-1, 90, 700, 0, "MS Sans Serif") GUISetBkColor(0xFFCC66, $gui6) GUISetState(@SW_SHOW) Opt("GUIOnEventMode", 1) GUISetOnEvent($GUI_EVENT_CLOSE, "Cerrargui5") Opt("GUICloseOnESC", 1) While $DELAY > $XX $message5 = StringFormat("%02d:%02d\n", Mod(Floor($DELAY / 60), 60), Mod($DELAY, 60)) ControlSetText("Press Escape to close the program", "", "Static1", $message5) Sleep(1000) $DELAY = $DELAY - 1 _BatteryQueryEx() WEnd GUICtrlCreateLabel($message, 10, 0, 640, 470, $SS_CENTER) GUICtrlSetFont($gui6, 90, 700, 0, "Symbol") GUISetBkColor(0xFF0033, $gui6) Opt("GUIOnEventMode", 1) GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") Opt("GUICloseOnESC", 1) While $Z > $X If $STATE3 = "CHECK" And GUICtrlRead($Radio1) = $GUI_CHECKED Then _castigo() EndIf If $STATE3 = "CHECK" And GUICtrlRead($Radio2) = $GUI_CHECKED Then _castigo2() EndIf If $STATE15 = "CHECK" And GUICtrlRead($Radio1) = $GUI_CHECKED Then UpdateActiveColors2() CalculateRange2() CheckForChange2() EndIf If $STATE15 = "CHECK" And GUICtrlRead($Radio2) = $GUI_CHECKED Then UpdateActiveColors2() CalculateRange2() CheckForChange3() EndIf If $STATE12 = "CHECK" Then $snapfile = @DesktopDir & "\Selfbondage Session" & "\Photo " & $count2 & ".bmp" photo($snapfile) EndIf $mciError = _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, 0) If $mciError[0] <> 0 Then _mciShowError($mciError[0]) $pedro2 = ($mciError[2]) * 0.78125 GUICtrlSetData($ProgressBar10, $pedro2) $message = $Alien4 & $Alien5 & $Alien6 & $Alien7 ControlSetText("Press Escape to close the program", "", "Static1", $message) $pos = MouseGetPos() MouseMove($pos[0], $pos[1] + 1, 0) Sleep(500) $pos = MouseGetPos() MouseMove($pos[0], $pos[1] - 1, 0) Sleep(500) $Z = $Z - 1 _BatteryQueryEx() $count = $count + 1 $Alien1=Random(33,64,1) $Alien2=Random(33,64,1) $Alien3=Random(33,64,1) $Alien4=Random(33,64,1) $Alien4=Chr($Alien1) $Alien5=Chr($Alien2) $Alien6=Chr($Alien3) $Alien7=Chr($Alien4) If $STATE = "CHECK" Then Beep(600, 100) EndIf If $STATE4 = "CHECK" And GUICtrlRead($Radio1) = $GUI_CHECKED Then _aleatorio() EndIf If $STATE4 = "CHECK" And GUICtrlRead($Radio2) = $GUI_CHECKED Then _aleatorio2() EndIf WEnd Sleep(100) Beep(300, 20) Sleep(100) Beep(300, 20) Sleep(100) Beep(300, 20) Sleep(100) CDTray($U, "open") Sleep(300) CDTray($U, "open") Exit EndIf Func photo($snapfile) GUICtrlRead($count) GUICtrlRead($count2) If $count > 60 Then DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $snapfile) $count = 0 $count2 = $count2 +1 EndIf EndFunc ;==>photo Exit