Sign in to follow this  
Followers 0
somdcomputerguy

X-Lorem Ipsum

2 posts in this topic

#1 ·  Posted (edited)

This script is basically just two timers, after one it stops Winamp's playback, after the other it starts Winamp's playback. So the GUI has three tabs, Lullaby - a 'countdown' type of timer, Wakeup - an 'alarmclock' type of timer, and the third tab, Info, which has a incomplete progress bar. This progress bar was in an earlier version of this script, turned into non graphical data on a new Info tab, and then birthed a progess bar onto this tab, and it only works right now for 3/4 of the Lullaby countdown. This script is always under development (read: always getting closer to working right all the time..), but for the most part this version works, and while the code may be sloppy and not commented well, I hope that this code is useful to someone here. Useful as an actual program, useful codewise as a tutorial or something, or whatever. This script now has it's own webpage! I put a compiled script on somebody else's Win7 PC to see if it worked. It did, he liked it, so I left it on there for him to use. A friend of his saw it, so he called me and asked if he could email it to someone else. I said sure. So I know that there's at least two other people that find use for this. So I thought this script deserved a webpage. I don't pay myself well enough to make this script into the next 'killer app' or turn the webpage into some kind of awesome shrine or something, but this script (and now the webpage) will slowly get better and better. Remember, slowly. S - L - O...

If this code raises any questions, I'll do my best to answer them or defend myself. If anybody actually uses this, I would be happy to receive some feedback/suggestions.

The 'Wakeup' part works only with Winamp. The Lullaby part will shutdown the PC or close another window as well as the Winamp stuff.<br>

