自己写的一个固话自动拨号程序,分享出来

众所周知, 固话是可以通过音频实现拨号的

也就是说,固定电话,拨打号码的时候,可以通过播放固定音频,实现拨号的目的(注意,音频文件需要外加 )

; 设置使用哪种音频
hz8 := A_ScriptDir "Music8hz" 
hz16 := A_ScriptDir "Music16hz" 
hz441 := A_ScriptDir "Music441hz" 
music_dir := hz441    ;使用8hz的音频
;播号的音量
volume_call := 35
; 播号完毕,音量静音还是恢复播号前的状态,0恢复原状态,1静音
mute_status := 1




`::
;判断单双击
if pressesCount > 0 ; >0说明SetTimer 已经启动了,按键次数递增
{
    pressesCount += 1
    return
}
else
{
    ;否则,这是新一系列按键的首次按键。将计数设重置为 1 ,并启动定时器:
    pressesCount = 1
    SetTimer, WaitKey, 1000 ;在 1秒内等待更多的按键。
    return
}


;判断单双击
WaitKey:
    SetTimer, WaitKey, off
    ;拨打电话
    if pressesCount = 1 ;该键已按过一次。
    {
        pressesCount:=0
        add0 := ""
    }
    else if pressesCount = 2 ;该键已按过两次。
    {
        pressesCount:=0
        add0 := 0
    }



;处理电话
send ^c
sleep 200
phone = %clipboard%
A := ""
Loop, Parse, phone   ;处理成全数字
{
    if A_LoopField is integer
    {
        A := A A_LoopField
    }
}
;判断是否为电话号
len := StrLen(A)
if (len<7)or(len>12)
{
    suspend On
    send ``
    suspend Off
    Exit
}   

MouseGetPos, MouseX, MouseY
if add0!=0
{
    ToolTip, 3 秒后播号【广州号不加0】`n %A%, MouseX+10, MouseY
}
else{
    ToolTip, 3 秒后播号【其他地区加0】`n %A%, MouseX+10, MouseY
}
sleep 3000
ToolTip
Gosub call_phone
Exit


;打电话
call_phone:
    phone := 7 add0 A
    ;获取当前音量
    SoundGet, master_volume
    sound_befor := Round(master_volume)
    ;设置音量为 25%
    SoundGet, iSmute, , mute
    if (iSmute!="Off")
        SoundSet, +1, , mute
    SoundSet,%volume_call% ; 主音量设置
    SoundGet, master_volume
    ;MsgBox, %master_volume%  %iSmute%  %phone%

    ;创建声音文件字典
    f_dict := {0:"0.wav",1:"1.wav",2:"2.wav",3:"3.wav",4:"4.wav",5:"5.wav",6:"6.wav",7:"7.wav",8:"8.wav",9:"9.wav"}

    ;遍历电话号
    Loop, Parse, phone
    {
        if f_dict.HasKey(A_LoopField)
        {
            f_name := f_dict[A_LoopField]
            SoundPlay, %music_dir%%f_name%  , Wait
        }
        else
            ToolTip, 缺失 %A_LoopField% 
    }


    if (mute_status=1)
    {
        SoundSet, 0
        SoundSet, +1, , mute
        ToolTip    
    }
    else
    {
        SoundSet, %sound_befor%
        ToolTip    
    }

Esc::Reload

给TA捐赠
共{{data.count}}人
人已捐赠
其他应用教程

L版本实现多线程找图

2021-6-26 18:49:11

其他教程

如何检查字符串(元素)是否包含在AutoHotKey中的数组中(How to check if string is contained in an array in AutoHotKey)

2021-7-13 16:41:17

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
有新私信 私信列表
搜索