Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Аватара для Creat0R

Must AutoIt


Сообщения: 3054
Благодарности: 1009

Профиль | Сайт | Отправить PM | Цитировать


Имитация телефонного звонка:

Код: Выделить весь код
HotKeySet("{Esc}", "Quit")

_PhoneRing(8)

;===============================================================================
;
; Function Name:    _PhoneRing()
; Description:      Beep Sound Imitation of Phone Rings.
; Parameter(s):     $iRings [Optional] - Rings to beep (5 is the default),
;                       If $iRings > 0 Then this time of rings will be sounded.
;                       If $iRings < 0 Then number after - sign will be used to indicate how long (seconds) the function will ring.
;                       If $iRings = 0 Then the function will ring (loop) forever :)
;                   $iDuration [Optional] - Duration of the Ring to beep (15 is the default).
;                   $iWait - [Optional] How long to wait between each rings in milleseconds (1500 is the default).
;
; Return Value(s):  Always returns 1 regardless of success.
; Requirement(s):   None.
; Author(s):        G.Sandler (a.k.a CreatoR).
;
;===============================================================================
Func _PhoneRing($iRings=5, $iDuration=15, $iWait=1500)
    Local $iCount = 0, $iTimerInit = TimerInit()
    While 1
        $iCount += 1

        For $i = 1 To $iDuration
            Beep(1000, 35)
            Beep(2000, 30)
            Beep(1500, 25)
        Next

        If $iRings > 0 And $iCount = $iRings Then Return 1
        If $iRings < 0 And TimerDiff($iTimerInit) / 1000 >= -$iRings Then Return 1

        Sleep($iWait)
    WEnd
EndFunc

Func Quit()
    Exit
EndFunc

-------
“Сделай так просто, как возможно, но не проще этого.”... “Ты никогда не решишь проблему, если будешь думать так же, как те, кто её создал.”

Альберт Эйнштейн

P.S «Не оказываю техподдержку через ПМ/ICQ, и по email - для этого есть форум. ©»

http://creator-lab.ucoz.ru/Images/Icons/autoit_icon.png Русское сообщество AutoIt | http://creator-lab.ucoz.ru/Images/Ic...eator_icon.png CreatoR's Lab | http://creator-lab.ucoz.ru/Images/Icons/oac_icon.png Opera AC Community


Отправлено: 01:14, 20-11-2007 | #739