|
简易闹钟
//〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓简易闹铃,纯属娱乐〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓 //设置完毕后F10启动即可,按↑↓键调节音量。 //闹铃响后按F12关闭铃声结束程序 //按其他键关闭铃声,到达设定的时间后重新响铃提醒 //〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓 UserVar sound1=8 "设置默认音量" UserVar plan="06:19:00" "设置闹铃时间" UserVar wc=10 "设置允许闹铃时间误差建议最小设为5秒" UserVar remind=1 "设置关上铃声多少分钟后重新提醒" UserVar path="E:\音乐\DIR0.MP3\FIL31.MP3" "设置闹铃音乐完整路径" DimEnv sound sound=int(sound1) Call Plugin.Media.Vol(sound) BeginThread 调节音量 While time<DateAdd("s",-1*int(wc),cdate(plan)) or time>DateAdd("s",int(wc),cdate(plan)) For 1000 Delay wc Next Wend Call Plugin.Media.Play(path) While 1 key = WaitKey If key<>38 and key<>40 Call Plugin.Media.Stop() t0=now While datediff("n",t0,now)<remind For 1000 Delay 30 Next Wend Call Plugin.Media.Play(path) End If Wend Sub OnScriptExit Call Plugin.Media.Stop() End Sub Sub 调节音量 While 1 key = WaitKey If key=38 and sound>1 sound=sound-1 ElseIf key=40 and sound<99 sound=sound+1 End If Call Plugin.Media.Vol(sound) Wend End Sub
|
|