<br>#include &lt;Misc.au3&gt;<br><br>Sleep(250)<br><br>If _Singleton("X-Lorem Ipsum",1) = 0 Then<br>&nbsp;&nbsp;&nbsp; Msgbox(0,"Warning","An occurence of X-Lorem Ipsum is already running", 3)<br>&nbsp;&nbsp;&nbsp; Exit<br>EndIf<br><br>#include &lt;File.au3&gt;<br>#include &lt;Date.au3&gt;<br>#include &lt;String.au3&gt;<br>#include &lt;GuiTab.au3&gt;<br>#include &lt;Constants.au3&gt;<br>#include &lt;EditConstants.au3&gt;<br>#include &lt;Winamp_Library.au3&gt; ; http://www.autoitscript.com/forum/topic/71187-winamp-library-on-pure-autoit/<br>#include &lt;GUIConstantsEx.au3&gt;<br>#include &lt;ComboConstants.au3&gt;<br>#include &lt;SliderConstants.au3&gt;<br>#include &lt;ButtonConstants.au3&gt;<br>#include &lt;WindowsConstants.au3&gt;<br>#include &lt;ProgressConstants.au3&gt;<br>#include &lt;DateTimeConstants.au3&gt;<br><br>#Region ### START Opts and Declarations section ###<br>Opt("TrayMenuMode", 3)<br>Opt("SendKeyDelay", 150)<br>;Opt("TrayIconDebug", 1)<br>Opt("MouseCoordMode", 2)<br>Opt("GUIOnEventMode", 1)<br>Opt("TrayOnEventMode", 1)<br>Opt("MustDeclareVars", 1)<br>Opt("WinTitleMatchMode", 2)<br><br>Local $TrayToggleHide, $TrayRestart, $TrayExit, $TrayToggleHotKey<br>Local $Form, $Tab, $Tab0, $Tab1, $Tab2, $Tab2_Label1, $Tab2_Label2, $Tab2_Label3, $Tab2_Label4, $Tab2_Label5, $Tab2_Label6, $Tab2_Label7, $Tab2_Label8<br>Global $Input_PlaylistorFile, $Input_Snooze, $Input_Time, $Input_Title<br>Global $Combo_WinAmpStop, $Combo_Shutdown, $Combo_TimeFrame, $Combo_WinAmpStart<br>Global $Slider_Fadein_Time, $Slider_Fadein_Time_Value, $Old_Slider1_Value, $Slider_MaxVol, $Slider_MaxVol_Value, $Old_Slider2_Value<br>Global $Button_Begin, $Button_GetTitle, $Button_Pick, $Button_Random, $Progressbar<br>Global $Countdown, $CountdownTotal, $CountdownToDate, $CurrentVolume, $MaxVolume<br>Global $SelectedSong, $FadeTime, $CountdownTime, $Input_AlarmTime, $AlarmTimeData, $FileList, $RandomFile, $Folder<br>Global $IniFile = @ScriptDir &amp; "\X-Lorem.ini"<br>Global $RndORSel, $MusicPath, $Restart, $MouPos, $HotKeyAble = 1, $Checkbox_Fade<br>#EndRegion ### END Opts and Declarations section ###<br><br>#Region ### START HotKeySet and INI section ###<br>HotKeySet("{F2}", "VolUpDownMute") ;ToggleMute<br>HotKeySet("{F3}", "VolUpDownMute") ;VolDown<br>HotKeySet("{F4}", "VolUpDownMute") ;VolUp<br>HotKeySet("{F10}", "ToggleHide")<br><br>$AlarmTimeData = IniRead($IniFile, "Alarm Time", "AlarmTime", @HOUR &amp; ":" &amp; @MIN)<br>$MouPos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = StringSplit(IniRead($IniFile, "XLorem Position", "XPos", 10 &amp; "," &amp; 535), ",")<br>#EndRegion ### END HotKeySet and INI section section ###<br><br>#Region ### START Koda GUI section ### Form=C:\Program Files\AutoIt3\koda\Forms\LoremIpsum.kxf<br><br>If $MouPos[0] &amp; ", " &amp; $MouPos[1] &lt;&gt; "15, " &amp; @DesktopHeight - 275 And StringIsDigit($MouPos[0]) And StringIsDigit($MouPos[1]) Then<br>&nbsp;&nbsp;&nbsp; $Form = GUICreate("X-Lorem Ipsum", 450, 200, $MouPos[1], $MouPos[2], Default, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)<br>Else<br>&nbsp;&nbsp;&nbsp; $Form = GUICreate("X-Lorem Ipsum", 450, 200, 15, @DesktopHeight - 275, Default, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)<br>EndIf<br>&nbsp;GUISetOnEvent($GUI_EVENT_CLOSE, "Quit")<br>&nbsp;GUISetIcon("1998_low_cost_clock.ico")<br>&nbsp;GUISetBkColor(0xc0c0c0)<br>$Tab = GUICtrlCreateTab(-1, -1, 450, 200)<br>&nbsp;GUICtrlSetResizing($Tab, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)<br>;<br>$Tab0 = GUICtrlCreateTabItem("Lullaby")<br>$Combo_WinAmpStop = GUICtrlCreateCombo(" WinAmp ", 15, 40, 115, 20)<br>&nbsp;GUICtrlSetData($Combo_WinAmpStop, "&nbsp; Just Stop |&nbsp; Stop-n-Play |&nbsp; Stop When Done |&nbsp; End Program ")<br>&nbsp;GUICtrlSetTip($Combo_WinAmpStop, " Just Stop " &amp; @LF &amp; " Stop-n-Play - Stop playing, go right to Wakeup " &amp; @LF &amp; " Stop When Done - Stop after the current song ends " &amp; @LF &amp;&nbsp; " End Program ", " How To Stop Winamp.. ", 1)<br>&nbsp;GUICtrlSetOnEvent($Combo_WinAmpStop, "CheckWinampStop")<br>$Combo_TimeFrame = GUICtrlCreateCombo(" Lullaby Time ", 170, 40, 115, 20)<br>&nbsp;GUICtrlSetData($Combo_TimeFrame, " Specific Time | Hour.Hour | Hour,Minute | Minute ")<br>&nbsp;GUICtrlSetOnEvent($Combo_TimeFrame, "CheckTimeCombo")<br>&nbsp;GUICtrlSetTip($Combo_TimeFrame, " Specific Time - 4:20 " &amp; @LF &amp; " Hour.Hour - 2.5 - 2 hours 30 minutes " &amp; @LF &amp; " Hour,Minute - 2,30 - 2 hours 30 minutes " &amp; @LF &amp; " Minute - 150 - 2 hours 30 minutes ", " Lullaby Time ", 1)<br>$Input_Time = GUICtrlCreateInput("", 340, 40, 65, 25, $ES_CENTER)<br>&nbsp;GUICtrlSetState($Input_Time, $GUI_DISABLE)<br>$Combo_Shutdown = GUICtrlCreateCombo(" Shutdown Options ", 100, 75, 200, 20)<br>&nbsp;GUICtrlSetData($Combo_Shutdown, "&nbsp; Lock&nbsp; |&nbsp; Standby&nbsp; |&nbsp; Hibernate&nbsp; |&nbsp; Reboot&nbsp; |&nbsp; Shutdown")<br>&nbsp;GUICtrlSetTip($Combo_Shutdown, "&nbsp; Lock&nbsp; " &amp; @LF &amp; "&nbsp; Standby&nbsp; " &amp; @LF &amp; "&nbsp; Hibernate&nbsp; " &amp; @LF &amp; "&nbsp; Reboot&nbsp; " &amp; @LF &amp; "&nbsp; Shutdown ", " Shutdown Options ", 1)<br>$Input_Title = GUICtrlCreateInput("Close Title", 100, 115, 250, 25, $ES_CENTER)<br>&nbsp;GUICtrlSetState($Input_Title, $GUI_DISABLE)<br>$Button_GetTitle = GUICtrlCreateButton("Title", 20, 115, 60, 25)<br>&nbsp;GUICtrlSetOnEvent($Button_GetTitle, "GetTitle")<br>$Button_Begin = GUICtrlCreateButton("Begin", 170, 160, 100, 25)<br>&nbsp;GUICtrlSetOnEvent($Button_Begin, "Lullaby")<br>$Checkbox_Fade = GUICtrlCreateCheckbox("Fade", 90, 160, 60, 20)<br>;<br>$Tab1 = GUICtrlCreateTabItem("Wakeup")<br>$Combo_WinAmpStart = GUICtrlCreateCombo(" WinAmp ", 190, 35, 115, 20)<br>&nbsp;GUICtrlSetData($Combo_WinAmpStart, "&nbsp; Start Playing |&nbsp; Select |&nbsp; Random ")<br>&nbsp;GUICtrlSetOnEvent($Combo_WinAmpStart, "CheckStartCombo")<br>#cs<br>$Checkbox_Winamp_Wakeup = GUICtrlCreateCheckbox("Winamp", 190, 35, 85, 20)<br>&nbsp;GUICtrlSetOnEvent($Checkbox_Winamp_Wakeup, "Highlander")<br>$Checkbox_Direct = GUICtrlCreateCheckbox(" Direct", 190, 55, 85, 20)<br>&nbsp;GUICtrlSetOnEvent($Checkbox_Direct, "Highlander")<br>$Button_Pick = GUICtrlCreateButton("Pick", 298, 30, 40, 20)<br>&nbsp;GUICtrlSetOnEvent($Button_Pick, "PickMusic")<br>$Button_Random = GUICtrlCreateButton("Random", 285, 60, 65, 20)<br>&nbsp;GUICtrlSetOnEvent($Button_Random, "RndMusic")<br>#ce<br>$Button_Begin = GUICtrlCreateButton("Begin", 170, 160, 100, 25)<br>&nbsp;GUICtrlSetOnEvent($Button_Begin, "Lullaby")<br>$Input_AlarmTime = GUICtrlCreateInput($AlarmTimeData, 158, 125, 65, 25, $ES_CENTER)<br>&nbsp;GUICtrlSetState($Input_AlarmTime, $GUI_DISABLE)<br>&nbsp;GUICtrlSetOnEvent($Input_AlarmTime, "WriteAlarmTime")<br>&nbsp;GUICtrlCreateLabel("Wakeup", 100, 126)<br>$Input_PlaylistorFile = GUICtrlCreateInput("Playlist or File", 85, 90, 275, 25, $ES_CENTER)<br>&nbsp;GUICtrlSetState($Input_PlaylistorFile, $GUI_DISABLE)<br>$Input_Snooze = GUICtrlCreateInput(IniRead($IniFile, "Snooze Time", "SnoozeTime", 9), 285, 125, 25, 25, $ES_CENTER)<br>&nbsp;GUICtrlSetState($Input_Snooze, $GUI_DISABLE)<br>&nbsp;GUICtrlSetOnEvent($Input_Snooze, "WriteSnoozeTime")<br>&nbsp;GUICtrlCreateLabel("Snooze", 230, 126)<br>&nbsp;GUICtrlCreateLabel("Minute(s)", 315, 126)<br>$Slider_Fadein_Time = GUICtrlCreateSlider(10, 55, 15, 85, $TBS_VERT)<br>&nbsp;GUICtrlCreateLabel("Fade In Time", 10, 35)<br>&nbsp;GUICtrlSetOnEvent($Slider_Fadein_Time, "Update_FadeInTime")<br>&nbsp;GUICtrlSetLimit($Slider_Fadein_Time, 20, 0)<br>&nbsp;GUICtrlSetData($Slider_Fadein_Time, IniRead($IniFile, "Levels", "FadeInTime", 5))<br>$Slider_Fadein_Time_Value = GUICtrlCreateLabel(GUICtrlRead($Slider_Fadein_Time), 135, 35)<br>$Slider_MaxVol = GUICtrlCreateSlider(40, 80, 15, 85, $TBS_VERT)<br>&nbsp;GUICtrlCreateLabel("Max Volume", 40, 60)<br>&nbsp;GUICtrlSetOnEvent($Slider_MaxVol, "Update_MaxVolume")<br>&nbsp;GUICtrlSetLimit($Slider_MaxVol, 100, 0)<br>&nbsp;GUICtrlSetData($Slider_MaxVol, IniRead($IniFile, "Levels", "MaxVolume", 85))<br>$Slider_MaxVol_Value = GUICtrlCreateLabel(GUICtrlRead($Slider_MaxVol), 145, 60)<br>$Checkbox_Fade = GUICtrlCreateCheckbox("Fade", 90, 160, 60, 20)<br>;<br>$Tab2 = GUICtrlCreateTabItem("Info")<br>;$Tab2_Label1 = GUICtrlCreateLabel("[Ctrl+Alt]+ESC - Quit", 10, 25)<br>$Tab2_Label3 = GUICtrlCreateLabel("SPACE - 1x -&gt; Snooze&nbsp;&nbsp; 2x -&gt; Restart" &amp; @LF &amp; @LF &amp; "F2/F3/F4 - Volume Mute/Down/Up" &amp; @LF &amp; "F10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Window Show/Hide", 10, 95)<br>;$Tab2_Label2 = GUICtrlCreateLabel("F2/F3/F4 - Volume Mute/Down/Up", 10, 73)<br>;$Tab2_Label4 = GUICtrlCreateLabel("F10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Window Show/Hide", 10, 93)<br>$Tab2_Label5 = GUICtrlCreateLabel("Text", 10, 35, 500)<br>;$Tab2_Label6 = GUICtrlCreateLabel("Hr.Hr&nbsp; (1.5 = 1 Hour and 30 Minutes)" &amp; @LF &amp; "Hr,Min (1,5 = 1 Hour and 5 Minutes)", 10, 130)<br>$Tab2_Label7 = GUICtrlCreateLabel(" &gt;-&nbsp; Enabled", 242, 135)<br>$Tab2_Label8 = GUICtrlCreateLabel("&nbsp; -&nbsp; Not Enabled", 245, 95)<br>$Progressbar = GUICtrlCreateProgress(50, 60, 335, 22, -1, $PBS_SMOOTH)<br>&nbsp;GUICtrlSetColor($Progressbar, 0x00ff00)<br>;<br>GUICtrlCreateTabItem("")<br>GUISetState(@SW_SHOW)<br>#EndRegion ### END Koda GUI section ###<br><br>#Region ### START Tray section ###<br>$TrayToggleHide = TrayCreateItem("Show/Hide")<br>&nbsp;TrayItemSetOnEvent(-1, "ToggleHide")<br>$TrayToggleHotKey = TrayCreateItem("Disable Hotkeys")<br>&nbsp;TrayItemSetOnEvent(-1, "ToggleHotKey")<br>$TrayRestart = TrayCreateItem("Restart")<br>&nbsp;TrayItemSetOnEvent(-1, "Restart")<br>$TrayExit&nbsp;&nbsp;&nbsp; = TrayCreateItem("Exit")<br>&nbsp;TrayItemSetOnEvent(-1, "Quit")<br>;<br>TraySetState()<br>TraySetClick(9)<br>TraySetIcon(@ScriptDir &amp; "\1998_low_cost_clock.ico")<br>TraySetToolTip("X-Lorem Ipsum - Click here for the menu..")<br>TraySetOnEvent($TRAY_EVENT_MOUSEOVER,"MouseOverTray")<br>#EndRegion ### END Tray section ###<br><br>While 1<br>&nbsp;&nbsp;&nbsp; Sleep(100)<br>WEnd<br><br>Func Lullaby()<br>&nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_WinAmpStop) = "&nbsp; Stop-n-Play " And GUICtrlRead($Combo_WinAmpStart) = " WinAmp " Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MsgBox(0, "", "You must select a startup thing too you know..")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Restart()<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; ControlClick("X-Lorem Ipsum", "", "SysTabControl321", "left", 1, 135, 10)<br>&nbsp;&nbsp;&nbsp; If GUICtrlRead($Checkbox_Fade) = $GUI_CHECKED Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; For $iTransValue = 250 To 5 Step -15<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WinSetTrans("X-Lorem Ipsum", "", $iTransValue)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep(10)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Next<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WinSetState("X-Lorem Ipsum", "", @SW_HIDE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WinSetTrans("X-Lorem Ipsum", "", 255)<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; Local $TimeFraction, $ConvertedHour, $ConvertedMinutes, $Timesplit<br>&nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_TimeFrame) &lt;&gt; " Lullaby Time " Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Switch GUICtrlRead($Combo_TimeFrame)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case " Hour.Hour "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If StringInStr(GUICtrlRead($Input_Time), ".") Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $TimeFraction = StringSplit(GUICtrlRead($Input_Time), ".")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $CountdownToDate = _DateAdd('n', (60 * $TimeFraction[1]) + ((60 * $TimeFraction[2]) / 10), _NowCalc())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "$Input_Time - " &amp;&nbsp; GUICtrlRead($Input_Time) &amp; " Hour.Hour - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;MsgBox(0, "", "$Input_Time - " &amp;&nbsp; GUICtrlRead($Input_Time) &amp; " Hour.Hour" &amp; @LF &amp; "$TimeFraction[1] - " &amp; $TimeFraction[1] &amp; @LF &amp; "$TimeFraction[2] - " &amp; $TimeFraction[2] &amp; @LF &amp; $CountdownToDate &amp; @LF)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $CountdownToDate = _DateAdd('h', GUICtrlRead($Input_Time), _NowCalc())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "$Input_Time - " &amp;&nbsp; GUICtrlRead($Input_Time) &amp; " Hour.Hour - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;MsgBox(0, "", "$Input_Time - " &amp;&nbsp; GUICtrlRead($Input_Time) &amp; @LF &amp; $CountdownToDate &amp; @LF)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case " Hour,Minute "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If StringInStr(GUICtrlRead($Input_Time), ",") Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $TimeFraction = StringSplit(GUICtrlRead($Input_Time), ",")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $CountdownToDate = _DateAdd('n', (60 * $TimeFraction[1]) + $TimeFraction[2], _NowCalc())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "$Input_Time - " &amp;&nbsp; GUICtrlRead($Input_Time) &amp; " Hour,Minute - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;MsgBox(0, "", "$Input_Time - " &amp;&nbsp; GUICtrlRead($Input_Time) &amp; " Hour,Minute" &amp; @LF &amp; "$TimeFraction[1] - " &amp; $TimeFraction[1] &amp; @LF &amp; "$TimeFraction[2] - " &amp; $TimeFraction[2] &amp; @LF &amp; $CountdownToDate &amp; @LF)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $CountdownToDate = _DateAdd('h', GUICtrlRead($Input_Time), _NowCalc())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "$Input_Time - " &amp;&nbsp; GUICtrlRead($Input_Time) &amp; " Hour,Minute - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;MsgBox(0, "", "$Input_Time - " &amp;&nbsp; GUICtrlRead($Input_Time) &amp; @LF &amp; $CountdownToDate &amp; @LF)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case " Minute "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If StringInStr(GUICtrlRead($Input_Time), ".") Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $TimeFraction = StringSplit(GUICtrlRead($Input_Time), ".")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $CountdownToDate = _DateAdd('s', (60 * $TimeFraction[1]) + ((60 * $TimeFraction[2]) / 10), _NowCalc())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "$Input_Time - " &amp;&nbsp; GUICtrlRead($Input_Time) &amp; " Minute - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;MsgBox(0, "", "$Input_Time - " &amp;&nbsp; GUICtrlRead($Input_Time) &amp; " Minute" &amp; @LF &amp; "$TimeFraction[1] - " &amp; $TimeFraction[1] &amp; @LF &amp; "$TimeFraction[2] - " &amp; $TimeFraction[2] &amp; @LF &amp; $CountdownToDate &amp; @LF)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $CountdownToDate = _DateAdd('n', GUICtrlRead($Input_Time), _NowCalc())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, _NowCalc() &amp; " - " &amp; GUICtrlRead($Input_Time) &amp; " Minute - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;MsgBox(0, "", _NowCalc() &amp; @LF &amp; GUICtrlRead($Input_Time) &amp; @LF &amp; $CountdownToDate &amp; @LF)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case " Specific Time "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $Timesplit = StringSplit(Number(StringFormat("%04d",StringRegExpReplace(GUICtrlRead($Input_Time), "\D", ""))), "")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If StringInStr(GUICtrlRead($Input_Time), "p") Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Switch $Timesplit[0]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 3<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = $Timesplit[1] + 12<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedMinutes = $Timesplit[2] &amp; $Timesplit[3]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If $ConvertedHour = 24 Then $ConvertedHour = 00<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Lullaby Switch 3a, Waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 4<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If ($Timesplit[1] &amp; $Timesplit[2]) = 12 Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = $Timesplit[1] &amp; $Timesplit[2]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = ($Timesplit[1] &amp; $Timesplit[2]) + 12<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedMinutes = $Timesplit[3] &amp; $Timesplit[4]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If $ConvertedHour = 24 Then $ConvertedHour = 00<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Lullaby Switch 4a, Waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndSwitch<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Switch $Timesplit[0]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 3<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = $Timesplit[1]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedMinutes = $Timesplit[2] &amp; $Timesplit[3]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Lullaby Switch 3b, Waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 4<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If ($Timesplit[1] &amp; $Timesplit[2]) = 12 Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = 0<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = $Timesplit[1] &amp; $Timesplit[2]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedMinutes = $Timesplit[3] &amp; $Timesplit[4]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Lullaby Switch 4b, Waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndSwitch<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep(100)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Until $ConvertedHour &amp; $ConvertedMinutes = @Hour &amp; @Min<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #cs<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep(10)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Until Number(StringFormat("%04d",StringRegExpReplace(GUICtrlRead($Input_Time), "\D", ""))) = Number(@Hour &amp; @Min) ;http://www.autoitscript.com/forum/topic/123103-how-to-check-systemtime/page__view__findpost__p__855050<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #ce<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndSwitch<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_TimeFrame) &lt;&gt; " Specific Time " Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Local $DateDiffCalc = _DateDiff( 'n', _NowCalc(), $CountdownToDate)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Local $TotalDateDiffCalc = $DateDiffCalc<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Progressbar, ($DateDiffCalc / $TotalDateDiffCalc) * 100)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $DateDiffCalc = _DateDiff( 'n', _NowCalc(), $CountdownToDate)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If $DateDiffCalc &lt;&gt; $TotalDateDiffCalc Then GUICtrlSetData($Progressbar, ($DateDiffCalc / $TotalDateDiffCalc) * 100)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep(10)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;Until Number(StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3)) = @HOUR &amp; ":" &amp; @MIN<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Until $CountdownToDate &lt;= _NowCalc()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Progressbar, 0)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; RunAfterLullaby()<br>EndFunc&nbsp;&nbsp; ;==&gt;Lullaby<br><br>Func RunAfterLullaby()<br>&nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "NightNight..")<br>&nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; " WinAmp " Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Switch GUICtrlRead($Combo_WinAmpStop)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Just Stop "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_Stop()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Stop-n-Play "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WakeupNow()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Stop When Done "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ControlSend("Winamp", "", "", "^v")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; End Program "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_Close()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndSwitch<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; If GUICtrlRead($Input_Title) &lt;&gt; "Close Title" Then WinClose(GUICtrlRead($Input_Title))<br>&nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_Shutdown) &lt;&gt; " Shutdown Options " Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Switch GUICtrlRead($Combo_Shutdown)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Lock&nbsp; "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Run("rundll32.exe user32.dll, LockWorkStation")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Standby&nbsp; "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Shutdown(32)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Hibernate&nbsp; "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Shutdown(64)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Reboot&nbsp; "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Shutdown(18)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Shutdown&nbsp; "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Shutdown(13)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndSwitch<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; WaitforWakeup()<br>EndFunc&nbsp;&nbsp; ;==&gt;RunAfterLullaby<br><br>Func WaitforWakeup()<br>&nbsp;&nbsp;&nbsp; Local $ConvertedHour, $ConvertedMinutes, $Timesplit<br>&nbsp;&nbsp;&nbsp; ;ControlClick("X-Lorem Ipsum", "", "SysTabControl321", "left", 1, 75, 10)<br>&nbsp;&nbsp;&nbsp; $Timesplit = StringSplit(Number(StringFormat("%04d",StringRegExpReplace(GUICtrlRead($Input_AlarmTime), "\D", ""))), "")<br>&nbsp;&nbsp;&nbsp; If StringInStr(GUICtrlRead($Input_AlarmTime), "p") Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Switch $Timesplit[0]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 3<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = $Timesplit[1] + 12<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedMinutes = $Timesplit[2] &amp; $Timesplit[3]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If $ConvertedHour = 24 Then $ConvertedHour = 0<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Wakeup Case 3a, waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 4<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If ($Timesplit[1] &amp; $Timesplit[2]) = 12 Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = $Timesplit[1] &amp; $Timesplit[2]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = ($Timesplit[1] &amp; $Timesplit[2]) + 12<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedMinutes = $Timesplit[3] &amp; $Timesplit[4]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If $ConvertedHour = 24 Then $ConvertedHour = 0<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Wakeup Case 4a, waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndSwitch<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #cs<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep(100)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Until Number($ConvertedHour &amp; $ConvertedMinutes) = @Hour &amp; @Min<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #ce<br>&nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Switch $Timesplit[0]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 3<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = $Timesplit[1]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedMinutes = $Timesplit[2] &amp; $Timesplit[3]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Wakeup Case 3b, waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes &amp; "(" &amp; @HOUR &amp; ":" &amp; @MIN &amp; ")")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 4<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If ($Timesplit[1] &amp; $Timesplit[2]) = 12 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = 0<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedHour = $Timesplit[1] &amp; $Timesplit[2]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $ConvertedMinutes = $Timesplit[3] &amp; $Timesplit[4]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Wakeup Case 4b, waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndSwitch<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #cs<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep(100)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Until Number($ConvertedHour &amp; $ConvertedMinutes) = @Hour &amp; @Min<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #ce<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; Do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep(100)<br>&nbsp;&nbsp;&nbsp; Until $ConvertedHour &amp; $ConvertedMinutes = @Hour &amp; @Min<br>&nbsp;&nbsp;&nbsp; Sleep(100)<br>&nbsp;&nbsp;&nbsp; WakeupNow()<br>EndFunc&nbsp;&nbsp; ;==&gt;WaitforWakeup<br><br>Func WakeupNow()<br>&nbsp;&nbsp;&nbsp; If _Winamp_GetCurrentTrackPlayStatus() Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_Stop()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep(100)<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; HotKeySet("{SPACE}", "Snooze")<br>&nbsp;&nbsp;&nbsp; &nbsp;GUICtrlSetData($Tab2_Label8, " - Enabled") ;Spacebar (snooze)<br>&nbsp;&nbsp;&nbsp; &nbsp;GUICtrlSetData($Tab2_Label5, "Time to start..")<br>&nbsp;&nbsp;&nbsp; _Winamp_SetVolume(0)<br>&nbsp;&nbsp;&nbsp; If GUICtrlRead($Input_PlaylistorFile) &lt;&gt; "Playlist or File" Then ; Or GUICtrlRead($Input_PlaylistorFile) &lt;&gt; ""<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Switch $RndORSel<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 0 ;Pick<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_ClearPlayList()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_AddFile($SelectedSong)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_Play()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 1 ;Random<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_ClearPlayList()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_AddFile(StringReplace($MusicPath[0], ";", ":"))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_Play()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EndSwitch<br>&nbsp;&nbsp;&nbsp; ElseIf GUICtrlRead($Combo_WinAmpStart) = "&nbsp; Start Playing " Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_Play()<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; ;ControlClick("X-Lorem Ipsum", "", "SysTabControl321", "left", 1, 115, 10)<br>&nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Fade In..")<br>&nbsp;&nbsp;&nbsp; Fadein(GUICtrlRead($Slider_Fadein_Time), GUICtrlRead($Slider_MaxVol))<br>&nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Done for now..")<br>&nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label8, " - Disabled") ; Spacebar (snooze)<br>&nbsp;&nbsp;&nbsp; HotKeySet("{SPACE}")<br>EndFunc&nbsp;&nbsp; ;==&gt;WakeupNow<br><br>Func Fadein($FadeTime, $MaxVolume)<br>&nbsp;&nbsp;&nbsp; ; If the Main is muted, un-mute it<br>&nbsp;&nbsp;&nbsp; PixelSearch(1260, 780, 1275, 790, 0xFF0000)<br>&nbsp;&nbsp;&nbsp; If Not @error Then Send("{VOLUME_MUTE}")<br>&nbsp;&nbsp;&nbsp; ;<br>&nbsp;&nbsp;&nbsp; Switch @OSVersion<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "WIN_VISTA"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Run("sndvol.exe", "", @SW_HIDE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "WIN_XP"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Run("sndvol32.exe", "", @SW_HIDE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "WIN_7"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Run("sndvol.exe", "", @SW_HIDE)<br>&nbsp;&nbsp;&nbsp; EndSwitch<br>&nbsp;&nbsp;&nbsp; WinWaitActive("Volume Mixer")<br>&nbsp;&nbsp;&nbsp; ControlSend("Volume Mixer", "", "msctls_trackbar321", "{HOME}") ; Max system volume<br>&nbsp;&nbsp;&nbsp; WinClose("Volume Mixer")<br>&nbsp;&nbsp;&nbsp; If _Winamp_GetVolume() = 0 Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _Winamp_SetVolume(-1, 1)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep($FadeTime * 35)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $CurrentVolume = _Winamp_GetVolume()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Until $CurrentVolume / 255 * 100 &gt;= $MaxVolume<br>&nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MsgBox(0, "", ";==&gt;Fadein: Winamp has volume, Quitting Fadein.", 2)<br>&nbsp;&nbsp;&nbsp; EndIf<br>EndFunc&nbsp;&nbsp; ;==&gt;Fadein<br><br>Func Update_FadeInTime()<br>&nbsp;&nbsp;&nbsp; If GUICtrlRead($Slider_Fadein_Time) &lt;&gt; $Old_Slider1_Value Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Slider_Fadein_Time_Value, GUICtrlRead($Slider_Fadein_Time))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $Old_Slider1_Value = GUICtrlRead($Slider_Fadein_Time)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IniWrite($IniFile, "Levels", "FadeInTime", GUICtrlRead($Slider_Fadein_Time))<br>&nbsp;&nbsp;&nbsp; EndIf<br>EndFunc&nbsp;&nbsp; ;==&gt;Update_FadeInTime<br><br>Func Update_MaxVolume()<br>&nbsp;&nbsp;&nbsp; If GUICtrlRead($Slider_MaxVol) &lt;&gt; $Old_Slider2_Value Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Slider_MaxVol_Value, GUICtrlRead($Slider_MaxVol))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $Old_Slider2_Value = GUICtrlRead($Slider_MaxVol)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IniWrite($IniFile, "Levels", "MaxVolume", GUICtrlRead($Slider_MaxVol))<br>&nbsp;&nbsp;&nbsp; EndIf<br>EndFunc&nbsp;&nbsp; ;==&gt;Update_MaxVolume<br><br>Func VolUpDownMute()<br>&nbsp;&nbsp;&nbsp; Switch @HotKeyPressed<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "{F2}"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Send("{VOLUME_MUTE}")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "{F3}"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Send("{VOLUME_DOWN}")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "{F4}"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Send("{VOLUME_UP}")<br>&nbsp;&nbsp;&nbsp; EndSwitch<br>EndFunc<br><br>Func Snooze()<br>&nbsp;&nbsp;&nbsp; HotKeySet("{SPACE}", "Quit")<br>&nbsp;&nbsp;&nbsp; ;HotKeySet("{SPACE}", "Restart")<br>&nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label8, " - Snooze")<br>&nbsp;&nbsp;&nbsp; Local $SnoozeTime = Number(GUICtrlRead($Input_Snooze))<br>&nbsp;&nbsp;&nbsp; Local $SnoozeTill = _DateAdd('n', $SnoozeTime, _NowCalc())<br>&nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label5, "Snoozing for " &amp; $SnoozeTime &amp; " minutes, since " &amp; @HOUR &amp; ":" &amp; @MIN &amp; ", to " &amp; StringTrimLeft(StringTrimRight($SnoozeTill, 3), 11))<br>&nbsp;&nbsp;&nbsp; If Not BitAND(WinGetState("X-Lorem Ipsum"), 2) Then SplashTextOn("", "Snoozing for " &amp; $SnoozeTime &amp; " minutes, since " &amp; @HOUR &amp; ":" &amp; @MIN &amp; ", to " &amp; StringTrimLeft(StringTrimRight($SnoozeTill, 3), 11), 850, 55, 200, 630, 33, "Comic Sans MS", 20)<br>&nbsp;&nbsp;&nbsp; _Winamp_Stop()<br>&nbsp;&nbsp;&nbsp; Do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep(10)<br>&nbsp;&nbsp;&nbsp; Until @HOUR &amp; ":" &amp; @MIN = StringTrimLeft(StringTrimRight($SnoozeTill, 3), 11)<br>&nbsp;&nbsp;&nbsp; SplashOff()<br>&nbsp;&nbsp;&nbsp; _Winamp_SetVolume(0)<br>&nbsp;&nbsp;&nbsp; _Winamp_Play()<br>&nbsp;&nbsp;&nbsp; HotKeySet("{SPACE}", "Snooze")<br>&nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label8, " -&nbsp; Enabled")<br>&nbsp;&nbsp;&nbsp; Fadein(GUICtrlRead($Slider_Fadein_Time), GUICtrlRead($Slider_MaxVol))<br>EndFunc&nbsp;&nbsp; ;==&gt;Snooze<br><br>Func PickMusic()<br>&nbsp;&nbsp;&nbsp; $RndORSel = 0<br>&nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_PlaylistorFile, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; ;Highlander()<br>&nbsp;&nbsp;&nbsp; Local $Drive, $Dir, $FName, $Ext<br>&nbsp;&nbsp;&nbsp; $SelectedSong = FileOpenDialog("Select Song", "C:\Users\Public\Music\Music", "Media files (*.mp3;*.m4a;*.m3u) | All (*.*)")<br>&nbsp;&nbsp;&nbsp; If @error Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $SelectedSong = IniRead($IniFile, "Wakeup File", "SoundFile", "NotFound")<br>&nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IniWriteSection($IniFile, "Wakeup File", "SoundFile=" &amp; $SelectedSong)<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; $MusicPath = StringSplit($SelectedSong, "\")<br>&nbsp;&nbsp;&nbsp; GUICtrlSetData($Input_PlaylistorFile, StringTrimRight($MusicPath[$MusicPath[0]], 4))<br>EndFunc&nbsp;&nbsp; ;==&gt;PickMusic<br><br>Func RndMusic()<br>&nbsp;&nbsp;&nbsp; $RndORSel = 1<br>&nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_PlaylistorFile, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; ;Highlander()<br>&nbsp;&nbsp;&nbsp; Local $Folder, $Drive, $Dir, $FName, $Ext<br>&nbsp;&nbsp;&nbsp; $Folder = FileSelectFolder("Select A Music Folder", "C:\Users\Public\Music\Music", 6)<br>&nbsp;&nbsp;&nbsp; $FileList = _FileListToArray($Folder, "*", 1)<br>&nbsp;&nbsp;&nbsp; If @error = 1 Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MsgBox(0, "", "No Files\Folders Found.")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Exit<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; Do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $RandomFile = Random(1, $FileList[0], 1)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $MusicPath = _PathSplit($Folder &amp; "\" &amp; $FileList[$RandomFile], $Drive, $Dir, $FName, $Ext)<br>&nbsp;&nbsp;&nbsp; Until $MusicPath[4] = ".mp3" Or $MusicPath[4] = ".m4a" Or $MusicPath[4] = ".m3u"<br>&nbsp;&nbsp;&nbsp; GUICtrlSetData($Input_PlaylistorFile, $FileList[$RandomFile])<br>EndFunc&nbsp;&nbsp; ;==&gt;RndMusic<br><br>Func ToggleHide()<br>&nbsp;&nbsp;&nbsp; If BitAND(WinGetState("X-Lorem Ipsum", ""), 2) Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WinSetState("X-Lorem Ipsum", "", @SW_HIDE)<br>&nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WinSetState("X-Lorem Ipsum", "", @SW_SHOW)<br>&nbsp;&nbsp;&nbsp; EndIf<br>EndFunc&nbsp;&nbsp; ;==&gt;ToggleHide<br><br>Func Highlander()<br>&nbsp;&nbsp;&nbsp; Switch @GUI_CtrlId<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case $Checkbox_Winamp_Wakeup<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "&nbsp; Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Snooze, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Checkbox_Direct, $GUI_UNCHECKED)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case $Button_Pick, $Button_Random, $Checkbox_Direct<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "&nbsp; Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Snooze, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Checkbox_Winamp_Wakeup, $GUI_UNCHECKED)<br>&nbsp;&nbsp;&nbsp; EndSwitch<br>EndFunc&nbsp;&nbsp; ;==&gt;Highlander<br><br>Func CheckStartCombo()<br>&nbsp;&nbsp;&nbsp; Switch GUICtrlRead($Combo_WinAmpStart)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case " Winamp "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_AlarmTime, $GUI_DISABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Snooze, $GUI_DISABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Input_PlaylistorFile, "Playlist or File")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_PlaylistorFile, $GUI_DISABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Start Playing "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "&nbsp; Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Snooze, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Select "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "&nbsp; Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Snooze, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PickMusic()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case "&nbsp; Random "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "&nbsp; Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Snooze, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RndMusic()<br>&nbsp;&nbsp;&nbsp; EndSwitch<br>EndFunc<br><br>Func GetTitle()<br>&nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Title, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; While 1<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ToolTip("Click on the App now")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sleep(50)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; If _IsPressed("01") Then ExitLoop<br>&nbsp;&nbsp;&nbsp; WEnd<br>&nbsp;&nbsp;&nbsp; ToolTip("")<br>&nbsp;&nbsp;&nbsp; GUICtrlSetData($Input_Title, WinGetTitle("[active]"))<br>EndFunc&nbsp;&nbsp; ;==&gt;GetTitle<br><br>Func CheckTimeCombo()<br>&nbsp;&nbsp;&nbsp; Switch GUICtrlRead($Combo_TimeFrame)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case " Specific Time "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Time, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Input_Time, "4:20")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case " Hour.Hour "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Time, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Input_Time, "2.5")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case " Hour,Minute "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Time, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Input_Time, "2,30")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case " Minute "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Time, $GUI_ENABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Input_Time, "150")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case " Lullaby Time "<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetState($Input_Time, $GUI_DISABLE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Input_Time, "")<br>&nbsp;&nbsp;&nbsp; EndSwitch<br>EndFunc&nbsp;&nbsp; ;==&gt;CheckTimeCombo<br><br>Func SlidersSave()<br>&nbsp;&nbsp;&nbsp; IniWrite($IniFile, "Levels", "FadeInTime", GUICtrlRead($Slider_Fadein_Time))<br>&nbsp;&nbsp;&nbsp; IniWrite($IniFile, "Levels", "MaxVolume", GUICtrlRead($Slider_MaxVol))<br>EndFunc<br><br>Func WriteSnoozeTime()<br>&nbsp;&nbsp;&nbsp; IniWrite($IniFile, "Snooze Time", "SnoozeTime", GUICtrlRead($Input_Snooze))<br>&nbsp;&nbsp;&nbsp; ;MsgBox(0, "Snooze Time", "$Input_Snooze = " &amp; $Input_Snooze &amp; "&nbsp; GUI_CtrlId = " &amp; @GUI_CtrlId &amp; @LF)<br>EndFunc<br><br>Func WriteAlarmTime()<br>&nbsp;&nbsp;&nbsp; IniWrite($IniFile, "Alarm Time", "AlarmTime", GUICtrlRead($Input_AlarmTime))<br>&nbsp;&nbsp;&nbsp; ;MsgBox(0, "Alarm Time", "GUI_CtrlId = " &amp; @GUI_CtrlId &amp; @LF)<br>EndFunc<br><br>Func MouseOverTray()<br>&nbsp;&nbsp;&nbsp; If BitAND(WinGetState("X-Lorem Ipsum", ""), 2) Then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TrayItemSetText($TrayToggleHide, "Hide Window")<br>&nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TrayItemSetText($TrayToggleHide, "Show Window")<br>&nbsp;&nbsp;&nbsp; EndIf<br>EndFunc<br><br>Func ToggleHotKey()<br>&nbsp;&nbsp;&nbsp; Switch $HotKeyAble<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 0<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TrayItemSetText($TrayToggleHotKey, "Disable Hotkeys")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label7, " &gt;-&nbsp; Enabled")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HotKeySet("{F2}", "VolUpDownMute")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HotKeySet("{F3}", "VolUpDownMute")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HotKeySet("{F4}", "VolUpDownMute")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HotKeySet("{F10}", "ToggleHide")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HotKeySet("{SPACE}", "Snooze")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $HotKeyAble = 1<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Case 1<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TrayItemSetText($TrayToggleHotKey, "Enable Hotkeys")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GUICtrlSetData($Tab2_Label7, " |-&nbsp; Disabled")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HotKeySet("{F2}")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HotKeySet("{F3}")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HotKeySet("{F4}")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HotKeySet("{F10}")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HotKeySet("{SPACE}")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $HotKeyAble = 0<br>&nbsp;&nbsp;&nbsp; EndSwitch<br>EndFunc&nbsp;&nbsp; ;==&gt;ToggleHotKey<br><br>Func CheckWinampStop()<br>&nbsp;&nbsp;&nbsp; If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "&nbsp; Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_DISABLE)<br>EndFunc<br><br>Func Restart()<br>&nbsp;&nbsp;&nbsp; If @HotKeyPressed = "{SPACE}" Then _Winamp_Play()<br>&nbsp;&nbsp;&nbsp; $MouPos = WinGetPos("X-Lorem Ipsum")<br>&nbsp;&nbsp;&nbsp; If $MouPos[0] &amp; "," &amp; $MouPos[1] &lt;&gt; "10,535" Then IniWrite($IniFile, "XLorem Position", "XPos", $MouPos[0] &amp; ", " &amp; $MouPos[1])<br>; Restart your program - http://www.autoitscript.com/forum/index.php?s=&amp;showtopic=19370&amp;view=findpost&amp;p=199608<br>; Author UP_NORTH<br>&nbsp;&nbsp;&nbsp; If @Compiled = 1 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Run(FileGetShortName(@ScriptFullPath))<br>&nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Run(FileGetShortName(@AutoItExe) &amp; " " &amp; FileGetShortName(@ScriptFullPath))<br>&nbsp;&nbsp;&nbsp; EndIf<br>&nbsp;&nbsp;&nbsp; Exit<br>EndFunc&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;==&gt;Restart<br><br>Func Quit()<br>&nbsp;&nbsp;&nbsp; If @HotKeyPressed = "{SPACE}" Then _Winamp_Play()<br>&nbsp;&nbsp;&nbsp; Exit<br>EndFunc&nbsp;&nbsp; ;==&gt;Quit<br>
<br> Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#include <misc.au3>

