Starting to grasp loops and such. Here's a new version. Next I want to add reading of a video to automatically plug in the minutes. Suggestions and or criticism welcome.
*Edit* Rushed it out and didn't test it enough. There's bugs that need to be fixed.
#include <GUIConstantsEx.au3>
$Form1 = GUICreate("Sleep Timer", 200, 150)
$Input1 = GUICtrlCreateInput("Minutes to Sleep", 50, 80, 100, 21)
$Button1 = GUICtrlCreateButton("OK", 50, 110, 100, 30, 0)
$Check1 = GUICtrlCreateRadio("Shutdown", 50, 20)
$Check2 = GUICtrlCreateRadio("Sleep", 50, 40)
GUISetState(@SW_SHOW) ; set the gui state to show so you can see it
$End = 0
While 1 ; start of loop
$Msg = GUIGetMsg()
Select
Case $Msg = $GUI_EVENT_CLOSE ; exit if the window is closed
Exit
Case $Msg = $Input1 ; grab input of minutes and multiply by 60000 to get time in miliseconds
$Mins = GUICtrlRead ($Input1)
$Min = 60000 * $Mins
Case $Msg = $Check1 ; if shutdown is selected asign 1 to $End
$End = 1
Case $Msg = $Check2 ; if sleep is selected asign 2 to $End
$End = 2
Case $Msg = $Button1 ; run the sleep timer
If $End = 0 Then
MsgBox(0, "Oops", "Please pick Shutdown or Sleep")
Sleep($Min)
ElseIf $End = 1 Then
Shutdown (9)
Exit
ElseIf $End = 2 Then
Shutdown (64)
Exit
EndIf
EndSelect
WEnd