Sleep(250)

If _Singleton("X-Lorem Ipsum",1) = 0 Then
    Msgbox(0,"Warning","An occurence of X-Lorem Ipsum is already running", 3)
    Exit
EndIf

#include <file.au3>
#include <date.au3>
#include <string.au3>
#include <guitab.au3>
#include <constants.au3>
#include <editconstants.au3>
#include <winamp_library.au3> ; http://www.autoitscript.com/forum/topic/71187-winamp-library-on-pure-autoit/
#include <guiconstantsex.au3>
#include <comboconstants.au3>
#include <sliderconstants.au3>
#include <buttonconstants.au3>
#include <windowsconstants.au3>
#include <progressconstants.au3>
#include <datetimeconstants.au3>

#Region ### START Opts and Declarations section ###
Opt("TrayMenuMode", 3)
Opt("SendKeyDelay", 150)
;Opt("TrayIconDebug", 1)
Opt("MouseCoordMode", 2)
Opt("GUIOnEventMode", 1)
Opt("TrayOnEventMode", 1)
Opt("MustDeclareVars", 1)
Opt("WinTitleMatchMode", 2)

Local $TrayToggleHide, $TrayRestart, $TrayExit, $TrayToggleHotKey
Local $Form, $Tab, $Tab0, $Tab1, $Tab2, $Tab2_Label1, $Tab2_Label2, $Tab2_Label3, $Tab2_Label4, $Tab2_Label5, $Tab2_Label6, $Tab2_Label7, $Tab2_Label8
Global $Input_PlaylistorFile, $Input_Snooze, $Input_Time, $Input_Title
Global $Combo_WinAmpStop, $Combo_Shutdown, $Combo_TimeFrame, $Combo_WinAmpStart
Global $Slider_Fadein_Time, $Slider_Fadein_Time_Value, $Old_Slider1_Value, $Slider_MaxVol, $Slider_MaxVol_Value, $Old_Slider2_Value
Global $Button_Begin, $Button_GetTitle, $Button_Pick, $Button_Random, $Progressbar
Global $Countdown, $CountdownTotal, $CountdownToDate, $CurrentVolume, $MaxVolume
Global $SelectedSong, $FadeTime, $CountdownTime, $Input_AlarmTime, $AlarmTimeData, $FileList, $RandomFile, $Folder
Global $IniFile = @ScriptDir &amp; "\X-Lorem.ini"
Global $RndORSel, $MusicPath, $Restart, $MouPos, $HotKeyAble = 1, $Checkbox_Fade
#EndRegion ### END Opts and Declarations section ###

#Region ### START HotKeySet and INI section ###
HotKeySet("{F2}", "VolUpDownMute") ;ToggleMute
HotKeySet("{F3}", "VolUpDownMute") ;VolDown
HotKeySet("{F4}", "VolUpDownMute") ;VolUp
HotKeySet("{F10}", "ToggleHide")

$AlarmTimeData = IniRead($IniFile, "Alarm Time", "AlarmTime", @HOUR &amp; ":" &amp; @MIN)
$MouPos     = StringSplit(IniRead($IniFile, "XLorem Position", "XPos", 10 &amp; "," &amp; 535), ",")
#EndRegion ### END HotKeySet and INI section section ###

#Region ### START Koda GUI section ### Form=C:\Program Files\AutoIt3\koda\Forms\LoremIpsum.kxf

If $MouPos[0] &amp; ", " &amp; $MouPos[1] &lt;&gt; "15, " &amp; @DesktopHeight - 275 And StringIsDigit($MouPos[0]) And StringIsDigit($MouPos[1]) Then
    $Form = GUICreate("X-Lorem Ipsum", 450, 200, $MouPos[1], $MouPos[2], Default, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
Else
    $Form = GUICreate("X-Lorem Ipsum", 450, 200, 15, @DesktopHeight - 275, Default, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
EndIf
 GUISetOnEvent($GUI_EVENT_CLOSE, "Quit")
 GUISetIcon("1998_low_cost_clock.ico")
 GUISetBkColor(0xc0c0c0)
$Tab = GUICtrlCreateTab(-1, -1, 450, 200)
 GUICtrlSetResizing($Tab, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
;
$Tab0 = GUICtrlCreateTabItem("Lullaby")
$Combo_WinAmpStop = GUICtrlCreateCombo(" WinAmp ", 15, 40, 115, 20)
 GUICtrlSetData($Combo_WinAmpStop, "  Just Stop |  Stop-n-Play |  Stop When Done |  End Program ")
 GUICtrlSetTip($Combo_WinAmpStop, " Just Stop " &amp; @LF &amp; " Stop-n-Play - Stop playing, go right to Wakeup " &amp; @LF &amp; " Stop When Done - Stop after the current song ends " &amp; @LF &amp;  " End Program ", " How To Stop Winamp.. ", 1)
 GUICtrlSetOnEvent($Combo_WinAmpStop, "CheckWinampStop")
$Combo_TimeFrame = GUICtrlCreateCombo(" Lullaby Time ", 170, 40, 115, 20)
 GUICtrlSetData($Combo_TimeFrame, " Specific Time | Hour.Hour | Hour,Minute | Minute ")
 GUICtrlSetOnEvent($Combo_TimeFrame, "CheckTimeCombo")
 GUICtrlSetTip($Combo_TimeFrame, " Specific Time - 4:20 " &amp; @LF &amp; " Hour.Hour - 2.5 - 2 hours 30 minutes " &amp; @LF &amp; " Hour,Minute - 2,30 - 2 hours 30 minutes " &amp; @LF &amp; " Minute - 150 - 2 hours 30 minutes ", " Lullaby Time ", 1)
$Input_Time = GUICtrlCreateInput("", 340, 40, 65, 25, $ES_CENTER)
 GUICtrlSetState($Input_Time, $GUI_DISABLE)
$Combo_Shutdown = GUICtrlCreateCombo(" Shutdown Options ", 100, 75, 200, 20)
 GUICtrlSetData($Combo_Shutdown, "  Lock  |  Standby  |  Hibernate  |  Reboot  |  Shutdown")
 GUICtrlSetTip($Combo_Shutdown, "  Lock  " &amp; @LF &amp; "  Standby  " &amp; @LF &amp; "  Hibernate  " &amp; @LF &amp; "  Reboot  " &amp; @LF &amp; "  Shutdown ", " Shutdown Options ", 1)
$Input_Title = GUICtrlCreateInput("Close Title", 100, 115, 250, 25, $ES_CENTER)
 GUICtrlSetState($Input_Title, $GUI_DISABLE)
$Button_GetTitle = GUICtrlCreateButton("Title", 20, 115, 60, 25)
 GUICtrlSetOnEvent($Button_GetTitle, "GetTitle")
$Button_Begin = GUICtrlCreateButton("Begin", 170, 160, 100, 25)
 GUICtrlSetOnEvent($Button_Begin, "Lullaby")
$Checkbox_Fade = GUICtrlCreateCheckbox("Fade", 90, 160, 60, 20)
;
$Tab1 = GUICtrlCreateTabItem("Wakeup")
$Combo_WinAmpStart = GUICtrlCreateCombo(" WinAmp ", 190, 35, 115, 20)
 GUICtrlSetData($Combo_WinAmpStart, "  Start Playing |  Select |  Random ")
 GUICtrlSetOnEvent($Combo_WinAmpStart, "CheckStartCombo")
#cs
$Checkbox_Winamp_Wakeup = GUICtrlCreateCheckbox("Winamp", 190, 35, 85, 20)
 GUICtrlSetOnEvent($Checkbox_Winamp_Wakeup, "Highlander")
$Checkbox_Direct = GUICtrlCreateCheckbox(" Direct", 190, 55, 85, 20)
 GUICtrlSetOnEvent($Checkbox_Direct, "Highlander")
$Button_Pick = GUICtrlCreateButton("Pick", 298, 30, 40, 20)
 GUICtrlSetOnEvent($Button_Pick, "PickMusic")
$Button_Random = GUICtrlCreateButton("Random", 285, 60, 65, 20)
 GUICtrlSetOnEvent($Button_Random, "RndMusic")
#ce
$Button_Begin = GUICtrlCreateButton("Begin", 170, 160, 100, 25)
 GUICtrlSetOnEvent($Button_Begin, "Lullaby")
$Input_AlarmTime = GUICtrlCreateInput($AlarmTimeData, 158, 125, 65, 25, $ES_CENTER)
 GUICtrlSetState($Input_AlarmTime, $GUI_DISABLE)
 GUICtrlSetOnEvent($Input_AlarmTime, "WriteAlarmTime")
 GUICtrlCreateLabel("Wakeup", 100, 126)
$Input_PlaylistorFile = GUICtrlCreateInput("Playlist or File", 85, 90, 275, 25, $ES_CENTER)
 GUICtrlSetState($Input_PlaylistorFile, $GUI_DISABLE)
$Input_Snooze = GUICtrlCreateInput(IniRead($IniFile, "Snooze Time", "SnoozeTime", 9), 285, 125, 25, 25, $ES_CENTER)
 GUICtrlSetState($Input_Snooze, $GUI_DISABLE)
 GUICtrlSetOnEvent($Input_Snooze, "WriteSnoozeTime")
 GUICtrlCreateLabel("Snooze", 230, 126)
 GUICtrlCreateLabel("Minute(s)", 315, 126)
$Slider_Fadein_Time = GUICtrlCreateSlider(10, 55, 15, 85, $TBS_VERT)
 GUICtrlCreateLabel("Fade In Time", 10, 35)
 GUICtrlSetOnEvent($Slider_Fadein_Time, "Update_FadeInTime")
 GUICtrlSetLimit($Slider_Fadein_Time, 20, 0)
 GUICtrlSetData($Slider_Fadein_Time, IniRead($IniFile, "Levels", "FadeInTime", 5))
$Slider_Fadein_Time_Value = GUICtrlCreateLabel(GUICtrlRead($Slider_Fadein_Time), 135, 35)
$Slider_MaxVol = GUICtrlCreateSlider(40, 80, 15, 85, $TBS_VERT)
 GUICtrlCreateLabel("Max Volume", 40, 60)
 GUICtrlSetOnEvent($Slider_MaxVol, "Update_MaxVolume")
 GUICtrlSetLimit($Slider_MaxVol, 100, 0)
 GUICtrlSetData($Slider_MaxVol, IniRead($IniFile, "Levels", "MaxVolume", 85))
$Slider_MaxVol_Value = GUICtrlCreateLabel(GUICtrlRead($Slider_MaxVol), 145, 60)
$Checkbox_Fade = GUICtrlCreateCheckbox("Fade", 90, 160, 60, 20)
;
$Tab2 = GUICtrlCreateTabItem("Info")
;$Tab2_Label1 = GUICtrlCreateLabel("[Ctrl+Alt]+ESC - Quit", 10, 25)
$Tab2_Label3 = GUICtrlCreateLabel("SPACE - 1x -&gt; Snooze   2x -&gt; Restart" &amp; @LF &amp; @LF &amp; "F2/F3/F4 - Volume Mute/Down/Up" &amp; @LF &amp; "F10          - Window Show/Hide", 10, 95)
;$Tab2_Label2 = GUICtrlCreateLabel("F2/F3/F4 - Volume Mute/Down/Up", 10, 73)
;$Tab2_Label4 = GUICtrlCreateLabel("F10         - Window Show/Hide", 10, 93)
$Tab2_Label5 = GUICtrlCreateLabel("Text", 10, 35, 500)
;$Tab2_Label6 = GUICtrlCreateLabel("Hr.Hr  (1.5 = 1 Hour and 30 Minutes)" &amp; @LF &amp; "Hr,Min (1,5 = 1 Hour and 5 Minutes)", 10, 130)
$Tab2_Label7 = GUICtrlCreateLabel(" &gt;-  Enabled", 242, 135)
$Tab2_Label8 = GUICtrlCreateLabel("  -  Not Enabled", 245, 95)
$Progressbar = GUICtrlCreateProgress(50, 60, 335, 22, -1, $PBS_SMOOTH)
 GUICtrlSetColor($Progressbar, 0x00ff00)
;
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

#Region ### START Tray section ###
$TrayToggleHide = TrayCreateItem("Show/Hide")
 TrayItemSetOnEvent(-1, "ToggleHide")
$TrayToggleHotKey = TrayCreateItem("Disable Hotkeys")
 TrayItemSetOnEvent(-1, "ToggleHotKey")
$TrayRestart = TrayCreateItem("Restart")
 TrayItemSetOnEvent(-1, "Restart")
$TrayExit   = TrayCreateItem("Exit")
 TrayItemSetOnEvent(-1, "Quit")
;
TraySetState()
TraySetClick(9)
TraySetIcon(@ScriptDir &amp; "\1998_low_cost_clock.ico")
TraySetToolTip("X-Lorem Ipsum - Click here for the menu..")
TraySetOnEvent($TRAY_EVENT_MOUSEOVER,"MouseOverTray")
#EndRegion ### END Tray section ###

While 1
    Sleep(100)
WEnd

Func Lullaby()
    If GUICtrlRead($Combo_WinAmpStop) = "  Stop-n-Play " And GUICtrlRead($Combo_WinAmpStart) = " WinAmp " Then
        MsgBox(0, "", "You must select a startup thing too you know..")
        Restart()
    EndIf
    ControlClick("X-Lorem Ipsum", "", "SysTabControl321", "left", 1, 135, 10)
    If GUICtrlRead($Checkbox_Fade) = $GUI_CHECKED Then
        For $iTransValue = 250 To 5 Step -15
            WinSetTrans("X-Lorem Ipsum", "", $iTransValue)
            Sleep(10)
        Next
        WinSetState("X-Lorem Ipsum", "", @SW_HIDE)
        WinSetTrans("X-Lorem Ipsum", "", 255)
    EndIf
    Local $TimeFraction, $ConvertedHour, $ConvertedMinutes, $Timesplit
    If GUICtrlRead($Combo_TimeFrame) &lt;&gt; " Lullaby Time " Then
        Switch GUICtrlRead($Combo_TimeFrame)
            Case " Hour.Hour "
                If StringInStr(GUICtrlRead($Input_Time), ".") Then
                    $TimeFraction = StringSplit(GUICtrlRead($Input_Time), ".")
                    $CountdownToDate = _DateAdd('n', (60 * $TimeFraction[1]) + ((60 * $TimeFraction[2]) / 10), _NowCalc())
                    GUICtrlSetData($Tab2_Label5, "$Input_Time - " &amp;  GUICtrlRead($Input_Time) &amp; " Hour.Hour - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))
                    ;MsgBox(0, "", "$Input_Time - " &amp;  GUICtrlRead($Input_Time) &amp; " Hour.Hour" &amp; @LF &amp; "$TimeFraction[1] - " &amp; $TimeFraction[1] &amp; @LF &amp; "$TimeFraction[2] - " &amp; $TimeFraction[2] &amp; @LF &amp; $CountdownToDate &amp; @LF)
                Else
                    $CountdownToDate = _DateAdd('h', GUICtrlRead($Input_Time), _NowCalc())
                    GUICtrlSetData($Tab2_Label5, "$Input_Time - " &amp;  GUICtrlRead($Input_Time) &amp; " Hour.Hour - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))
                    ;MsgBox(0, "", "$Input_Time - " &amp;  GUICtrlRead($Input_Time) &amp; @LF &amp; $CountdownToDate &amp; @LF)
                EndIf
            Case " Hour,Minute "
                If StringInStr(GUICtrlRead($Input_Time), ",") Then
                    $TimeFraction = StringSplit(GUICtrlRead($Input_Time), ",")
                    $CountdownToDate = _DateAdd('n', (60 * $TimeFraction[1]) + $TimeFraction[2], _NowCalc())
                    GUICtrlSetData($Tab2_Label5, "$Input_Time - " &amp;  GUICtrlRead($Input_Time) &amp; " Hour,Minute - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))
                    ;MsgBox(0, "", "$Input_Time - " &amp;  GUICtrlRead($Input_Time) &amp; " Hour,Minute" &amp; @LF &amp; "$TimeFraction[1] - " &amp; $TimeFraction[1] &amp; @LF &amp; "$TimeFraction[2] - " &amp; $TimeFraction[2] &amp; @LF &amp; $CountdownToDate &amp; @LF)
                Else
                    $CountdownToDate = _DateAdd('h', GUICtrlRead($Input_Time), _NowCalc())
                    GUICtrlSetData($Tab2_Label5, "$Input_Time - " &amp;  GUICtrlRead($Input_Time) &amp; " Hour,Minute - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))
                    ;MsgBox(0, "", "$Input_Time - " &amp;  GUICtrlRead($Input_Time) &amp; @LF &amp; $CountdownToDate &amp; @LF)
                EndIf
            Case " Minute "
                If StringInStr(GUICtrlRead($Input_Time), ".") Then
                    $TimeFraction = StringSplit(GUICtrlRead($Input_Time), ".")
                    $CountdownToDate = _DateAdd('s', (60 * $TimeFraction[1]) + ((60 * $TimeFraction[2]) / 10), _NowCalc())
                    GUICtrlSetData($Tab2_Label5, "$Input_Time - " &amp;  GUICtrlRead($Input_Time) &amp; " Minute - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))
                    ;MsgBox(0, "", "$Input_Time - " &amp;  GUICtrlRead($Input_Time) &amp; " Minute" &amp; @LF &amp; "$TimeFraction[1] - " &amp; $TimeFraction[1] &amp; @LF &amp; "$TimeFraction[2] - " &amp; $TimeFraction[2] &amp; @LF &amp; $CountdownToDate &amp; @LF)
                Else
                    $CountdownToDate = _DateAdd('n', GUICtrlRead($Input_Time), _NowCalc())
                    GUICtrlSetData($Tab2_Label5, _NowCalc() &amp; " - " &amp; GUICtrlRead($Input_Time) &amp; " Minute - " &amp; StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3))
                    ;MsgBox(0, "", _NowCalc() &amp; @LF &amp; GUICtrlRead($Input_Time) &amp; @LF &amp; $CountdownToDate &amp; @LF)
                EndIf
            Case " Specific Time "
                $Timesplit = StringSplit(Number(StringFormat("%04d",StringRegExpReplace(GUICtrlRead($Input_Time), "\D", ""))), "")
                If StringInStr(GUICtrlRead($Input_Time), "p") Then
                    Switch $Timesplit[0]
                        Case 3
                            $ConvertedHour = $Timesplit[1] + 12
                            $ConvertedMinutes = $Timesplit[2] &amp; $Timesplit[3]
                            If $ConvertedHour = 24 Then $ConvertedHour = 00
                            GUICtrlSetData($Tab2_Label5, "Lullaby Switch 3a, Waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)
                        Case 4
                            If ($Timesplit[1] &amp; $Timesplit[2]) = 12 Then
                                $ConvertedHour = $Timesplit[1] &amp; $Timesplit[2]
                            Else
                                $ConvertedHour = ($Timesplit[1] &amp; $Timesplit[2]) + 12
                            EndIf
                            $ConvertedMinutes = $Timesplit[3] &amp; $Timesplit[4]
                            If $ConvertedHour = 24 Then $ConvertedHour = 00
                            GUICtrlSetData($Tab2_Label5, "Lullaby Switch 4a, Waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)
                    EndSwitch
                Else
                    Switch $Timesplit[0]
                        Case 3
                            $ConvertedHour = $Timesplit[1]
                            $ConvertedMinutes = $Timesplit[2] &amp; $Timesplit[3]
                            GUICtrlSetData($Tab2_Label5, "Lullaby Switch 3b, Waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)
                        Case 4
                            If ($Timesplit[1] &amp; $Timesplit[2]) = 12 Then
                                $ConvertedHour = 0
                            Else
                                $ConvertedHour = $Timesplit[1] &amp; $Timesplit[2]
                            EndIf
                            $ConvertedMinutes = $Timesplit[3] &amp; $Timesplit[4]
                            GUICtrlSetData($Tab2_Label5, "Lullaby Switch 4b, Waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)
                    EndSwitch
                EndIf
                Do
                    Sleep(100)
                Until $ConvertedHour &amp; $ConvertedMinutes = @Hour &amp; @Min
                #cs
                Do
                    Sleep(10)
                Until Number(StringFormat("%04d",StringRegExpReplace(GUICtrlRead($Input_Time), "\D", ""))) = Number(@Hour &amp; @Min) ;http://www.autoitscript.com/forum/topic/123103-how-to-check-systemtime/page__view__findpost__p__855050
                #ce
        EndSwitch
        If GUICtrlRead($Combo_TimeFrame) &lt;&gt; " Specific Time " Then
            Local $DateDiffCalc = _DateDiff( 'n', _NowCalc(), $CountdownToDate)
            Local $TotalDateDiffCalc = $DateDiffCalc
            GUICtrlSetData($Progressbar, ($DateDiffCalc / $TotalDateDiffCalc) * 100)
            Do
                $DateDiffCalc = _DateDiff( 'n', _NowCalc(), $CountdownToDate)
                If $DateDiffCalc &lt;&gt; $TotalDateDiffCalc Then GUICtrlSetData($Progressbar, ($DateDiffCalc / $TotalDateDiffCalc) * 100)
                Sleep(10)
            ;Until Number(StringTrimRight(StringTrimLeft($CountdownToDate, 11), 3)) = @HOUR &amp; ":" &amp; @MIN
            Until $CountdownToDate &lt;= _NowCalc()
            GUICtrlSetData($Progressbar, 0)
        EndIf
    EndIf
    RunAfterLullaby()
EndFunc   ;==&gt;Lullaby

Func RunAfterLullaby()
    GUICtrlSetData($Tab2_Label5, "NightNight..")
    If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; " WinAmp " Then
        Switch GUICtrlRead($Combo_WinAmpStop)
            Case "  Just Stop "
                _Winamp_Stop()
            Case "  Stop-n-Play "
                WakeupNow()
            Case "  Stop When Done "
                ControlSend("Winamp", "", "", "^v")
            Case "  End Program "
                _Winamp_Close()
        EndSwitch
    EndIf
    If GUICtrlRead($Input_Title) &lt;&gt; "Close Title" Then WinClose(GUICtrlRead($Input_Title))
    If GUICtrlRead($Combo_Shutdown) &lt;&gt; " Shutdown Options " Then
        Switch GUICtrlRead($Combo_Shutdown)
            Case "  Lock  "
                Run("rundll32.exe user32.dll, LockWorkStation")
            Case "  Standby  "
                Shutdown(32)
            Case "  Hibernate  "
                Shutdown(64)
            Case "  Reboot  "
                Shutdown(18)
            Case "  Shutdown  "
                Shutdown(13)
        EndSwitch
    EndIf
    WaitforWakeup()
EndFunc   ;==&gt;RunAfterLullaby

Func WaitforWakeup()
    Local $ConvertedHour, $ConvertedMinutes, $Timesplit
    ;ControlClick("X-Lorem Ipsum", "", "SysTabControl321", "left", 1, 75, 10)
    $Timesplit = StringSplit(Number(StringFormat("%04d",StringRegExpReplace(GUICtrlRead($Input_AlarmTime), "\D", ""))), "")
    If StringInStr(GUICtrlRead($Input_AlarmTime), "p") Then
        Switch $Timesplit[0]
            Case 3
                $ConvertedHour = $Timesplit[1] + 12
                $ConvertedMinutes = $Timesplit[2] &amp; $Timesplit[3]
                If $ConvertedHour = 24 Then $ConvertedHour = 0
                GUICtrlSetData($Tab2_Label5, "Wakeup Case 3a, waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)
            Case 4
                If ($Timesplit[1] &amp; $Timesplit[2]) = 12 Then
                    $ConvertedHour = $Timesplit[1] &amp; $Timesplit[2]
                Else
                    $ConvertedHour = ($Timesplit[1] &amp; $Timesplit[2]) + 12
                EndIf
                $ConvertedMinutes = $Timesplit[3] &amp; $Timesplit[4]
                If $ConvertedHour = 24 Then $ConvertedHour = 0
                GUICtrlSetData($Tab2_Label5, "Wakeup Case 4a, waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)
        EndSwitch
        #cs
        Do
            Sleep(100)
        Until Number($ConvertedHour &amp; $ConvertedMinutes) = @Hour &amp; @Min
        #ce
    Else
        Switch $Timesplit[0]
            Case 3
                $ConvertedHour = $Timesplit[1]
                $ConvertedMinutes = $Timesplit[2] &amp; $Timesplit[3]
                GUICtrlSetData($Tab2_Label5, "Wakeup Case 3b, waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes &amp; "(" &amp; @HOUR &amp; ":" &amp; @MIN &amp; ")")
            Case 4
                If ($Timesplit[1] &amp; $Timesplit[2]) = 12 Then
                    $ConvertedHour = 0
                Else
                    $ConvertedHour = $Timesplit[1] &amp; $Timesplit[2]
                EndIf
                $ConvertedMinutes = $Timesplit[3] &amp; $Timesplit[4]
                GUICtrlSetData($Tab2_Label5, "Wakeup Case 4b, waiting till " &amp; $ConvertedHour &amp; $ConvertedMinutes)
        EndSwitch
        #cs
        Do
            Sleep(100)
        Until Number($ConvertedHour &amp; $ConvertedMinutes) = @Hour &amp; @Min
        #ce
    EndIf
    Do
        Sleep(100)
    Until Number($ConvertedHour &amp; $ConvertedMinutes) = @Hour &amp; @Min
    Sleep(100)
    WakeupNow()
EndFunc   ;==&gt;WaitforWakeup

Func WakeupNow()
    If _Winamp_GetCurrentTrackPlayStatus() Then
        _Winamp_Stop()
        Sleep(100)
    EndIf
    HotKeySet("{SPACE}", "Snooze")
     GUICtrlSetData($Tab2_Label8, " - Enabled") ;Spacebar (snooze)
     GUICtrlSetData($Tab2_Label5, "Time to start..")
    _Winamp_SetVolume(0)
    If GUICtrlRead($Input_PlaylistorFile) &lt;&gt; "Playlist or File" Then ; Or GUICtrlRead($Input_PlaylistorFile) &lt;&gt; ""
        Switch $RndORSel
            Case 0 ;Pick
                _Winamp_ClearPlayList()
                _Winamp_AddFile($SelectedSong)
                _Winamp_Play()
            Case 1 ;Random
                _Winamp_ClearPlayList()
                _Winamp_AddFile(StringReplace($MusicPath[0], ";", ":"))
                _Winamp_Play()
        EndSwitch
    ElseIf GUICtrlRead($Combo_WinAmpStart) = "  Start Playing " Then
        _Winamp_Play()
    EndIf
    ;ControlClick("X-Lorem Ipsum", "", "SysTabControl321", "left", 1, 115, 10)
    GUICtrlSetData($Tab2_Label5, "Fade In..")
    Fadein(GUICtrlRead($Slider_Fadein_Time), GUICtrlRead($Slider_MaxVol))
    GUICtrlSetData($Tab2_Label5, "Done for now..")
    GUICtrlSetData($Tab2_Label8, " - Disabled") ; Spacebar (snooze)
    HotKeySet("{SPACE}")
EndFunc   ;==&gt;WakeupNow

Func Fadein($FadeTime, $MaxVolume)
    ; If the Main is muted, un-mute it
    PixelSearch(1260, 780, 1275, 790, 0xFF0000)
    If Not @error Then Send("{VOLUME_MUTE}")
    ;
    Switch @OSVersion
        Case "WIN_VISTA"
            Run("sndvol.exe", "", @SW_HIDE)
        Case "WIN_XP"
            Run("sndvol32.exe", "", @SW_HIDE)
        Case "WIN_7"
            Run("sndvol.exe", "", @SW_HIDE)
    EndSwitch
    WinWaitActive("Volume Mixer")
    ControlSend("Volume Mixer", "", "msctls_trackbar321", "{HOME}") ; Max system volume
    WinClose("Volume Mixer")
    If _Winamp_GetVolume() = 0 Then
        Do
            _Winamp_SetVolume(-1, 1)
            Sleep($FadeTime * 35)
            $CurrentVolume = _Winamp_GetVolume()
        Until $CurrentVolume / 255 * 100 &gt;= $MaxVolume
    Else
        MsgBox(0, "", ";==&gt;Fadein: Winamp has volume, Quitting Fadein.", 2)
    EndIf
EndFunc   ;==&gt;Fadein

Func Update_FadeInTime()
    If GUICtrlRead($Slider_Fadein_Time) &lt;&gt; $Old_Slider1_Value Then
        GUICtrlSetData($Slider_Fadein_Time_Value, GUICtrlRead($Slider_Fadein_Time))
        $Old_Slider1_Value = GUICtrlRead($Slider_Fadein_Time)
        IniWrite($IniFile, "Levels", "FadeInTime", GUICtrlRead($Slider_Fadein_Time))
    EndIf
EndFunc   ;==&gt;Update_FadeInTime

Func Update_MaxVolume()
    If GUICtrlRead($Slider_MaxVol) &lt;&gt; $Old_Slider2_Value Then
        GUICtrlSetData($Slider_MaxVol_Value, GUICtrlRead($Slider_MaxVol))
        $Old_Slider2_Value = GUICtrlRead($Slider_MaxVol)
        IniWrite($IniFile, "Levels", "MaxVolume", GUICtrlRead($Slider_MaxVol))
    EndIf
EndFunc   ;==&gt;Update_MaxVolume

Func VolUpDownMute()
    Switch @HotKeyPressed
        Case "{F2}"
            Send("{VOLUME_MUTE}")
        Case "{F3}"
            Send("{VOLUME_DOWN}")
        Case "{F4}"
            Send("{VOLUME_UP}")
    EndSwitch
EndFunc

Func Snooze()
    HotKeySet("{SPACE}", "Quit")
    ;HotKeySet("{SPACE}", "Restart")
    GUICtrlSetData($Tab2_Label8, " - Snooze")
    Local $SnoozeTime = Number(GUICtrlRead($Input_Snooze))
    Local $SnoozeTill = _DateAdd('n', $SnoozeTime, _NowCalc())
    GUICtrlSetData($Tab2_Label5, "Snoozing for " &amp; $SnoozeTime &amp; " minutes, since " &amp; @HOUR &amp; ":" &amp; @MIN &amp; ", to " &amp; StringTrimLeft(StringTrimRight($SnoozeTill, 3), 11))
    If Not BitAND(WinGetState("X-Lorem Ipsum"), 2) Then SplashTextOn("", "Snoozing for " &amp; $SnoozeTime &amp; " minutes, since " &amp; @HOUR &amp; ":" &amp; @MIN &amp; ", to " &amp; StringTrimLeft(StringTrimRight($SnoozeTill, 3), 11), 850, 55, 200, 630, 33, "Comic Sans MS", 20)
    _Winamp_Stop()
    Do
        Sleep(10)
    Until @HOUR &amp; ":" &amp; @MIN = StringTrimLeft(StringTrimRight($SnoozeTill, 3), 11)
    SplashOff()
    _Winamp_SetVolume(0)
    _Winamp_Play()
    HotKeySet("{SPACE}", "Snooze")
    GUICtrlSetData($Tab2_Label8, " -  Enabled")
    Fadein(GUICtrlRead($Slider_Fadein_Time), GUICtrlRead($Slider_MaxVol))
EndFunc   ;==&gt;Snooze

Func PickMusic()
    $RndORSel = 0
    GUICtrlSetState($Input_PlaylistorFile, $GUI_ENABLE)
    ;Highlander()
    Local $Drive, $Dir, $FName, $Ext
    $SelectedSong = FileOpenDialog("Select Song", "C:\Users\Public\Music\Music", "Media files (*.mp3;*.m4a;*.m3u) | All (*.*)")
    If @error Then
        $SelectedSong = IniRead($IniFile, "Wakeup File", "SoundFile", "NotFound")
    Else
        IniWriteSection($IniFile, "Wakeup File", "SoundFile=" &amp; $SelectedSong)
    EndIf
    $MusicPath = StringSplit($SelectedSong, "\")
    GUICtrlSetData($Input_PlaylistorFile, StringTrimRight($MusicPath[$MusicPath[0]], 4))
EndFunc   ;==&gt;PickMusic

Func RndMusic()
    $RndORSel = 1
    GUICtrlSetState($Input_PlaylistorFile, $GUI_ENABLE)
    ;Highlander()
    Local $Folder, $Drive, $Dir, $FName, $Ext
    $Folder = FileSelectFolder("Select A Music Folder", "C:\Users\Public\Music\Music", 6)
    $FileList = _FileListToArray($Folder, "*", 1)
    If @error = 1 Then
        MsgBox(0, "", "No Files\Folders Found.")
        Exit
    EndIf
    Do
        $RandomFile = Random(1, $FileList[0], 1)
        $MusicPath = _PathSplit($Folder &amp; "\" &amp; $FileList[$RandomFile], $Drive, $Dir, $FName, $Ext)
    Until $MusicPath[4] = ".mp3" Or $MusicPath[4] = ".m4a" Or $MusicPath[4] = ".m3u"
    GUICtrlSetData($Input_PlaylistorFile, $FileList[$RandomFile])
EndFunc   ;==&gt;RndMusic

Func ToggleHide()
    If BitAND(WinGetState("X-Lorem Ipsum", ""), 2) Then
        WinSetState("X-Lorem Ipsum", "", @SW_HIDE)
    Else
        WinSetState("X-Lorem Ipsum", "", @SW_SHOW)
    EndIf
EndFunc   ;==&gt;ToggleHide

Func Highlander()
    Switch @GUI_CtrlId
        Case $Checkbox_Winamp_Wakeup
            If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "  Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_ENABLE)
            GUICtrlSetState($Input_Snooze, $GUI_ENABLE)
            GUICtrlSetState($Checkbox_Direct, $GUI_UNCHECKED)
        Case $Button_Pick, $Button_Random, $Checkbox_Direct
            If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "  Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_ENABLE)
            GUICtrlSetState($Input_Snooze, $GUI_ENABLE)
            GUICtrlSetState($Checkbox_Winamp_Wakeup, $GUI_UNCHECKED)
    EndSwitch
EndFunc   ;==&gt;Highlander

Func CheckStartCombo()
    Switch GUICtrlRead($Combo_WinAmpStart)
        Case " Winamp "
            GUICtrlSetState($Input_AlarmTime, $GUI_DISABLE)
            GUICtrlSetState($Input_Snooze, $GUI_DISABLE)
            GUICtrlSetData($Input_PlaylistorFile, "Playlist or File")
            GUICtrlSetState($Input_PlaylistorFile, $GUI_DISABLE)
        Case "  Start Playing "
            If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "  Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_ENABLE)
            GUICtrlSetState($Input_Snooze, $GUI_ENABLE)
        Case "  Select "
            If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "  Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_ENABLE)
            GUICtrlSetState($Input_Snooze, $GUI_ENABLE)
            PickMusic()
        Case "  Random "
            If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "  Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_ENABLE)
            GUICtrlSetState($Input_Snooze, $GUI_ENABLE)
            RndMusic()
    EndSwitch
EndFunc

Func GetTitle()
    GUICtrlSetState($Input_Title, $GUI_ENABLE)
    While 1
        ToolTip("Click on the App now")
        Sleep(50)
        If _IsPressed("01") Then ExitLoop
    WEnd
    ToolTip("")
    GUICtrlSetData($Input_Title, WinGetTitle("[active]"))
EndFunc   ;==&gt;GetTitle

Func CheckTimeCombo()
    Switch GUICtrlRead($Combo_TimeFrame)
        Case " Specific Time "
            GUICtrlSetState($Input_Time, $GUI_ENABLE)
            GUICtrlSetData($Input_Time, "4:20")
        Case " Hour.Hour "
            GUICtrlSetState($Input_Time, $GUI_ENABLE)
            GUICtrlSetData($Input_Time, "2.5")
        Case " Hour,Minute "
            GUICtrlSetState($Input_Time, $GUI_ENABLE)
            GUICtrlSetData($Input_Time, "2,30")
        Case " Minute "
            GUICtrlSetState($Input_Time, $GUI_ENABLE)
            GUICtrlSetData($Input_Time, "150")
        Case " Lullaby Time "
            GUICtrlSetState($Input_Time, $GUI_DISABLE)
            GUICtrlSetData($Input_Time, "")
    EndSwitch
EndFunc   ;==&gt;CheckTimeCombo

Func SlidersSave()
    IniWrite($IniFile, "Levels", "FadeInTime", GUICtrlRead($Slider_Fadein_Time))
    IniWrite($IniFile, "Levels", "MaxVolume", GUICtrlRead($Slider_MaxVol))
EndFunc

Func WriteSnoozeTime()
    IniWrite($IniFile, "Snooze Time", "SnoozeTime", GUICtrlRead($Input_Snooze))
    ;MsgBox(0, "Snooze Time", "$Input_Snooze = " &amp; $Input_Snooze &amp; "  GUI_CtrlId = " &amp; @GUI_CtrlId &amp; @LF)
EndFunc

Func WriteAlarmTime()
    IniWrite($IniFile, "Alarm Time", "AlarmTime", GUICtrlRead($Input_AlarmTime))
    ;MsgBox(0, "Alarm Time", "GUI_CtrlId = " &amp; @GUI_CtrlId &amp; @LF)
EndFunc

Func MouseOverTray()
    If BitAND(WinGetState("X-Lorem Ipsum", ""), 2) Then
        TrayItemSetText($TrayToggleHide, "Hide Window")
    Else
        TrayItemSetText($TrayToggleHide, "Show Window")
    EndIf
EndFunc

Func ToggleHotKey()
    Switch $HotKeyAble
        Case 0
            TrayItemSetText($TrayToggleHotKey, "Disable Hotkeys")
            GUICtrlSetData($Tab2_Label7, " &gt;-  Enabled")
            HotKeySet("{F2}", "VolUpDownMute")
            HotKeySet("{F3}", "VolUpDownMute")
            HotKeySet("{F4}", "VolUpDownMute")
            HotKeySet("{F10}", "ToggleHide")
            HotKeySet("{SPACE}", "Snooze")
            $HotKeyAble = 1
        Case 1
            TrayItemSetText($TrayToggleHotKey, "Enable Hotkeys")
            GUICtrlSetData($Tab2_Label7, " |-  Disabled")
            HotKeySet("{F2}")
            HotKeySet("{F3}")
            HotKeySet("{F4}")
            HotKeySet("{F10}")
            HotKeySet("{SPACE}")
            $HotKeyAble = 0
    EndSwitch
EndFunc   ;==&gt;ToggleHotKey

Func CheckWinampStop()
    If GUICtrlRead($Combo_WinAmpStop) &lt;&gt; "  Stop-n-Play " Then GUICtrlSetState($Input_AlarmTime, $GUI_DISABLE)
EndFunc

Func Restart()
    If @HotKeyPressed = "{SPACE}" Then _Winamp_Play()
    $MouPos = WinGetPos("X-Lorem Ipsum")
    If $MouPos[0] &amp; "," &amp; $MouPos[1] &lt;&gt; "10,535" Then IniWrite($IniFile, "XLorem Position", "XPos", $MouPos[0] &amp; ", " &amp; $MouPos[1])
; Restart your program - http://www.autoitscript.com/forum/index.php?s=&amp;showtopic=19370&amp;view=findpost&amp;p=199608
; Author UP_NORTH
    If @Compiled = 1 Then
        Run(FileGetShortName(@ScriptFullPath))
    Else
        Run(FileGetShortName(@AutoItExe) &amp; " " &amp; FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc     ;==&gt;Restart

Func Quit()
    If @HotKeyPressed = "{SPACE}" Then _Winamp_Play()
    Exit
EndFunc   ;==&gt;Quit

</datetimeconstants.au3></progressconstants.au3></windowsconstants.au3></buttonconstants.au3></sliderconstants.au3></comboconstants.au3></guiconstantsex.au3></winamp_library.au3></editconstants.au3></constants.au3></guitab.au3></string.au3></date.au3></file.au3></misc.au3>

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0